summaryrefslogtreecommitdiff
path: root/block/elevator.h
diff options
context:
space:
mode:
authorNilay Shroff <nilay@linux.ibm.com>2025-11-13 14:28:21 +0530
committerJens Axboe <axboe@kernel.dk>2025-11-13 09:27:49 -0700
commit0315476e78c050048e80f66334a310e5581b46bb (patch)
tree781f5abaec739d4cd7360c5be611f708e1f203c7 /block/elevator.h
parent61019afdf6ac17c8e8f9c42665aa1fa82f04a3e2 (diff)
downloadlinux-0315476e78c050048e80f66334a310e5581b46bb.tar.gz
linux-0315476e78c050048e80f66334a310e5581b46bb.tar.bz2
linux-0315476e78c050048e80f66334a310e5581b46bb.zip
block: use {alloc|free}_sched data methods
The previous patch introduced ->alloc_sched_data and ->free_sched_data methods. This patch builds upon that by now using these methods during elevator switch and nr_hw_queue update. It's also ensured that scheduler-specific data is allocated and freed through the new callbacks outside of the ->freeze_lock and ->elevator_lock locking contexts, thereby preventing any dependency on pcpu_alloc_mutex. Reviewed-by: Ming Lei <ming.lei@redhat.com> Reviewed-by: Yu Kuai <yukuai@fnnas.com> Signed-off-by: Nilay Shroff <nilay@linux.ibm.com> Signed-off-by: Jens Axboe <axboe@kernel.dk>
Diffstat (limited to 'block/elevator.h')
-rw-r--r--block/elevator.h4
1 files changed, 3 insertions, 1 deletions
diff --git a/block/elevator.h b/block/elevator.h
index e34043f6da26..3ee1d494f48a 100644
--- a/block/elevator.h
+++ b/block/elevator.h
@@ -33,6 +33,8 @@ struct elevator_tags {
};
struct elevator_resources {
+ /* holds elevator data */
+ void *data;
/* holds elevator tags */
struct elevator_tags *et;
};
@@ -185,7 +187,7 @@ ssize_t elv_iosched_store(struct gendisk *disk, const char *page, size_t count);
extern bool elv_bio_merge_ok(struct request *, struct bio *);
struct elevator_queue *elevator_alloc(struct request_queue *,
- struct elevator_type *, struct elevator_tags *);
+ struct elevator_type *, struct elevator_resources *);
/*
* Helper functions.