All of lore.kernel.org
 help / color / mirror / Atom feed
* BLKZEROOUT ioctl and WriteZero opcode
@ 2018-05-03 15:15 אייל בן דוד
  2018-05-04 20:05 ` Keith Busch
  0 siblings, 1 reply; 5+ messages in thread
From: אייל בן דוד @ 2018-05-03 15:15 UTC (permalink / raw)


Hi all,

There is an ioctl command BLKZEROOUT that accepts range (lba + number
of block to zero)

Suppose:
Block device is an nvme device (e.g. /dev/nvme0nX)
Device does support the WriteZeroes opcode.

If so, does the kernel make use of the WriteZeroes opcode in the
implementation of BLKZEROOUT ?
Same question for BLKDISCARD.

Thanks
Eyal.

^ permalink raw reply	[flat|nested] 5+ messages in thread

* BLKZEROOUT ioctl and WriteZero opcode
  2018-05-03 15:15 BLKZEROOUT ioctl and WriteZero opcode אייל בן דוד
@ 2018-05-04 20:05 ` Keith Busch
  2018-05-07 12:17   ` Eyal BenDavid
  0 siblings, 1 reply; 5+ messages in thread
From: Keith Busch @ 2018-05-04 20:05 UTC (permalink / raw)


On Thu, May 03, 2018@06:15:54PM +0300, ???? ?? ??? wrote:
> There is an ioctl command BLKZEROOUT that accepts range (lba + number
> of block to zero)
> 
> Suppose:
> Block device is an nvme device (e.g. /dev/nvme0nX)
> Device does support the WriteZeroes opcode.
> 
> If so, does the kernel make use of the WriteZeroes opcode in the
> implementation of BLKZEROOUT ?
> Same question for BLKDISCARD.

The NVMe driver supports BLKDISACRD if the device supports the DSM
command.

The NVMe driver at the moment doesn't support the NVME Writes Zeroes
command. We had it briefly, but apparently broke Linus' machine; never
did figure out why. Relevent link:

  https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=cdb98c2698b4af287925abcba4d77d92af82a0c3

For devices that claim discard determinisitcally returns 0's on reads,
the driver will map the user BLKZEROOUT request to the DSM command
rather than NVMe Write Zeroes.

For testing NVMe Write Zeroes, the nvme passthrough ioctl may still
be used.

^ permalink raw reply	[flat|nested] 5+ messages in thread

* BLKZEROOUT ioctl and WriteZero opcode
  2018-05-04 20:05 ` Keith Busch
@ 2018-05-07 12:17   ` Eyal BenDavid
  2018-05-07 15:14     ` Keith Busch
  0 siblings, 1 reply; 5+ messages in thread
From: Eyal BenDavid @ 2018-05-07 12:17 UTC (permalink / raw)


Thanks Keith,

So:
BLKZEROOUT is not implemented by NVME passthru + Write Zeroes (for now).
BLKZEROOUT Is implemented by DSM provided the device guarantees 0's
are returned after "Unmap"
In order to to zero out a range, NVMe passthru with Write Zeroes
opcode must be used.

Is it correct?

Thanks,
Eyal


On Fri, May 4, 2018 at 11:05 PM, Keith Busch
<keith.busch@linux.intel.com> wrote:
> On Thu, May 03, 2018@06:15:54PM +0300, ???? ?? ??? wrote:
>> There is an ioctl command BLKZEROOUT that accepts range (lba + number
>> of block to zero)
>>
>> Suppose:
>> Block device is an nvme device (e.g. /dev/nvme0nX)
>> Device does support the WriteZeroes opcode.
>>
>> If so, does the kernel make use of the WriteZeroes opcode in the
>> implementation of BLKZEROOUT ?
>> Same question for BLKDISCARD.
>
> The NVMe driver supports BLKDISACRD if the device supports the DSM
> command.
>
> The NVMe driver at the moment doesn't support the NVME Writes Zeroes
> command. We had it briefly, but apparently broke Linus' machine; never
> did figure out why. Relevent link:
>
>   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=cdb98c2698b4af287925abcba4d77d92af82a0c3
>
> For devices that claim discard determinisitcally returns 0's on reads,
> the driver will map the user BLKZEROOUT request to the DSM command
> rather than NVMe Write Zeroes.
>
> For testing NVMe Write Zeroes, the nvme passthrough ioctl may still
> be used.

^ permalink raw reply	[flat|nested] 5+ messages in thread

* BLKZEROOUT ioctl and WriteZero opcode
  2018-05-07 12:17   ` Eyal BenDavid
@ 2018-05-07 15:14     ` Keith Busch
  2018-05-07 16:14       ` Eyal BenDavid
  0 siblings, 1 reply; 5+ messages in thread
From: Keith Busch @ 2018-05-07 15:14 UTC (permalink / raw)


On Mon, May 07, 2018@03:17:56PM +0300, Eyal BenDavid wrote:
> Thanks Keith,
> 
> So:
> BLKZEROOUT is not implemented by NVME passthru + Write Zeroes (for now).
> BLKZEROOUT Is implemented by DSM provided the device guarantees 0's
> are returned after "Unmap"
> In order to to zero out a range, NVMe passthru with Write Zeroes
> opcode must be used.
> 
> Is it correct?

Yes, that is correct.

^ permalink raw reply	[flat|nested] 5+ messages in thread

* BLKZEROOUT ioctl and WriteZero opcode
  2018-05-07 15:14     ` Keith Busch
@ 2018-05-07 16:14       ` Eyal BenDavid
  0 siblings, 0 replies; 5+ messages in thread
From: Eyal BenDavid @ 2018-05-07 16:14 UTC (permalink / raw)


Thanks!


On Mon, May 7, 2018@6:14 PM, Keith Busch <keith.busch@linux.intel.com> wrote:
> On Mon, May 07, 2018@03:17:56PM +0300, Eyal BenDavid wrote:
>> Thanks Keith,
>>
>> So:
>> BLKZEROOUT is not implemented by NVME passthru + Write Zeroes (for now).
>> BLKZEROOUT Is implemented by DSM provided the device guarantees 0's
>> are returned after "Unmap"
>> In order to to zero out a range, NVMe passthru with Write Zeroes
>> opcode must be used.
>>
>> Is it correct?
>
> Yes, that is correct.

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2018-05-07 16:14 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-05-03 15:15 BLKZEROOUT ioctl and WriteZero opcode אייל בן דוד
2018-05-04 20:05 ` Keith Busch
2018-05-07 12:17   ` Eyal BenDavid
2018-05-07 15:14     ` Keith Busch
2018-05-07 16:14       ` Eyal BenDavid

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.