|
|
|
|
|
|
|
|
|
|
xen-devel
[Xen-devel] Re: [PATCH 2 of 3] interface: Flesh out the BLKIF_OP_DISCARD
Thanks for splitting these out.
On Wed, 2011-10-12 at 23:12 +0100, Konrad Rzeszutek Wilk wrote:
[...]
> + * The backend can optionally provide two extra XenBus attributes to
> + * further optimize the discard functionality:
> + * 'discard-aligment' - Devices that support discard functionality may
> + * internally allocate space in units that are bigger than the exported
> + * logical block size. The discard-alignment parameter indicates how many
> bytes
> + * the beginning of the partition is offset from the internal allocation
> unit's
> + * natural alignment.
So this is to account for the case where a physical device can discard
e.g. 128K blocks at a time but the VBD (a better term than "partition"
in the context, I think) starts at e.g. offset 64K within that
underlying device?
Does this mean that the virtual device can discard the first 64K (and
thereafter in 128K chunks), or that it cannot because that would overlap
the first 64K of that block which belongs to something else? Or that it
can try but it may or may not succeed. What about if the secure flag is
set?
Could we simplify and say that blkback won't expose discard support
unless the underlying block device is correctly aligned for it? i.e.
encourage people to align their underlying storage correctly? Presumably
doing that has other benefits?
> + * 'discard-granularity' - Devices that support discard functionality may
> + * internally allocate space using units that are bigger than the logical
> block
> + * size. The discard-granularity parameter indicates the size of the internal
> + * allocation unit in bytes if reported by the device. Otherwise the
> + * discard-granularity will be set to match the device's physical block size.
This is effectively the minimum size you can discard? (modulo the
sub-block at the front arising from discard-alignment).
Presumably the granularity sized blocks are self aligned to that same ?
(again modulo the sub-block at the beginning).
Would there be any benefit to having both these numbers in logical-block
sized units instead of bytes? The rest of the interface typically uses
sectors/segments.
Ian.
> */
> #define BLKIF_OP_DISCARD 5
>
>
>
_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel
|
|
|
|
|