Re: [PATCH 01/10] block: introduce BLK_FEAT_WRITE_ZEROES_UNMAP to queue limits features

2025-06-15 Thread Christoph Hellwig
On Sat, Jun 14, 2025 at 12:48:26PM +0800, Zhang Yi wrote: > >> Maybe we should redo this similar to the other hardware/software interfaces > >> and have a hw_ limit that is exposed by the driver and re-only in > >> sysfs, and then the user configurable one without _hw. Setting it to > >> zero disa

Re: [PATCH 01/10] block: introduce BLK_FEAT_WRITE_ZEROES_UNMAP to queue limits features

2025-06-13 Thread Zhang Yi
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 (none and unmap). What if we keep

Re: [PATCH 01/10] block: introduce BLK_FEAT_WRITE_ZEROES_UNMAP to queue limits features

2025-06-13 Thread Darrick J. Wong
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 (none and unmap). What if we keep it as is and simply > > hide this interface i

Re: [PATCH 01/10] block: introduce BLK_FEAT_WRITE_ZEROES_UNMAP to queue limits features

2025-06-12 Thread Christoph Hellwig
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 (none and unmap). What if we keep it as is and simply > hide this interface if BLK_FEAT_WRITE_ZEROES_UNMAP is not set, making > it visible only when the

Re: [PATCH 01/10] block: introduce BLK_FEAT_WRITE_ZEROES_UNMAP to queue limits features

2025-06-12 Thread Zhang Yi
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 write zeroes command */ >> +#define BLK_FEAT_WRITE_ZEROE

Re: [PATCH 01/10] block: introduce BLK_FEAT_WRITE_ZEROES_UNMAP to queue limits features

2025-06-12 Thread Darrick J. Wong
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 write zeroes command */ > +#define BLK_FEAT_WRITE_ZEROES_UNMAP ((__force blk_features_t)(1u << >

Re: [PATCH 01/10] block: introduce BLK_FEAT_WRITE_ZEROES_UNMAP to queue limits features

2025-06-12 Thread Zhang Yi
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)) >>> >>> >>> Should this be exposed through sysfs as a r

Re: [PATCH 01/10] block: introduce BLK_FEAT_WRITE_ZEROES_UNMAP to queue limits features

2025-06-11 Thread Christoph Hellwig
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)) > > > > > > Should this be exposed through sysfs as a read-only value? > > Uh, are you suggesting a

Re: [PATCH 01/10] block: introduce BLK_FEAT_WRITE_ZEROES_UNMAP to queue limits features

2025-06-11 Thread Zhang Yi
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 *disk, >> +const char *

Re: [PATCH 01/10] block: introduce BLK_FEAT_WRITE_ZEROES_UNMAP to queue limits features

2025-06-10 Thread Christoph Hellwig
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 *disk, > + const char *page, size_t count, struct queue_limits *lim) We're pro

[PATCH 01/10] block: introduce BLK_FEAT_WRITE_ZEROES_UNMAP to queue limits features

2025-06-03 Thread Zhang Yi
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 i