Commit 8cc7f93
elevator: factor elevator lock out of dispatch_request method
Currently, both mq-deadline and bfq have global spin lock that will be
grabbed inside elevator methods like dispatch_request, insert_requests,
and bio_merge. And the global lock is the main reason mq-deadline and
bfq can't scale very well.
For dispatch_request method, current behavior is dispatching one request at
a time. In the case of multiple dispatching contexts, this behavior will
cause huge lock contention and messing up the requests dispatching
order. And folloiwng patches will support requests batch dispatching to
fix thoses problems.
While dispatching request, blk_mq_get_disatpch_budget() and
blk_mq_get_driver_tag() must be called, and they are not ready to be
called inside elevator methods, hence introduce a new method like
dispatch_requests is not possible.
In conclusion, this patch factor the global lock out of dispatch_request
method, and following patches will support request batch dispatch by
calling the methods multiple time while holding the lock.
Signed-off-by: Yu Kuai <[email protected]>1 parent 81f19c2 commit 8cc7f93
3 files changed
Lines changed: 7 additions & 7 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
5307 | 5307 | | |
5308 | 5308 | | |
5309 | 5309 | | |
5310 | | - | |
5311 | | - | |
5312 | 5310 | | |
5313 | 5311 | | |
5314 | 5312 | | |
| |||
5318 | 5316 | | |
5319 | 5317 | | |
5320 | 5318 | | |
5321 | | - | |
5322 | 5319 | | |
5323 | 5320 | | |
5324 | 5321 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
98 | 98 | | |
99 | 99 | | |
100 | 100 | | |
| 101 | + | |
101 | 102 | | |
102 | 103 | | |
103 | 104 | | |
| |||
113 | 114 | | |
114 | 115 | | |
115 | 116 | | |
| 117 | + | |
| 118 | + | |
116 | 119 | | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
117 | 123 | | |
118 | 124 | | |
119 | 125 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
466 | 466 | | |
467 | 467 | | |
468 | 468 | | |
469 | | - | |
470 | 469 | | |
471 | 470 | | |
472 | | - | |
| 471 | + | |
473 | 472 | | |
474 | 473 | | |
475 | 474 | | |
| |||
481 | 480 | | |
482 | 481 | | |
483 | 482 | | |
484 | | - | |
485 | | - | |
486 | 483 | | |
487 | 484 | | |
488 | 485 | | |
| |||
0 commit comments