On 2025/2/8 6:14, Benjamin Marzinski wrote:
> On Wed, Jan 15, 2025 at 07:46:33PM +0800, Zhang Yi wrote:
>> From: Zhang Yi
>>
>> Set the BLK_FEAT_WRITE_ZEROES_UNMAP feature on stacking queue limits by
>> default. This feature shall be disabled if any underlying de
On 2025/1/29 0:46, John Garry wrote:
> On 15/01/2025 11:46, Zhang Yi wrote:
>> From: Zhang Yi
>>
>> Currently, it's hard to know whether the storage device supports unmap
>> write zeroes. We cannot determine it only by checking if the disk
>> supports the
On 2025/2/7 20:22, Zhang Yi wrote:
> On 2025/1/29 0:46, John Garry wrote:
>> On 15/01/2025 11:46, Zhang Yi wrote:
>>> From: Zhang Yi
>>>
>>> Currently, it's hard to know whether the storage device supports unmap
>>> write zeroes. We cannot dete
On 2025/1/28 14:46, Christoph Hellwig wrote:
> I think you also need to add BLK_FEAT_WRITE_ZEROES_UNMAP to the list
> of features supported by the nvme-mpath stacking driver in
> nvme_mpath_alloc_disk, so that this gets propagated to multipathed
> devices.
>
> Otherwise this looks good to me.
Ha,
From: Zhang Yi
Set the BLK_FEAT_WRITE_ZEROES_UNMAP feature on stacking queue limits by
default. This feature shall be disabled if any underlying device does
not support it.
Signed-off-by: Zhang Yi
---
drivers/md/dm-table.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a
From: Zhang Yi
Currently, it's hard to know whether the storage device supports unmap
write zeroes. We cannot determine it only by checking if the disk
supports the write zeroes command, as for some HDDs that do submit
actual zeros to the disk media even if they claim to support the write
z
From: Zhang Yi
Changes since v1:
- Switch to add a new write zeroes operation, FALLOC_FL_WRITE_ZEROES,
in fallocate, instead of just adding a supported flag to
FALLOC_FL_ZERO_RANGE.
- Introduce a new flag BLK_FEAT_WRITE_ZEROES_UNMAP to the block
device's queue limit features
From: Zhang Yi
When the device supports the Write Zeroes command and the zeroing mode
is set to SD_ZERO_WS16_UNMAP or SD_ZERO_WS10_UNMAP, this means that the
device supports unmap Write Zeroes, so set the corresponding
BLK_FEAT_WRITE_ZEROES_UNMAP feature to the device's queue limit.
Signe
From: Zhang Yi
When the device supports the Write Zeroes command and the DEAC bit, it
indicates that the deallocate bit in the Write Zeroes command is
supported, and the bytes read from a deallocated logical block are
zeroes. This means the device supports unmap Write Zeroes, so set the
From: Zhang Yi
Only the flags passed to blkdev_issue_zeroout() differ among the three
zeroing branches in blkdev_fallocate(). Therefore, do cleanup by
factoring them out.
Signed-off-by: Zhang Yi
---
block/fops.c | 40 +++-
1 file changed, 15 insertions
From: Zhang Yi
Add support for FALLOC_FL_WRITE_ZEROES. This first allocates blocks as
unwritten, then issues a zero command outside of the running journal
handle, and finally converts them to a written state.
Signed-off-by: Zhang Yi
---
fs/ext4/extents.c | 59
From: Zhang Yi
Add support for FALLOC_FL_WRITE_ZEROES. It directly calls
blkdev_issue_zeroout() with flags set to 0. The underlying process will
attempt to use the fastest method for issuing zeroes. First, the block
layer will try to issue a write zeroes command if the storage device
supports it
From: Zhang Yi
With the development of flash-based storage devices, we can quickly
write zeros to SSDs using the WRITE_ZERO command if the devices do not
actually write physical zeroes to the media. Therefore, we can use this
command to quickly preallocate a real all-zero file with written
On 2025/1/16 5:07, Chaitanya Kulkarni wrote:
> On 1/15/25 03:46, Zhang Yi wrote:
>> Currently, we can use the fallocate command to quickly create a
>> pre-allocated file. However, on most filesystems, such as ext4 and XFS,
>> fallocate create pre-allocation blocks in an unw
From: Zhang Yi
Changes since RFC v2:
- Rebase codes on next-20250314.
- Add support for nvme multipath.
- Add support for NVMeT with block device backing.
- Clear FALLOC_FL_WRITE_ZEROES if dm clear
limits->max_write_zeroes_sectors.
- Complement the counterpart userspace tools(util-li
From: Zhang Yi
Add fsx to suppoet fallocate FALLOC_FL_WRITE_ZEROES command by
introducing OP_WRITE_ZEROES operation.
Signed-off-by: Zhang Yi
---
ltp/fsx.c | 80 +++
1 file changed, 80 insertions(+)
diff --git a/ltp/fsx.c b/ltp/fsx.c
index
From: Zhang Yi
With the development of flash-based storage devices, we can quickly
write zeros to SSDs using the WRITE_ZERO command if the devices do not
actually write physical zeroes to the media. Therefore, we can use this
command to quickly preallocate a real all-zero file with written
From: Zhang Yi
Test the fallocate FALLOC_FL_WRITE_ZEROES command on a block device,
including unsupported flags.
Signed-off-by: Zhang Yi
---
tests/generic/766 | 80 +++
tests/generic/766.out | 23 +
2 files changed, 103 insertions
From: Zhang Yi
When the device supports the Write Zeroes command and the DEAC bit, it
indicates that the deallocate bit in the Write Zeroes command is
supported, and the bytes read from a deallocated logical block are
zeroes. This means the device supports unmap Write Zeroes, so set the
From: Zhang Yi
When the device supports the Write Zeroes command and the zeroing mode
is set to SD_ZERO_WS16_UNMAP or SD_ZERO_WS10_UNMAP, this means that the
device supports unmap Write Zeroes, so set the corresponding
BLK_FEAT_WRITE_ZEROES_UNMAP feature to the device's queue limit.
Signe
From: Zhang Yi
Set the BLK_FEAT_WRITE_ZEROES_UNMAP feature on stacking queue limits by
default. This feature shall be disabled if any underlying device does
not support it.
Signed-off-by: Zhang Yi
---
drivers/md/dm-table.c | 7 +--
drivers/md/dm.c | 1 +
2 files changed, 6
From: Zhang Yi
Add support for FALLOC_FL_WRITE_ZEROES. This first allocates blocks as
unwritten, then issues a zero command outside of the running journal
handle, and finally converts them to a written state.
Signed-off-by: Zhang Yi
---
fs/ext4/extents.c | 59
From: Zhang Yi
Add support for FALLOC_FL_WRITE_ZEROES. It directly calls
blkdev_issue_zeroout() with flags set to 0. The underlying process will
attempt to use the fastest method for issuing zeroes. First, the block
layer will try to issue a write zeroes command if the storage device
supports it
From: Zhang Yi
Only the flags passed to blkdev_issue_zeroout() differ among the three
zeroing branches in blkdev_fallocate(). Therefore, do cleanup by
factoring them out.
Signed-off-by: Zhang Yi
---
block/fops.c | 40 +++-
1 file changed, 15 insertions
From: Zhang Yi
Add fstress to suppoet fallocate FALLOC_FL_WRITE_ZEROES command by
introducing OP_WZERO operation.
Signed-off-by: Zhang Yi
---
ltp/fsstress.c | 12
src/global.h | 4
2 files changed, 16 insertions(+)
diff --git a/ltp/fsstress.c b/ltp/fsstress.c
index
From: Zhang Yi
Set the BLK_FEAT_WRITE_ZEROES_UNMAP feature while creating multipath
stacking queue limits by default. This feature shall be disabled if any
attached namespace does not support it.
Signed-off-by: Zhang Yi
---
drivers/nvme/host/multipath.c | 3 ++-
1 file changed, 2 insertions
From: Zhang Yi
Currently, disks primarily implement the write zeroes command (aka
REQ_OP_WRITE_ZEROES) through two mechanisms: the first involves
physically writing zeros to the disk media (e.g., HDDs), while the
second performs an unmap operation on the logical blocks, effectively
putting them
From: Zhang Yi
The Linux kernel is planning to support FALLOC_FL_WRITE_ZEROES in
fallocate(2). Add FALLOC_FL_ZERO_RANGE support to fallocate utility by
introducing a new 'fwzero' command to xfs_io.
Signed-off-by: Zhang Yi
---
io/prealloc.c | 36 +++
From: Zhang Yi
Test block device unmap write zeroes sysfs interface with NVMeT devices
which are based on various SCSI debug devices. The
/sys/block//queue/write_zeroes_unmap interface should return 1 if
the NVMeT devices support the unmap write zeroes command, and it should
return 0 otherwise
From: Zhang Yi
Test block device unmap write zeroes sysfs interface with various SCSI
debug devices. The /sys/block//queue/write_zeroes_unmap interface
should return 1 if the SCSI device enable the WRITE SAME command with
unmap functionality, and it should return 0 otherwise.
Signed-off-by
From: Zhang Yi
The Linux kernel is planning to support FALLOC_FL_WRITE_ZEROES in
fallocate(2). Add tests for the newly added BLK_FEAT_WRITE_ZEROES_UNMAP
feature flag on the block device queue limit. These tests test block
device unmap write zeroes sysfs interface
/sys/block//queue
From: Zhang Yi
The Linux kernel is planning to supports FALLOC_FL_WRITE_ZEROES in
fallocate(2). Add FALLOC_FL_ZERO_RANGE support to fallocate utility by
introducing a new option -w|--write-zeroes.
Signed-off-by: Zhang Yi
---
sys-utils/fallocate.1.adoc | 11 +--
sys-utils/fallocate.c
From: Zhang Yi
Add generic tests for the fallocate FALLOC_FL_WRITE_ZEROES command.
Signed-off-by: Zhang Yi
---
tests/generic/765 | 40 +++
tests/generic/765.out | 269 ++
2 files changed, 309 insertions(+)
create mode 100755 tests/generic/765
From: Zhang Yi
The Linux kernel is planning to support FALLOC_FL_WRITE_ZEROES in
fallocate(2). Add tests for the newly added fallocate
FALLOC_FL_WRITE_ZEROES command. This series depends on the changes to
xfs_io [1] that introduced the 'fwzero' command.
- generic/764 is an extension
From: Zhang Yi
Set WZDS and DRB bit to the namespace dlfeat if the underlying block
device supports BLK_FEAT_WRITE_ZEROES_UNMAP, make the nvme target
device supports unmaped write zeroes command.
Signed-off-by: Zhang Yi
---
drivers/nvme/target/io-cmd-bdev.c | 4
include/linux/blkdev.h
On 2025/4/10 16:20, Keith Busch wrote:
> On Thu, Apr 10, 2025 at 09:15:59AM +0200, Christoph Hellwig wrote:
>> On Thu, Apr 10, 2025 at 11:52:17AM +0800, Zhang Yi wrote:
>>>
>>> Thank you for your review and comments. However, I'm not sure I fully
>>>
On 2025/4/9 18:31, Christoph Hellwig wrote:
> On Tue, Mar 18, 2025 at 03:35:36PM +0800, Zhang Yi wrote:
>> From: Zhang Yi
>>
>> Currently, disks primarily implement the write zeroes command (aka
>> REQ_OP_WRITE_ZEROES) through two mechanisms: the first involves
>>
From: Zhang Yi
When the device supports the Write Zeroes command and the DEAC bit, it
indicates that the deallocate bit in the Write Zeroes command is
supported, and the bytes read from a deallocated logical block are
zeroes. This means the device supports unmap Write Zeroes, so set the
From: Zhang Yi
Currently, disks primarily implement the write zeroes command (aka
REQ_OP_WRITE_ZEROES) through two mechanisms: the first involves
physically writing zeros to the disk media (e.g., HDDs), while the
second performs an unmap operation on the logical blocks, effectively
putting them
From: Zhang Yi
Set the BLK_FEAT_WRITE_ZEROES_UNMAP feature on stacking queue limits by
default. This feature shall be disabled if any underlying device does
not support it.
Signed-off-by: Zhang Yi
Reviewed-by: Benjamin Marzinski
---
drivers/md/dm-table.c | 7 +--
drivers/md/dm.c
From: Zhang Yi
When the device supports the Write Zeroes command and the zeroing mode
is set to SD_ZERO_WS16_UNMAP or SD_ZERO_WS10_UNMAP, this means that the
device supports unmap Write Zeroes, so set the corresponding
BLK_FEAT_WRITE_ZEROES_UNMAP feature to the device's queue limit.
Signe
From: Zhang Yi
Set the BLK_FEAT_WRITE_ZEROES_UNMAP feature while creating multipath
stacking queue limits by default. This feature shall be disabled if any
attached namespace does not support it.
Signed-off-by: Zhang Yi
---
drivers/nvme/host/multipath.c | 3 ++-
1 file changed, 2 insertions
From: Zhang Yi
With the development of flash-based storage devices, we can quickly
write zeros to SSDs using the WRITE_ZERO command if the devices do not
actually write physical zeroes to the media. Therefore, we can use this
command to quickly preallocate a real all-zero file with written
From: Zhang Yi
Add a new attribute flag to statx to determine whether a bdev or a file
supports the unmap write zeroes command.
Signed-off-by: Zhang Yi
---
block/bdev.c | 4
fs/ext4/inode.c | 9 ++---
include/uapi/linux/stat.h | 1 +
3 files changed, 11
From: Zhang Yi
Add support for FALLOC_FL_WRITE_ZEROES. It directly calls
blkdev_issue_zeroout() with flags set to 0. The underlying process will
attempt to use the fastest method for issuing zeroes. First, the block
layer will try to issue a write zeroes command if the storage device
supports it
From: Zhang Yi
Add support for FALLOC_FL_WRITE_ZEROES. This first allocates blocks as
unwritten, then issues a zero command outside of the running journal
handle, and finally converts them to a written state.
Signed-off-by: Zhang Yi
---
fs/ext4/extents.c | 59
From: Zhang Yi
Set WZDS and DRB bit to the namespace dlfeat if the underlying block
device supports BLK_FEAT_WRITE_ZEROES_UNMAP, make the nvme target
device supports unmaped write zeroes command.
Signed-off-by: Zhang Yi
---
drivers/nvme/target/io-cmd-bdev.c | 4
1 file changed, 4
From: Zhang Yi
Only the flags passed to blkdev_issue_zeroout() differ among the two
zeroing branches in blkdev_fallocate(). Therefore, do cleanup by
factoring them out.
Signed-off-by: Zhang Yi
Reviewed-by: Christoph Hellwig
---
block/fops.c | 32 ++--
1 file
From: Zhang Yi
Changes sicne RFC v3:
- Rebase codes on 6.15-rc2.
- Add a note in patch 1 to indicate that the unmap write zeros command
is not always guaranteed as Christoph suggested.
- Rename bdev_unmap_write_zeroes() helper and move it to patch 1 as
Christoph suggested.
- Introduce
On 2025/4/9 18:50, Christian Brauner wrote:
> On Wed, Apr 09, 2025 at 12:35:48PM +0200, Christoph Hellwig wrote:
>> On Tue, Mar 18, 2025 at 03:35:42PM +0800, Zhang Yi wrote:
>>> Users can check the disk support of unmap write zeroes command by
>>> querying:
&g
Hello Shinichiro!
I apologize for the significant delay, and I greatly appreciate your
review and suggestions.
On 2025/4/3 15:26, Shinichiro Kawasaki wrote:
> Hello Zhang, thank you for the patches.
>
> On Mar 18, 2025 / 15:28, Zhang Yi wrote:
>> From: Zhang Yi
>>
>&
On 2025/4/3 15:43, Shinichiro Kawasaki wrote:
> On Mar 18, 2025 / 15:28, Zhang Yi wrote:
>> From: Zhang Yi
>>
>> Test block device unmap write zeroes sysfs interface with device-mapper
>> stacked devices. The /sys/block//queue/write_zeroes_unmap
>> interface
On 2025/4/3 15:55, Shinichiro Kawasaki wrote:
> On Mar 18, 2025 / 15:28, Zhang Yi wrote:
>> From: Zhang Yi
>>
>> The Linux kernel is planning to support FALLOC_FL_WRITE_ZEROES in
>> fallocate(2). Add tests for the newly added BLK_FEAT_WRITE_ZEROES_UNMAP
>> featu
On 2025/4/28 16:13, Shinichiro Kawasaki wrote:
> On Apr 28, 2025 / 12:32, Zhang Yi wrote:
>> On 2025/4/3 15:43, Shinichiro Kawasaki wrote:
> [...]
>>>> +
>>>> +setup_test_device() {
>>>> + if ! _configure_scsi_debug "$@"; then
>>>
On 2025/4/28 17:25, Shinichiro Kawasaki wrote:
> On Apr 28, 2025 / 17:04, Zhang Yi wrote:
>> On 2025/4/28 16:13, Shinichiro Kawasaki wrote:
>>> On Apr 28, 2025 / 12:32, Zhang Yi wrote:
>>>> On 2025/4/3 15:43, Shinichiro Kawasaki wrote:
>>> [
On 2025/5/5 22:29, Darrick J. Wong wrote:
> On Mon, May 05, 2025 at 03:22:08PM +0200, Christoph Hellwig wrote:
>> On Mon, Apr 21, 2025 at 10:15:05AM +0800, Zhang Yi wrote:
>>> From: Zhang Yi
>>>
>>> Add a new attribute flag to statx to determine whether a b
Hi, Martin!
On 2025/5/6 12:21, Martin K. Petersen wrote:
>
> Hi Zhang!
>
>> +[RO] Devices that explicitly support the unmap write zeroes
>> +operation in which a single write zeroes request with the unmap
>> +bit set to zero out the range of contiguous blocks
On 2025/5/6 12:39, Christoph Hellwig wrote:
> On Tue, May 06, 2025 at 12:28:54PM +0800, Zhang Yi wrote:
>> OK, since this statx reporting flag is not strongly tied to
>> FALLOC_FL_WRITE_ZEROES in vfs_fallocate(), I'll split this patch into
>> three separate patches.
>
On 2025/5/6 13:47, Christoph Hellwig wrote:
> On Mon, May 05, 2025 at 10:36:54PM -0700, Darrick J. Wong wrote:
>> I think STATX_* (i.e. not STATX_ATTR_*) flags have two purposes: 1) to
>> declare that specific fields in struct statx actually have meaning, most
>> notably in scenarios where zeroes a
On 2025/4/10 15:15, Christoph Hellwig wrote:
> On Thu, Apr 10, 2025 at 11:52:17AM +0800, Zhang Yi wrote:
>>
>> Thank you for your review and comments. However, I'm not sure I fully
>> understand your points. Could you please provide more details?
>>
>> AFAI
From: Zhang Yi
Add page boundaries and boundaries that are off-by-one tests for the
fallocate FALLOC_FL_WRITE_ZEROES command.
Signed-off-by: Zhang Yi
---
common/rc | 2 +-
tests/generic/764 | 34
tests/generic/764.out | 433 ++
3
From: Zhang Yi
Test block device unmap write zeroes sysfs interface with device-mapper
stacked devices. The /sys/block//queue/write_zeroes_unmap
interface should return 1 if the underlying devices support the unmap
write zeroes command, and it should return 0 otherwise.
Signed-off-by: Zhang Yi
On 2025/5/8 13:01, Christoph Hellwig wrote:
> On Wed, May 07, 2025 at 03:33:23PM +0800, Zhang Yi wrote:
>> On 2025/5/6 20:11, Christoph Hellwig wrote:
>>> On Tue, May 06, 2025 at 07:16:56PM +0800, Zhang Yi wrote:
>>>> Sorry, but I don
On 2025/5/9 4:24, Theodore Ts'o wrote:
> On Thu, May 08, 2025 at 08:17:14PM +0800, Zhang Yi wrote:
>> On 2025/5/8 13:01, Christoph Hellwig wrote:
>>>>
>>>> My idea is not to strictly limiting the use of FALLOC_FL_WRITE_ZEROES to
>>>> only bdev or
On 2025/5/6 20:11, Christoph Hellwig wrote:
> On Tue, May 06, 2025 at 07:16:56PM +0800, Zhang Yi wrote:
>> Sorry, but I don't understand your suggestion. The
>> STATX_ATTR_WRITE_ZEROES_UNMAP attribute only indicate whether the bdev
>> and the block device that under
On 2025/5/6 23:55, Darrick J. Wong wrote:
> On Tue, May 06, 2025 at 02:10:12PM +0200, Christoph Hellwig wrote:
>> On Tue, May 06, 2025 at 07:25:06PM +0800, Zhang Yi wrote:
>>> + if (request_mask & STATX_WRITE_ZEROES_UNMAP &&
>>> +
From: Zhang Yi
The unmap write zeroes limits have been set to the stacking queue limits
by default in blk_set_stacking_limits() and blk_stack_limits(), but it
should be cleared if any underlying device does not support it.
Signed-off-by: Zhang Yi
---
drivers/md/dm-table.c | 4 +++-
1 file
From: Zhang Yi
Set the WZDS and DRB bits to the namespace dlfeat if the underlying
block device enables the unmap write zeroes operation, make the nvme
target device supports the unmap write zeroes command.
Signed-off-by: Zhang Yi
---
drivers/nvme/target/io-cmd-bdev.c | 4
1 file changed
From: Zhang Yi
Changes since v1:
- Rebase codes on 6.16-rc2.
- Use max_{hw|user}_wzeroes_unmap_sectors queue limits instead of
BLK_FEAT_WRITE_ZEROES_UNMAP feature to represent the status of the
unmap write zeroes operation as Christoph and Darrick suggested. This
redoes the first 5
From: Zhang Yi
Add support for FALLOC_FL_WRITE_ZEROES, if the block device enables the
unmap write zeroes operation, it will issue a write zeroes command.
Signed-off-by: Zhang Yi
Reviewed-by: Christoph Hellwig
Reviewed-by: Martin K. Petersen
---
block/fops.c | 12 +++-
1 file
From: Zhang Yi
With the development of flash-based storage devices, we can quickly
write zeros to SSDs using the WRITE_ZERO command if the devices do not
actually write physical zeroes to the media. Therefore, we can use this
command to quickly preallocate a real all-zero file with written
From: Zhang Yi
Only the flags passed to blkdev_issue_zeroout() differ among the two
zeroing branches in blkdev_fallocate(). Therefore, do cleanup by
factoring them out.
Signed-off-by: Zhang Yi
Reviewed-by: Christoph Hellwig
Reviewed-by: Martin K. Petersen
---
block/fops.c | 32
From: Zhang Yi
Currently, disks primarily implement the write zeroes command (aka
REQ_OP_WRITE_ZEROES) through two mechanisms: the first involves
physically writing zeros to the disk media (e.g., HDDs), while the
second performs an unmap operation on the logical blocks, effectively
putting them
From: Zhang Yi
When the device supports the Write Zeroes command and the DEAC bit, it
indicates that the deallocate bit in the Write Zeroes command is
supported, and the bytes read from a deallocated logical block are
zeroes. This means the device supports unmap Write Zeroes operation, so
set
From: Zhang Yi
When the device supports the Write Zeroes command and the zeroing mode
is set to SD_ZERO_WS16_UNMAP or SD_ZERO_WS10_UNMAP, this means that the
device supports unmap Write Zeroes, so set the corresponding
max_hw_write_zeroes_unmap_sectors to max_write_zeroes_sectors on the
device
From: Zhang Yi
Add support for FALLOC_FL_WRITE_ZEROES if the underlying device enable
the unmap write zeroes operation. This first allocates blocks as
unwritten, then issues a zero command outside of the running journal
handle, and finally converts them to a written state.
Signed-off-by: Zhang
On 2025/6/17 0:59, Martin K. Petersen wrote:
>
> Christian,
>
>>> This looks OK to me as long as the fs folks agree on the fallocate()
>>> semantics.
>>
>> That looks overall fine. Should I queue this up in the vfs tree?
>
> We're expecting another revision addressing the queue limit sysfs
> ove
On 2025/6/12 23:03, Darrick J. Wong wrote:
> On Thu, Jun 12, 2025 at 07:20:45PM +0800, Zhang Yi wrote:
>> On 2025/6/12 12:47, Christoph Hellwig wrote:
>>> On Wed, Jun 11, 2025 at 03:31:21PM +0800, Zhang Yi wrote:
>>>>>> +/* supports unmap wri
On 2025/6/13 22:54, Darrick J. Wong wrote:
> On Fri, Jun 13, 2025 at 07:56:30AM +0200, Christoph Hellwig wrote:
>> On Fri, Jun 13, 2025 at 11:15:41AM +0800, Zhang Yi wrote:
>>> Yeah, this solution looks good to me. However, we currently have only
>>> two selections (
On 2025/6/23 23:08, Martin K. Petersen wrote:
>
> Zhang,
>
>> This series implements the BLK_FEAT_WRITE_ZEROES_UNMAP feature and
>> BLK_FLAG_WRITE_ZEROES_UNMAP_DISABLED flag for SCSI, NVMe and
>> device-mapper drivers, and add the FALLOC_FL_WRITE_ZEROES and
>> STATX_ATTR_WRITE_ZEROES_UNMAP suppor
From: Zhang Yi
Currently, disks primarily implement the write zeroes command (aka
REQ_OP_WRITE_ZEROES) through two mechanisms: the first involves
physically writing zeros to the disk media (e.g., HDDs), while the
second performs an unmap operation on the logical blocks, effectively
putting them
From: Zhang Yi
Changes since RFC v4:
- Rebase codes on 6.16-rc1.
- Add a new queue_limit flag, and change the write_zeroes_unmap sysfs
interface to RW mode. User can disable the unmap write zeroes
operation by writing '0' to it when the operation is slow.
- Modify the docume
From: Zhang Yi
Set WZDS and DRB bit to the namespace dlfeat if the underlying block
device supports BLK_FEAT_WRITE_ZEROES_UNMAP, make the nvme target
device supports unmaped write zeroes command.
Signed-off-by: Zhang Yi
Reviewed-by: Christoph Hellwig
---
drivers/nvme/target/io-cmd-bdev.c | 4
From: Zhang Yi
When the device supports the Write Zeroes command and the zeroing mode
is set to SD_ZERO_WS16_UNMAP or SD_ZERO_WS10_UNMAP, this means that the
device supports unmap Write Zeroes, so set the corresponding
BLK_FEAT_WRITE_ZEROES_UNMAP feature to the device's queue limit.
Signe
From: Zhang Yi
With the development of flash-based storage devices, we can quickly
write zeros to SSDs using the WRITE_ZERO command if the devices do not
actually write physical zeroes to the media. Therefore, we can use this
command to quickly preallocate a real all-zero file with written
From: Zhang Yi
Add support for FALLOC_FL_WRITE_ZEROES, if the block device enables the
unmap write zeroes operation, it will issue a write zeroes command.
Signed-off-by: Zhang Yi
---
block/fops.c | 12 +++-
1 file changed, 11 insertions(+), 1 deletion(-)
diff --git a/block/fops.c b
From: Zhang Yi
Add support for FALLOC_FL_WRITE_ZEROES if the underlying device enable
the unmap write zeroes operation. This first allocates blocks as
unwritten, then issues a zero command outside of the running journal
handle, and finally converts them to a written state.
Signed-off-by: Zhang
From: Zhang Yi
Set the BLK_FEAT_WRITE_ZEROES_UNMAP feature while creating multipath
stacking queue limits by default. This feature shall be disabled if any
attached namespace does not support it.
Signed-off-by: Zhang Yi
Reviewed-by: Christoph Hellwig
---
drivers/nvme/host/multipath.c | 3
From: Zhang Yi
Only the flags passed to blkdev_issue_zeroout() differ among the two
zeroing branches in blkdev_fallocate(). Therefore, do cleanup by
factoring them out.
Signed-off-by: Zhang Yi
Reviewed-by: Christoph Hellwig
---
block/fops.c | 32 ++--
1 file
From: Zhang Yi
When the device supports the Write Zeroes command and the DEAC bit, it
indicates that the deallocate bit in the Write Zeroes command is
supported, and the bytes read from a deallocated logical block are
zeroes. This means the device supports unmap Write Zeroes, so set the
From: Zhang Yi
Set the BLK_FEAT_WRITE_ZEROES_UNMAP feature on stacking queue limits by
default. This feature shall be disabled if any underlying device does
not support it.
Signed-off-by: Zhang Yi
Reviewed-by: Benjamin Marzinski
---
drivers/md/dm-table.c | 7 +--
drivers/md/dm.c
On 2025/6/11 14:09, Christoph Hellwig wrote:
> On Wed, Jun 04, 2025 at 10:08:41AM +0800, Zhang Yi wrote:
>> +static ssize_t queue_write_zeroes_unmap_show(struct gendisk *disk, char
>> *page)
>
> ..
>
>> +static int queue_write_zeroes_unmap_store(struct gendisk *di
On 2025/6/11 23:05, Darrick J. Wong wrote:
> [cc linux-api about a fallocate uapi change]
>
> On Wed, Jun 04, 2025 at 10:08:47AM +0800, Zhang Yi wrote:
>> From: Zhang Yi
>>
>> With the development of flash-based storage devices, we can quickly
>> write zeros to
On 2025/6/12 12:47, Christoph Hellwig wrote:
> On Wed, Jun 11, 2025 at 03:31:21PM +0800, Zhang Yi wrote:
>>>> +/* supports unmap write zeroes command */
>>>> +#define BLK_FEAT_WRITE_ZEROES_UNMAP ((__force blk_features_t)(1u <<
>>>> 17))
>>
On 2025/6/23 18:46, Christian Brauner wrote:
> On Thu, 19 Jun 2025 19:17:57 +0800, Zhang Yi wrote:
>> From: Zhang Yi
>>
>> Changes since v1:
>> - Rebase codes on 6.16-rc2.
>> - Use max_{hw|user}_wzeroes_unmap_sectors queue limits instead of
>>BLK_FEAT_
95 matches
Mail list logo