Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

block: Remove elevator required features

The only elevator feature ever implemented is ELEVATOR_F_ZBD_SEQ_WRITE
for signaling that a scheduler implements zone write locking to tightly
control the dispatching order of write operations to zoned block
devices. With the removal of zone write locking support in mq-deadline
and the reliance of all block device drivers on the block layer zone
write plugging to control ordering of write operations to zones, the
elevator feature ELEVATOR_F_ZBD_SEQ_WRITE is completely unused.
Remove it, and also remove the now unused code for filtering the
possible schedulers for a block device based on required features.

Signed-off-by: Damien Le Moal <dlemoal@kernel.org>
Reviewed-by: Hannes Reinecke <hare@suse.de>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Bart Van Assche <bvanassche@acm.org>
Tested-by: Hans Holmberg <hans.holmberg@wdc.com>
Tested-by: Dennis Maisenbacher <dennis.maisenbacher@wdc.com>
Reviewed-by: Martin K. Petersen <martin.petersen@oracle.com>
Link: https://lore.kernel.org/r/20240408014128.205141-23-dlemoal@kernel.org
Signed-off-by: Jens Axboe <axboe@kernel.dk>

authored by

Damien Le Moal and committed by
Jens Axboe
e4eb37cc fde02699

+5 -68
-16
block/blk-settings.c
··· 1053 1053 EXPORT_SYMBOL_GPL(blk_queue_write_cache); 1054 1054 1055 1055 /** 1056 - * blk_queue_required_elevator_features - Set a queue required elevator features 1057 - * @q: the request queue for the target device 1058 - * @features: Required elevator features OR'ed together 1059 - * 1060 - * Tell the block layer that for the device controlled through @q, only the 1061 - * only elevators that can be used are those that implement at least the set of 1062 - * features specified by @features. 1063 - */ 1064 - void blk_queue_required_elevator_features(struct request_queue *q, 1065 - unsigned int features) 1066 - { 1067 - q->required_elevator_features = features; 1068 - } 1069 - EXPORT_SYMBOL_GPL(blk_queue_required_elevator_features); 1070 - 1071 - /** 1072 1056 * blk_queue_can_use_dma_map_merging - configure queue for merging segments. 1073 1057 * @q: the request queue for the device 1074 1058 * @dev: the device pointer for dma
+5 -41
block/elevator.c
··· 83 83 } 84 84 EXPORT_SYMBOL(elv_bio_merge_ok); 85 85 86 - static inline bool elv_support_features(struct request_queue *q, 87 - const struct elevator_type *e) 88 - { 89 - return (q->required_elevator_features & e->elevator_features) == 90 - q->required_elevator_features; 91 - } 92 - 93 86 /** 94 87 * elevator_match - Check whether @e's name or alias matches @name 95 88 * @e: Scheduler to test ··· 113 120 114 121 spin_lock(&elv_list_lock); 115 122 e = __elevator_find(name); 116 - if (e && (!elv_support_features(q, e) || !elevator_tryget(e))) 123 + if (e && (!elevator_tryget(e))) 117 124 e = NULL; 118 125 spin_unlock(&elv_list_lock); 119 126 return e; ··· 573 580 } 574 581 575 582 /* 576 - * Get the first elevator providing the features required by the request queue. 577 - * Default to "none" if no matching elevator is found. 578 - */ 579 - static struct elevator_type *elevator_get_by_features(struct request_queue *q) 580 - { 581 - struct elevator_type *e, *found = NULL; 582 - 583 - spin_lock(&elv_list_lock); 584 - 585 - list_for_each_entry(e, &elv_list, list) { 586 - if (elv_support_features(q, e)) { 587 - found = e; 588 - break; 589 - } 590 - } 591 - 592 - if (found && !elevator_tryget(found)) 593 - found = NULL; 594 - 595 - spin_unlock(&elv_list_lock); 596 - return found; 597 - } 598 - 599 - /* 600 - * For a device queue that has no required features, use the default elevator 601 - * settings. Otherwise, use the first elevator available matching the required 602 - * features. If no suitable elevator is find or if the chosen elevator 603 - * initialization fails, fall back to the "none" elevator (no elevator). 583 + * Use the default elevator settings. If the chosen elevator initialization 584 + * fails, fall back to the "none" elevator (no elevator). 604 585 */ 605 586 void elevator_init_mq(struct request_queue *q) 606 587 { ··· 589 622 if (unlikely(q->elevator)) 590 623 return; 591 624 592 - if (!q->required_elevator_features) 593 - e = elevator_get_default(q); 594 - else 595 - e = elevator_get_by_features(q); 625 + e = elevator_get_default(q); 596 626 if (!e) 597 627 return; 598 628 ··· 745 781 list_for_each_entry(e, &elv_list, list) { 746 782 if (e == cur) 747 783 len += sprintf(name+len, "[%s] ", e->elevator_name); 748 - else if (elv_support_features(q, e)) 784 + else 749 785 len += sprintf(name+len, "%s ", e->elevator_name); 750 786 } 751 787 spin_unlock(&elv_list_lock);
-1
block/elevator.h
··· 74 74 struct elv_fs_entry *elevator_attrs; 75 75 const char *elevator_name; 76 76 const char *elevator_alias; 77 - const unsigned int elevator_features; 78 77 struct module *elevator_owner; 79 78 #ifdef CONFIG_BLK_DEBUG_FS 80 79 const struct blk_mq_debugfs_attr *queue_debugfs_attrs;
-10
include/linux/blkdev.h
··· 453 453 454 454 atomic_t nr_active_requests_shared_tags; 455 455 456 - unsigned int required_elevator_features; 457 - 458 456 struct blk_mq_tags *sched_shared_tags; 459 457 460 458 struct list_head icq_list; ··· 956 958 void disk_set_independent_access_ranges(struct gendisk *disk, 957 959 struct blk_independent_access_ranges *iars); 958 960 959 - /* 960 - * Elevator features for blk_queue_required_elevator_features: 961 - */ 962 - /* Supports zoned block devices sequential write constraint */ 963 - #define ELEVATOR_F_ZBD_SEQ_WRITE (1U << 0) 964 - 965 - extern void blk_queue_required_elevator_features(struct request_queue *q, 966 - unsigned int features); 967 961 extern bool blk_queue_can_use_dma_map_merging(struct request_queue *q, 968 962 struct device *dev); 969 963