History

block, bfq: don't grab queue_lock to initialize bfq

The request_queue is frozen and quiesced while the elevator init_sched() method runs, so queue_lock is not needed for BFQ cgroup initialization.

Yu Kuai committed 5 months ago

Commit 3ca4f4e1 parent f9281451 file · +0 −5Browse files

Unified · Split

block/bfq-iosched.c+0−5
@@ -7204,10 +7204,7 @@ static int bfq_init_queue(struct request_queue *q, struct elevator_queue *eq) · 7203 unmodified lines
7204 return -ENOMEM;7204 return -ENOMEM;
7205 7205
7206 eq->elevator_data = bfqd;7206 eq->elevator_data = bfqd;
7207
7208 spin_lock_irq(&q->queue_lock);
7209 q->elevator = eq;7207 q->elevator = eq;
7210 spin_unlock_irq(&q->queue_lock);
7211 7208
7212 /*7209 /*
7213 * Our fallback bfqq if bfq_find_alloc_queue() runs into OOM issues.7210 * Our fallback bfqq if bfq_find_alloc_queue() runs into OOM issues.
@@ -7240,7 +7237,6 @@ static int bfq_init_queue(struct request_queue *q, struct elevator_queue *eq) · 26 unmodified lines
7240 * If the disk supports multiple actuators, copy independent7237 * If the disk supports multiple actuators, copy independent
7241 * access ranges from the request queue structure.7238 * access ranges from the request queue structure.
7242 */7239 */
7243 spin_lock_irq(&q->queue_lock);
7244 if (ia_ranges) {7240 if (ia_ranges) {
7245 /*7241 /*
7246 * Check if the disk ia_ranges size exceeds the current bfq7242 * Check if the disk ia_ranges size exceeds the current bfq
@@ -7266,7 +7262,6 @@ static int bfq_init_queue(struct request_queue *q, struct elevator_queue *eq) · 19 unmodified lines
7266 bfqd->sector[0] = 0;7262 bfqd->sector[0] = 0;
7267 bfqd->nr_sectors[0] = get_capacity(q->disk);7263 bfqd->nr_sectors[0] = get_capacity(q->disk);
7268 }7264 }
7269 spin_unlock_irq(&q->queue_lock);
7270 7265
7271 INIT_LIST_HEAD(&bfqd->dispatch);7266 INIT_LIST_HEAD(&bfqd->dispatch);
7272 7267

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t