Skip to content

Commit e4eb37c

Browse files
damien-lemoalaxboe
authored andcommitted
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 <[email protected]> Reviewed-by: Hannes Reinecke <[email protected]> Reviewed-by: Christoph Hellwig <[email protected]> Reviewed-by: Bart Van Assche <[email protected]> Tested-by: Hans Holmberg <[email protected]> Tested-by: Dennis Maisenbacher <[email protected]> Reviewed-by: Martin K. Petersen <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Jens Axboe <[email protected]>
1 parent fde0269 commit e4eb37c

File tree

4 files changed

+5
-68
lines changed

4 files changed

+5
-68
lines changed

block/blk-settings.c

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1052,22 +1052,6 @@ void blk_queue_write_cache(struct request_queue *q, bool wc, bool fua)
10521052
}
10531053
EXPORT_SYMBOL_GPL(blk_queue_write_cache);
10541054

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-
10711055
/**
10721056
* blk_queue_can_use_dma_map_merging - configure queue for merging segments.
10731057
* @q: the request queue for the device

block/elevator.c

Lines changed: 5 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -83,13 +83,6 @@ bool elv_bio_merge_ok(struct request *rq, struct bio *bio)
8383
}
8484
EXPORT_SYMBOL(elv_bio_merge_ok);
8585

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-
9386
/**
9487
* elevator_match - Check whether @e's name or alias matches @name
9588
* @e: Scheduler to test
@@ -120,7 +113,7 @@ static struct elevator_type *elevator_find_get(struct request_queue *q,
120113

121114
spin_lock(&elv_list_lock);
122115
e = __elevator_find(name);
123-
if (e && (!elv_support_features(q, e) || !elevator_tryget(e)))
116+
if (e && (!elevator_tryget(e)))
124117
e = NULL;
125118
spin_unlock(&elv_list_lock);
126119
return e;
@@ -580,34 +573,8 @@ static struct elevator_type *elevator_get_default(struct request_queue *q)
580573
}
581574

582575
/*
583-
* Get the first elevator providing the features required by the request queue.
584-
* Default to "none" if no matching elevator is found.
585-
*/
586-
static struct elevator_type *elevator_get_by_features(struct request_queue *q)
587-
{
588-
struct elevator_type *e, *found = NULL;
589-
590-
spin_lock(&elv_list_lock);
591-
592-
list_for_each_entry(e, &elv_list, list) {
593-
if (elv_support_features(q, e)) {
594-
found = e;
595-
break;
596-
}
597-
}
598-
599-
if (found && !elevator_tryget(found))
600-
found = NULL;
601-
602-
spin_unlock(&elv_list_lock);
603-
return found;
604-
}
605-
606-
/*
607-
* For a device queue that has no required features, use the default elevator
608-
* settings. Otherwise, use the first elevator available matching the required
609-
* features. If no suitable elevator is find or if the chosen elevator
610-
* initialization fails, fall back to the "none" elevator (no elevator).
576+
* Use the default elevator settings. If the chosen elevator initialization
577+
* fails, fall back to the "none" elevator (no elevator).
611578
*/
612579
void elevator_init_mq(struct request_queue *q)
613580
{
@@ -622,10 +589,7 @@ void elevator_init_mq(struct request_queue *q)
622589
if (unlikely(q->elevator))
623590
return;
624591

625-
if (!q->required_elevator_features)
626-
e = elevator_get_default(q);
627-
else
628-
e = elevator_get_by_features(q);
592+
e = elevator_get_default(q);
629593
if (!e)
630594
return;
631595

@@ -781,7 +745,7 @@ ssize_t elv_iosched_show(struct request_queue *q, char *name)
781745
list_for_each_entry(e, &elv_list, list) {
782746
if (e == cur)
783747
len += sprintf(name+len, "[%s] ", e->elevator_name);
784-
else if (elv_support_features(q, e))
748+
else
785749
len += sprintf(name+len, "%s ", e->elevator_name);
786750
}
787751
spin_unlock(&elv_list_lock);

block/elevator.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,6 @@ struct elevator_type
7474
struct elv_fs_entry *elevator_attrs;
7575
const char *elevator_name;
7676
const char *elevator_alias;
77-
const unsigned int elevator_features;
7877
struct module *elevator_owner;
7978
#ifdef CONFIG_BLK_DEBUG_FS
8079
const struct blk_mq_debugfs_attr *queue_debugfs_attrs;

include/linux/blkdev.h

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -453,8 +453,6 @@ struct request_queue {
453453

454454
atomic_t nr_active_requests_shared_tags;
455455

456-
unsigned int required_elevator_features;
457-
458456
struct blk_mq_tags *sched_shared_tags;
459457

460458
struct list_head icq_list;
@@ -958,14 +956,6 @@ disk_alloc_independent_access_ranges(struct gendisk *disk, int nr_ia_ranges);
958956
void disk_set_independent_access_ranges(struct gendisk *disk,
959957
struct blk_independent_access_ranges *iars);
960958

961-
/*
962-
* Elevator features for blk_queue_required_elevator_features:
963-
*/
964-
/* Supports zoned block devices sequential write constraint */
965-
#define ELEVATOR_F_ZBD_SEQ_WRITE (1U << 0)
966-
967-
extern void blk_queue_required_elevator_features(struct request_queue *q,
968-
unsigned int features);
969959
extern bool blk_queue_can_use_dma_map_merging(struct request_queue *q,
970960
struct device *dev);
971961

0 commit comments

Comments
 (0)