* [PATCH 0/2] Cleanup patches
@ 2026-01-29 7:27 Damien Le Moal
2026-01-29 7:27 ` [PATCH 1/2] block: cleanup queue limit features definition Damien Le Moal
` (3 more replies)
0 siblings, 4 replies; 15+ messages in thread
From: Damien Le Moal @ 2026-01-29 7:27 UTC (permalink / raw)
To: Jens Axboe, linux-block
Jens,
Here is a couple of cleanup patches for the block layer.
No functional changes are introduced by these patches.
Damien Le Moal (2):
block: cleanup queue limit features definition
block: introduce blk_queue_rot()
block/bfq-iosched.c | 20 ++++++++++----------
block/blk-iocost.c | 2 +-
block/blk-iolatency.c | 5 +----
block/blk-wbt.c | 5 ++---
include/linux/blkdev.h | 11 +++++------
5 files changed, 19 insertions(+), 24 deletions(-)
--
2.52.0
^ permalink raw reply [flat|nested] 15+ messages in thread* [PATCH 1/2] block: cleanup queue limit features definition 2026-01-29 7:27 [PATCH 0/2] Cleanup patches Damien Le Moal @ 2026-01-29 7:27 ` Damien Le Moal 2026-01-29 9:22 ` Nitesh Shetty ` (2 more replies) 2026-01-29 7:27 ` [PATCH 2/2] block: introduce blk_queue_rot() Damien Le Moal ` (2 subsequent siblings) 3 siblings, 3 replies; 15+ messages in thread From: Damien Le Moal @ 2026-01-29 7:27 UTC (permalink / raw) To: Jens Axboe, linux-block Unwrap the definition of BLK_FEAT_ATOMIC_WRITES and renumber this feature to be sequential with BLK_FEAT_SKIP_TAGSET_QUIESCE. Signed-off-by: Damien Le Moal <dlemoal@kernel.org> --- include/linux/blkdev.h | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/include/linux/blkdev.h b/include/linux/blkdev.h index 251e0f538c4c..4536211ff33c 100644 --- a/include/linux/blkdev.h +++ b/include/linux/blkdev.h @@ -340,14 +340,13 @@ typedef unsigned int __bitwise blk_features_t; /* skip this queue in blk_mq_(un)quiesce_tagset */ #define BLK_FEAT_SKIP_TAGSET_QUIESCE ((__force blk_features_t)(1u << 13)) +/* atomic writes enabled */ +#define BLK_FEAT_ATOMIC_WRITES ((__force blk_features_t)(1u << 14)) + /* undocumented magic for bcache */ #define BLK_FEAT_RAID_PARTIAL_STRIPES_EXPENSIVE \ ((__force blk_features_t)(1u << 15)) -/* atomic writes enabled */ -#define BLK_FEAT_ATOMIC_WRITES \ - ((__force blk_features_t)(1u << 16)) - /* * Flags automatically inherited when stacking limits. */ -- 2.52.0 ^ permalink raw reply related [flat|nested] 15+ messages in thread
* Re: [PATCH 1/2] block: cleanup queue limit features definition 2026-01-29 7:27 ` [PATCH 1/2] block: cleanup queue limit features definition Damien Le Moal @ 2026-01-29 9:22 ` Nitesh Shetty 2026-01-29 11:52 ` John Garry 2026-01-30 5:40 ` Christoph Hellwig 2 siblings, 0 replies; 15+ messages in thread From: Nitesh Shetty @ 2026-01-29 9:22 UTC (permalink / raw) To: Damien Le Moal; +Cc: Jens Axboe, linux-block [-- Attachment #1: Type: text/plain, Size: 281 bytes --] On 29/01/26 04:27PM, Damien Le Moal wrote: >Unwrap the definition of BLK_FEAT_ATOMIC_WRITES and >renumber this feature to be sequential with BLK_FEAT_SKIP_TAGSET_QUIESCE. > >Signed-off-by: Damien Le Moal <dlemoal@kernel.org> >--- Reviewed-by: Nitesh Shetty <nj.shetty@samsung.com> [-- Attachment #2: Type: text/plain, Size: 0 bytes --] ^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: [PATCH 1/2] block: cleanup queue limit features definition 2026-01-29 7:27 ` [PATCH 1/2] block: cleanup queue limit features definition Damien Le Moal 2026-01-29 9:22 ` Nitesh Shetty @ 2026-01-29 11:52 ` John Garry 2026-01-30 5:40 ` Christoph Hellwig 2 siblings, 0 replies; 15+ messages in thread From: John Garry @ 2026-01-29 11:52 UTC (permalink / raw) To: Damien Le Moal, Jens Axboe, linux-block On 29/01/2026 07:27, Damien Le Moal wrote: > Unwrap the definition of BLK_FEAT_ATOMIC_WRITES and > renumber this feature to be sequential with BLK_FEAT_SKIP_TAGSET_QUIESCE. > > Signed-off-by: Damien Le Moal <dlemoal@kernel.org> Reviewed-by: John Garry <john.g.garry@oracle.com> > --- > include/linux/blkdev.h | 7 +++---- > 1 file changed, 3 insertions(+), 4 deletions(-) > > diff --git a/include/linux/blkdev.h b/include/linux/blkdev.h > index 251e0f538c4c..4536211ff33c 100644 > --- a/include/linux/blkdev.h > +++ b/include/linux/blkdev.h > @@ -340,14 +340,13 @@ typedef unsigned int __bitwise blk_features_t; > /* skip this queue in blk_mq_(un)quiesce_tagset */ > #define BLK_FEAT_SKIP_TAGSET_QUIESCE ((__force blk_features_t)(1u << 13)) > > +/* atomic writes enabled */ > +#define BLK_FEAT_ATOMIC_WRITES ((__force blk_features_t)(1u << 14)) I think that BLK_FEAT_BOUNCE_HIGH used to be numbered here > + > /* undocumented magic for bcache */ > #define BLK_FEAT_RAID_PARTIAL_STRIPES_EXPENSIVE \ > ((__force blk_features_t)(1u << 15)) > > -/* atomic writes enabled */ > -#define BLK_FEAT_ATOMIC_WRITES \ > - ((__force blk_features_t)(1u << 16)) > - > /* > * Flags automatically inherited when stacking limits. > */ ^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: [PATCH 1/2] block: cleanup queue limit features definition 2026-01-29 7:27 ` [PATCH 1/2] block: cleanup queue limit features definition Damien Le Moal 2026-01-29 9:22 ` Nitesh Shetty 2026-01-29 11:52 ` John Garry @ 2026-01-30 5:40 ` Christoph Hellwig 2 siblings, 0 replies; 15+ messages in thread From: Christoph Hellwig @ 2026-01-30 5:40 UTC (permalink / raw) To: Damien Le Moal; +Cc: Jens Axboe, linux-block On Thu, Jan 29, 2026 at 04:27:14PM +0900, Damien Le Moal wrote: > Unwrap the definition of BLK_FEAT_ATOMIC_WRITES and > renumber this feature to be sequential with BLK_FEAT_SKIP_TAGSET_QUIESCE. Looks good: Reviewed-by: Christoph Hellwig <hch@lst.de> ^ permalink raw reply [flat|nested] 15+ messages in thread
* [PATCH 2/2] block: introduce blk_queue_rot() 2026-01-29 7:27 [PATCH 0/2] Cleanup patches Damien Le Moal 2026-01-29 7:27 ` [PATCH 1/2] block: cleanup queue limit features definition Damien Le Moal @ 2026-01-29 7:27 ` Damien Le Moal 2026-01-29 9:18 ` Nitesh Shetty 2026-01-30 5:42 ` Christoph Hellwig 2026-01-29 18:19 ` [PATCH 0/2] Cleanup patches Martin K. Petersen 2026-01-29 20:17 ` Jens Axboe 3 siblings, 2 replies; 15+ messages in thread From: Damien Le Moal @ 2026-01-29 7:27 UTC (permalink / raw) To: Jens Axboe, linux-block To check if a request queue is for a rotational device, a double negation is needed with the pattern "!blk_queue_nonrot(q)". Simplify this with the introduction of the helper blk_queue_rot() which tests if a requests queue limit has the BLK_FEAT_ROTATIONAL feature set. All call sites of blk_queue_nonrot() are modified to use blk_queue_rot() and blk_queue_nonrot() definition removed. No functional changes. Signed-off-by: Damien Le Moal <dlemoal@kernel.org> --- block/bfq-iosched.c | 20 ++++++++++---------- block/blk-iocost.c | 2 +- block/blk-iolatency.c | 5 +---- block/blk-wbt.c | 5 ++--- include/linux/blkdev.h | 4 ++-- 5 files changed, 16 insertions(+), 20 deletions(-) diff --git a/block/bfq-iosched.c b/block/bfq-iosched.c index 6e54b1d3d8bc..3ebdec40e758 100644 --- a/block/bfq-iosched.c +++ b/block/bfq-iosched.c @@ -231,7 +231,7 @@ static struct kmem_cache *bfq_pool; #define BFQ_RQ_SEEKY(bfqd, last_pos, rq) \ (get_sdist(last_pos, rq) > \ BFQQ_SEEK_THR && \ - (!blk_queue_nonrot(bfqd->queue) || \ + (blk_queue_rot(bfqd->queue) || \ blk_rq_sectors(rq) < BFQQ_SECT_THR_NONROT)) #define BFQQ_CLOSE_THR (sector_t)(8 * 1024) #define BFQQ_SEEKY(bfqq) (hweight32(bfqq->seek_history) > 19) @@ -4165,7 +4165,7 @@ static bool bfq_bfqq_is_slow(struct bfq_data *bfqd, struct bfq_queue *bfqq, /* don't use too short time intervals */ if (delta_usecs < 1000) { - if (blk_queue_nonrot(bfqd->queue)) + if (!blk_queue_rot(bfqd->queue)) /* * give same worst-case guarantees as idling * for seeky @@ -4487,7 +4487,7 @@ static bool idling_boosts_thr_without_issues(struct bfq_data *bfqd, struct bfq_queue *bfqq) { bool rot_without_queueing = - !blk_queue_nonrot(bfqd->queue) && !bfqd->hw_tag, + blk_queue_rot(bfqd->queue) && !bfqd->hw_tag, bfqq_sequential_and_IO_bound, idling_boosts_thr; @@ -4521,7 +4521,7 @@ static bool idling_boosts_thr_without_issues(struct bfq_data *bfqd, * flash-based device. */ idling_boosts_thr = rot_without_queueing || - ((!blk_queue_nonrot(bfqd->queue) || !bfqd->hw_tag) && + ((blk_queue_rot(bfqd->queue) || !bfqd->hw_tag) && bfqq_sequential_and_IO_bound); /* @@ -4722,7 +4722,7 @@ bfq_choose_bfqq_for_injection(struct bfq_data *bfqd) * there is only one in-flight large request * at a time. */ - if (blk_queue_nonrot(bfqd->queue) && + if (!blk_queue_rot(bfqd->queue) && blk_rq_sectors(bfqq->next_rq) >= BFQQ_SECT_THR_NONROT && bfqd->tot_rq_in_driver >= 1) @@ -6340,7 +6340,7 @@ static void bfq_update_hw_tag(struct bfq_data *bfqd) bfqd->hw_tag_samples = 0; bfqd->nonrot_with_queueing = - blk_queue_nonrot(bfqd->queue) && bfqd->hw_tag; + !blk_queue_rot(bfqd->queue) && bfqd->hw_tag; } static void bfq_completed_request(struct bfq_queue *bfqq, struct bfq_data *bfqd) @@ -7293,7 +7293,7 @@ static int bfq_init_queue(struct request_queue *q, struct elevator_queue *eq) INIT_HLIST_HEAD(&bfqd->burst_list); bfqd->hw_tag = -1; - bfqd->nonrot_with_queueing = blk_queue_nonrot(bfqd->queue); + bfqd->nonrot_with_queueing = !blk_queue_rot(bfqd->queue); bfqd->bfq_max_budget = bfq_default_max_budget; @@ -7328,9 +7328,9 @@ static int bfq_init_queue(struct request_queue *q, struct elevator_queue *eq) * Begin by assuming, optimistically, that the device peak * rate is equal to 2/3 of the highest reference rate. */ - bfqd->rate_dur_prod = ref_rate[blk_queue_nonrot(bfqd->queue)] * - ref_wr_duration[blk_queue_nonrot(bfqd->queue)]; - bfqd->peak_rate = ref_rate[blk_queue_nonrot(bfqd->queue)] * 2 / 3; + bfqd->rate_dur_prod = ref_rate[!blk_queue_rot(bfqd->queue)] * + ref_wr_duration[!blk_queue_rot(bfqd->queue)]; + bfqd->peak_rate = ref_rate[!blk_queue_rot(bfqd->queue)] * 2 / 3; /* see comments on the definition of next field inside bfq_data */ bfqd->actuator_load_threshold = 4; diff --git a/block/blk-iocost.c b/block/blk-iocost.c index a0416927d33d..ef543d163d46 100644 --- a/block/blk-iocost.c +++ b/block/blk-iocost.c @@ -812,7 +812,7 @@ static int ioc_autop_idx(struct ioc *ioc, struct gendisk *disk) u64 now_ns; /* rotational? */ - if (!blk_queue_nonrot(disk->queue)) + if (blk_queue_rot(disk->queue)) return AUTOP_HDD; /* handle SATA SSDs w/ broken NCQ */ diff --git a/block/blk-iolatency.c b/block/blk-iolatency.c index 45bd18f68541..f7434278cd29 100644 --- a/block/blk-iolatency.c +++ b/block/blk-iolatency.c @@ -988,10 +988,7 @@ static void iolatency_pd_init(struct blkg_policy_data *pd) u64 now = blk_time_get_ns(); int cpu; - if (blk_queue_nonrot(blkg->q)) - iolat->ssd = true; - else - iolat->ssd = false; + iolat->ssd = !blk_queue_rot(blkg->q); for_each_possible_cpu(cpu) { struct latency_stat *stat; diff --git a/block/blk-wbt.c b/block/blk-wbt.c index 0974875f77bd..8e025834f2fb 100644 --- a/block/blk-wbt.c +++ b/block/blk-wbt.c @@ -747,10 +747,9 @@ u64 wbt_default_latency_nsec(struct request_queue *q) * We default to 2msec for non-rotational storage, and 75msec * for rotational storage. */ - if (blk_queue_nonrot(q)) - return 2000000ULL; - else + if (blk_queue_rot(q)) return 75000000ULL; + return 2000000ULL; } static int wbt_data_dir(const struct request *rq) diff --git a/include/linux/blkdev.h b/include/linux/blkdev.h index 4536211ff33c..1e5b5547929f 100644 --- a/include/linux/blkdev.h +++ b/include/linux/blkdev.h @@ -680,7 +680,7 @@ void blk_queue_flag_clear(unsigned int flag, struct request_queue *q); #define blk_queue_nomerges(q) test_bit(QUEUE_FLAG_NOMERGES, &(q)->queue_flags) #define blk_queue_noxmerges(q) \ test_bit(QUEUE_FLAG_NOXMERGES, &(q)->queue_flags) -#define blk_queue_nonrot(q) (!((q)->limits.features & BLK_FEAT_ROTATIONAL)) +#define blk_queue_rot(q) ((q)->limits.features & BLK_FEAT_ROTATIONAL) #define blk_queue_io_stat(q) ((q)->limits.features & BLK_FEAT_IO_STAT) #define blk_queue_passthrough_stat(q) \ ((q)->limits.flags & BLK_FLAG_IOSTATS_PASSTHROUGH) @@ -1463,7 +1463,7 @@ bdev_write_zeroes_unmap_sectors(struct block_device *bdev) static inline bool bdev_nonrot(struct block_device *bdev) { - return blk_queue_nonrot(bdev_get_queue(bdev)); + return !blk_queue_rot(bdev_get_queue(bdev)); } static inline bool bdev_synchronous(struct block_device *bdev) -- 2.52.0 ^ permalink raw reply related [flat|nested] 15+ messages in thread
* Re: [PATCH 2/2] block: introduce blk_queue_rot() 2026-01-29 7:27 ` [PATCH 2/2] block: introduce blk_queue_rot() Damien Le Moal @ 2026-01-29 9:18 ` Nitesh Shetty 2026-01-29 9:38 ` Damien Le Moal 2026-01-30 5:42 ` Christoph Hellwig 1 sibling, 1 reply; 15+ messages in thread From: Nitesh Shetty @ 2026-01-29 9:18 UTC (permalink / raw) To: Damien Le Moal; +Cc: Jens Axboe, linux-block [-- Attachment #1: Type: text/plain, Size: 1786 bytes --] On 29/01/26 04:27PM, Damien Le Moal wrote: >To check if a request queue is for a rotational device, a double >negation is needed with the pattern "!blk_queue_nonrot(q)". Simplify >this with the introduction of the helper blk_queue_rot() which tests >if a requests queue limit has the BLK_FEAT_ROTATIONAL feature set. >All call sites of blk_queue_nonrot() are modified to use blk_queue_rot() >and blk_queue_nonrot() definition removed. > >No functional changes. > >Signed-off-by: Damien Le Moal <dlemoal@kernel.org> >--- > block/bfq-iosched.c | 20 ++++++++++---------- > block/blk-iocost.c | 2 +- > block/blk-iolatency.c | 5 +---- > block/blk-wbt.c | 5 ++--- > include/linux/blkdev.h | 4 ++-- > 5 files changed, 16 insertions(+), 20 deletions(-) > >diff --git a/block/bfq-iosched.c b/block/bfq-iosched.c >index 6e54b1d3d8bc..3ebdec40e758 100644 >--- a/block/bfq-iosched.c >+++ b/block/bfq-iosched.c >@@ -231,7 +231,7 @@ static struct kmem_cache *bfq_pool; > #define BFQ_RQ_SEEKY(bfqd, last_pos, rq) \ > (get_sdist(last_pos, rq) > \ > BFQQ_SEEK_THR && \ >- (!blk_queue_nonrot(bfqd->queue) || \ >+ (blk_queue_rot(bfqd->queue) || \ > blk_rq_sectors(rq) < BFQQ_SECT_THR_NONROT)) > #define BFQQ_CLOSE_THR (sector_t)(8 * 1024) > #define BFQQ_SEEKY(bfqq) (hweight32(bfqq->seek_history) > 19) >@@ -4165,7 +4165,7 @@ static bool bfq_bfqq_is_slow(struct bfq_data *bfqd, struct bfq_queue *bfqq, > > /* don't use too short time intervals */ > if (delta_usecs < 1000) { >- if (blk_queue_nonrot(bfqd->queue)) >+ if (!blk_queue_rot(bfqd->queue)) blk_queue_rot looks fine to me in other places. Keeping blk_queue_nonrot would avoid the double negation here and few places. I see you made the changes for bdev_nonrot down, but missed to add here ? Thanks, Nitesh [-- Attachment #2: Type: text/plain, Size: 0 bytes --] ^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: [PATCH 2/2] block: introduce blk_queue_rot() 2026-01-29 9:18 ` Nitesh Shetty @ 2026-01-29 9:38 ` Damien Le Moal 2026-01-29 9:44 ` Nitesh Shetty 0 siblings, 1 reply; 15+ messages in thread From: Damien Le Moal @ 2026-01-29 9:38 UTC (permalink / raw) To: Nitesh Shetty; +Cc: Jens Axboe, linux-block On 1/29/26 18:18, Nitesh Shetty wrote: > On 29/01/26 04:27PM, Damien Le Moal wrote: >> To check if a request queue is for a rotational device, a double >> negation is needed with the pattern "!blk_queue_nonrot(q)". Simplify >> this with the introduction of the helper blk_queue_rot() which tests >> if a requests queue limit has the BLK_FEAT_ROTATIONAL feature set. >> All call sites of blk_queue_nonrot() are modified to use blk_queue_rot() >> and blk_queue_nonrot() definition removed. >> >> No functional changes. >> >> Signed-off-by: Damien Le Moal <dlemoal@kernel.org> >> --- >> block/bfq-iosched.c | 20 ++++++++++---------- >> block/blk-iocost.c | 2 +- >> block/blk-iolatency.c | 5 +---- >> block/blk-wbt.c | 5 ++--- >> include/linux/blkdev.h | 4 ++-- >> 5 files changed, 16 insertions(+), 20 deletions(-) >> >> diff --git a/block/bfq-iosched.c b/block/bfq-iosched.c >> index 6e54b1d3d8bc..3ebdec40e758 100644 >> --- a/block/bfq-iosched.c >> +++ b/block/bfq-iosched.c >> @@ -231,7 +231,7 @@ static struct kmem_cache *bfq_pool; >> #define BFQ_RQ_SEEKY(bfqd, last_pos, rq) \ >> (get_sdist(last_pos, rq) > \ >> BFQQ_SEEK_THR && \ >> - (!blk_queue_nonrot(bfqd->queue) || \ >> + (blk_queue_rot(bfqd->queue) || \ >> blk_rq_sectors(rq) < BFQQ_SECT_THR_NONROT)) >> #define BFQQ_CLOSE_THR (sector_t)(8 * 1024) >> #define BFQQ_SEEKY(bfqq) (hweight32(bfqq->seek_history) > 19) >> @@ -4165,7 +4165,7 @@ static bool bfq_bfqq_is_slow(struct bfq_data *bfqd, struct bfq_queue *bfqq, >> >> /* don't use too short time intervals */ >> if (delta_usecs < 1000) { >> - if (blk_queue_nonrot(bfqd->queue)) >> + if (!blk_queue_rot(bfqd->queue)) > blk_queue_rot looks fine to me in other places. > Keeping blk_queue_nonrot would avoid the double negation here and few places. There is no more double negation. blk_queue_rot() tests for a feature flag being set. The !blk_queue_rot(q) tests the opposite. > I see you made the changes for bdev_nonrot down, but missed to add here > ? Here where ? What did I miss ? -- Damien Le Moal Western Digital Research ^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: [PATCH 2/2] block: introduce blk_queue_rot() 2026-01-29 9:38 ` Damien Le Moal @ 2026-01-29 9:44 ` Nitesh Shetty 0 siblings, 0 replies; 15+ messages in thread From: Nitesh Shetty @ 2026-01-29 9:44 UTC (permalink / raw) To: Damien Le Moal; +Cc: Jens Axboe, linux-block [-- Attachment #1: Type: text/plain, Size: 2282 bytes --] On 29/01/26 06:38PM, Damien Le Moal wrote: >On 1/29/26 18:18, Nitesh Shetty wrote: >> On 29/01/26 04:27PM, Damien Le Moal wrote: >>> To check if a request queue is for a rotational device, a double >>> negation is needed with the pattern "!blk_queue_nonrot(q)". Simplify >>> this with the introduction of the helper blk_queue_rot() which tests >>> if a requests queue limit has the BLK_FEAT_ROTATIONAL feature set. >>> All call sites of blk_queue_nonrot() are modified to use blk_queue_rot() >>> and blk_queue_nonrot() definition removed. >>> >>> No functional changes. >>> >>> Signed-off-by: Damien Le Moal <dlemoal@kernel.org> >>> --- >>> block/bfq-iosched.c | 20 ++++++++++---------- >>> block/blk-iocost.c | 2 +- >>> block/blk-iolatency.c | 5 +---- >>> block/blk-wbt.c | 5 ++--- >>> include/linux/blkdev.h | 4 ++-- >>> 5 files changed, 16 insertions(+), 20 deletions(-) >>> >>> diff --git a/block/bfq-iosched.c b/block/bfq-iosched.c >>> index 6e54b1d3d8bc..3ebdec40e758 100644 >>> --- a/block/bfq-iosched.c >>> +++ b/block/bfq-iosched.c >>> @@ -231,7 +231,7 @@ static struct kmem_cache *bfq_pool; >>> #define BFQ_RQ_SEEKY(bfqd, last_pos, rq) \ >>> (get_sdist(last_pos, rq) > \ >>> BFQQ_SEEK_THR && \ >>> - (!blk_queue_nonrot(bfqd->queue) || \ >>> + (blk_queue_rot(bfqd->queue) || \ >>> blk_rq_sectors(rq) < BFQQ_SECT_THR_NONROT)) >>> #define BFQQ_CLOSE_THR (sector_t)(8 * 1024) >>> #define BFQQ_SEEKY(bfqq) (hweight32(bfqq->seek_history) > 19) >>> @@ -4165,7 +4165,7 @@ static bool bfq_bfqq_is_slow(struct bfq_data *bfqd, struct bfq_queue *bfqq, >>> >>> /* don't use too short time intervals */ >>> if (delta_usecs < 1000) { >>> - if (blk_queue_nonrot(bfqd->queue)) >>> + if (!blk_queue_rot(bfqd->queue)) >> blk_queue_rot looks fine to me in other places. >> Keeping blk_queue_nonrot would avoid the double negation here and few places. > >There is no more double negation. blk_queue_rot() tests for a feature flag being >set. The !blk_queue_rot(q) tests the opposite. > >> I see you made the changes for bdev_nonrot down, but missed to add here >> ? > >Here where ? What did I miss ? > My bad, I thought you added a new helper for bdev_rot at the end, which check for rotation device. Reviewed-by: Nitesh Shetty <nj.shetty@samsung.com> [-- Attachment #2: Type: text/plain, Size: 0 bytes --] ^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: [PATCH 2/2] block: introduce blk_queue_rot() 2026-01-29 7:27 ` [PATCH 2/2] block: introduce blk_queue_rot() Damien Le Moal 2026-01-29 9:18 ` Nitesh Shetty @ 2026-01-30 5:42 ` Christoph Hellwig 2026-01-30 5:50 ` Damien Le Moal 1 sibling, 1 reply; 15+ messages in thread From: Christoph Hellwig @ 2026-01-30 5:42 UTC (permalink / raw) To: Damien Le Moal; +Cc: Jens Axboe, linux-block On Thu, Jan 29, 2026 at 04:27:15PM +0900, Damien Le Moal wrote: > To check if a request queue is for a rotational device, a double > negation is needed with the pattern "!blk_queue_nonrot(q)". Simplify > this with the introduction of the helper blk_queue_rot() which tests > if a requests queue limit has the BLK_FEAT_ROTATIONAL feature set. > All call sites of blk_queue_nonrot() are modified to use blk_queue_rot() > and blk_queue_nonrot() definition removed. Looks good, and I should have done that soon after inverting the underlying flag: Reviewed-by: Christoph Hellwig <hch@lst.de> We should also do the same with bdev_nonrot, maybe staged because of a lot of callers outside the block code. ^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: [PATCH 2/2] block: introduce blk_queue_rot() 2026-01-30 5:42 ` Christoph Hellwig @ 2026-01-30 5:50 ` Damien Le Moal 2026-01-30 5:53 ` Christoph Hellwig 0 siblings, 1 reply; 15+ messages in thread From: Damien Le Moal @ 2026-01-30 5:50 UTC (permalink / raw) To: Christoph Hellwig; +Cc: Jens Axboe, linux-block On 1/30/26 14:42, Christoph Hellwig wrote: > On Thu, Jan 29, 2026 at 04:27:15PM +0900, Damien Le Moal wrote: >> To check if a request queue is for a rotational device, a double >> negation is needed with the pattern "!blk_queue_nonrot(q)". Simplify >> this with the introduction of the helper blk_queue_rot() which tests >> if a requests queue limit has the BLK_FEAT_ROTATIONAL feature set. >> All call sites of blk_queue_nonrot() are modified to use blk_queue_rot() >> and blk_queue_nonrot() definition removed. > > Looks good, and I should have done that soon after inverting the > underlying flag: > > Reviewed-by: Christoph Hellwig <hch@lst.de> > > We should also do the same with bdev_nonrot, maybe staged because > of a lot of callers outside the block code. Yes, that is why I did not send a patch for that one as the changes are mostly in file systems. Will send something later. -- Damien Le Moal Western Digital Research ^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: [PATCH 2/2] block: introduce blk_queue_rot() 2026-01-30 5:50 ` Damien Le Moal @ 2026-01-30 5:53 ` Christoph Hellwig 2026-01-30 5:55 ` Damien Le Moal 0 siblings, 1 reply; 15+ messages in thread From: Christoph Hellwig @ 2026-01-30 5:53 UTC (permalink / raw) To: Damien Le Moal; +Cc: Christoph Hellwig, Jens Axboe, linux-block On Fri, Jan 30, 2026 at 02:50:12PM +0900, Damien Le Moal wrote: > On 1/30/26 14:42, Christoph Hellwig wrote: > > On Thu, Jan 29, 2026 at 04:27:15PM +0900, Damien Le Moal wrote: > >> To check if a request queue is for a rotational device, a double > >> negation is needed with the pattern "!blk_queue_nonrot(q)". Simplify > >> this with the introduction of the helper blk_queue_rot() which tests > >> if a requests queue limit has the BLK_FEAT_ROTATIONAL feature set. > >> All call sites of blk_queue_nonrot() are modified to use blk_queue_rot() > >> and blk_queue_nonrot() definition removed. > > > > Looks good, and I should have done that soon after inverting the > > underlying flag: > > > > Reviewed-by: Christoph Hellwig <hch@lst.de> > > > > We should also do the same with bdev_nonrot, maybe staged because > > of a lot of callers outside the block code. > > Yes, that is why I did not send a patch for that one as the changes are mostly > in file systems. Will send something later. It might be a good idea to just add it and use in "block tree" code, and then we can convert other callers in the next merge window and eventually kill off bdev_nonrot. ^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: [PATCH 2/2] block: introduce blk_queue_rot() 2026-01-30 5:53 ` Christoph Hellwig @ 2026-01-30 5:55 ` Damien Le Moal 0 siblings, 0 replies; 15+ messages in thread From: Damien Le Moal @ 2026-01-30 5:55 UTC (permalink / raw) To: Christoph Hellwig; +Cc: Jens Axboe, linux-block On 1/30/26 14:53, Christoph Hellwig wrote: > On Fri, Jan 30, 2026 at 02:50:12PM +0900, Damien Le Moal wrote: >> On 1/30/26 14:42, Christoph Hellwig wrote: >>> On Thu, Jan 29, 2026 at 04:27:15PM +0900, Damien Le Moal wrote: >>>> To check if a request queue is for a rotational device, a double >>>> negation is needed with the pattern "!blk_queue_nonrot(q)". Simplify >>>> this with the introduction of the helper blk_queue_rot() which tests >>>> if a requests queue limit has the BLK_FEAT_ROTATIONAL feature set. >>>> All call sites of blk_queue_nonrot() are modified to use blk_queue_rot() >>>> and blk_queue_nonrot() definition removed. >>> >>> Looks good, and I should have done that soon after inverting the >>> underlying flag: >>> >>> Reviewed-by: Christoph Hellwig <hch@lst.de> >>> >>> We should also do the same with bdev_nonrot, maybe staged because >>> of a lot of callers outside the block code. >> >> Yes, that is why I did not send a patch for that one as the changes are mostly >> in file systems. Will send something later. > > It might be a good idea to just add it and use in "block tree" code, > and then we can convert other callers in the next merge window and > eventually kill off bdev_nonrot. Indeed, that will avoid potential problems with new use in linux-next. -- Damien Le Moal Western Digital Research ^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: [PATCH 0/2] Cleanup patches 2026-01-29 7:27 [PATCH 0/2] Cleanup patches Damien Le Moal 2026-01-29 7:27 ` [PATCH 1/2] block: cleanup queue limit features definition Damien Le Moal 2026-01-29 7:27 ` [PATCH 2/2] block: introduce blk_queue_rot() Damien Le Moal @ 2026-01-29 18:19 ` Martin K. Petersen 2026-01-29 20:17 ` Jens Axboe 3 siblings, 0 replies; 15+ messages in thread From: Martin K. Petersen @ 2026-01-29 18:19 UTC (permalink / raw) To: Damien Le Moal; +Cc: Jens Axboe, linux-block Damien, > Here is a couple of cleanup patches for the block layer. No functional > changes are introduced by these patches. Reviewed-by: Martin K. Petersen <martin.petersen@oracle.com> -- Martin K. Petersen ^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: [PATCH 0/2] Cleanup patches 2026-01-29 7:27 [PATCH 0/2] Cleanup patches Damien Le Moal ` (2 preceding siblings ...) 2026-01-29 18:19 ` [PATCH 0/2] Cleanup patches Martin K. Petersen @ 2026-01-29 20:17 ` Jens Axboe 3 siblings, 0 replies; 15+ messages in thread From: Jens Axboe @ 2026-01-29 20:17 UTC (permalink / raw) To: linux-block, Damien Le Moal On Thu, 29 Jan 2026 16:27:13 +0900, Damien Le Moal wrote: > Jens, > > Here is a couple of cleanup patches for the block layer. > No functional changes are introduced by these patches. > > Damien Le Moal (2): > block: cleanup queue limit features definition > block: introduce blk_queue_rot() > > [...] Applied, thanks! [1/2] block: cleanup queue limit features definition commit: 068f5b5ef5bf97e25568950f06ba32325bdc660b [2/2] block: introduce blk_queue_rot() commit: 2719bd1ee1a1cd0535bc62e89b52822f2bbd14eb Best regards, -- Jens Axboe ^ permalink raw reply [flat|nested] 15+ messages in thread
end of thread, other threads:[~2026-01-30 5:55 UTC | newest] Thread overview: 15+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- 2026-01-29 7:27 [PATCH 0/2] Cleanup patches Damien Le Moal 2026-01-29 7:27 ` [PATCH 1/2] block: cleanup queue limit features definition Damien Le Moal 2026-01-29 9:22 ` Nitesh Shetty 2026-01-29 11:52 ` John Garry 2026-01-30 5:40 ` Christoph Hellwig 2026-01-29 7:27 ` [PATCH 2/2] block: introduce blk_queue_rot() Damien Le Moal 2026-01-29 9:18 ` Nitesh Shetty 2026-01-29 9:38 ` Damien Le Moal 2026-01-29 9:44 ` Nitesh Shetty 2026-01-30 5:42 ` Christoph Hellwig 2026-01-30 5:50 ` Damien Le Moal 2026-01-30 5:53 ` Christoph Hellwig 2026-01-30 5:55 ` Damien Le Moal 2026-01-29 18:19 ` [PATCH 0/2] Cleanup patches Martin K. Petersen 2026-01-29 20:17 ` Jens Axboe
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox