Re: [RFC 0/2] rbd: respect REQ_NOUNMAP by setting new nounmap flag for ZERO op

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Thu, Jan 24, 2019 at 6:57 PM David Disseldorp <ddiss@xxxxxxx> wrote:
>
> On Thu, 24 Jan 2019 18:20:23 +0100, Ilya Dryomov wrote:
>
> > On Thu, Jan 24, 2019 at 5:45 PM David Disseldorp <ddiss@xxxxxxx> wrote:
> > >
> > > On Mon, 21 Jan 2019 08:58:22 -0500, Jason Dillaman wrote:
> > >
> > > > > Indeed, the users of REQ_NONUMAP are ioctl() and fallocate(), so the
> > > > > only
> > > > > practical value which comes to mind is performance (preallocate zeroed
> > > > > blocks and format any fs, etc) and possible secure-erase.  After some
> > > > > internal discussions about performance of writing zeroes (instead of
> > > > > true DISCARD) this seems does not bring any value, at least on
> > > > > bluestore,
> > > > > but secure wipe can make sense (for example using blkdiscard --zerouut).
> > >
> > > Another possible use case could be space reservations for thin (over)
> > > provisioned storage. E.g. I don't have anything to write now, but want
> > > to make sure that the array won't reject writes to this region in
> > > future.
> >
> > I think you might be conflating REQ_NONUMAP with UNMAP flag to WRITE
> > SAME (and the way zeroout is implemented for SCSI).  As I understand it,
> > REQ_NOUNMAP means "try to avoid deallocating when zeroing", definitely
> > not "allocate if not yet allocated".
>
> That doesn't quite match my interpretation of blkdiscard(8) "Zero-fill
> rather than discard" and blk_types.h "write the zero filled sector many
> times" + "do not free blocks when zeroing".

Discard isn't guaranteed to zero (or to deallocate for that matter).
The driver and the device are free to slice the discard request into
pieces, align or round it or even disregard it entirely.

Zeroout is guaranteed to zero, hence the distinction.  How that is
accomplished is up to the driver and the device.  It can write zeroes
explicitly, do an explicit write same, do a pre-allocating write same
(anchoring), deallocate, etc.

REQ_NOUNMAP is just a hint (that can be ignored) for when the device
can naturally do it either way.

Thanks,

                Ilya



[Index of Archives]     [CEPH Users]     [Ceph Large]     [Information on CEPH]     [Linux BTRFS]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux