Commit e1777d0
null_blk: Fix scheduling in atomic with zoned mode
Commit aa1c09c ("null_blk: Fix locking in zoned mode") changed
zone locking to using the potentially sleeping wait_on_bit_io()
function. This is acceptable when memory backing is enabled as the
device queue is in that case marked as blocking, but this triggers a
scheduling while in atomic context with memory backing disabled.
Fix this by relying solely on the device zone spinlock for zone
information protection without temporarily releasing this lock around
null_process_cmd() execution in null_zone_write(). This is OK to do
since when memory backing is disabled, command processing does not
block and the memory backing lock nullb->lock is unused. This solution
avoids the overhead of having to mark a zoned null_blk device queue as
blocking when memory backing is unused.
This patch also adds comments to the zone locking code to explain the
unusual locking scheme.
Fixes: aa1c09c ("null_blk: Fix locking in zoned mode")
Reported-by: kernel test robot <lkp@intel.com>
Signed-off-by: Damien Le Moal <damien.lemoal@wdc.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Cc: stable@vger.kernel.org
Signed-off-by: Jens Axboe <axboe@kernel.dk>1 parent 7ae7a8d commit e1777d0
2 files changed
Lines changed: 32 additions & 17 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
47 | 47 | | |
48 | 48 | | |
49 | 49 | | |
50 | | - | |
| 50 | + | |
51 | 51 | | |
52 | 52 | | |
53 | 53 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
46 | 46 | | |
47 | 47 | | |
48 | 48 | | |
49 | | - | |
50 | | - | |
51 | | - | |
52 | | - | |
53 | | - | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
54 | 63 | | |
55 | 64 | | |
56 | 65 | | |
| |||
137 | 146 | | |
138 | 147 | | |
139 | 148 | | |
140 | | - | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
141 | 152 | | |
142 | 153 | | |
143 | 154 | | |
144 | 155 | | |
145 | | - | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
146 | 160 | | |
147 | 161 | | |
148 | 162 | | |
| |||
322 | 336 | | |
323 | 337 | | |
324 | 338 | | |
325 | | - | |
326 | 339 | | |
327 | 340 | | |
328 | 341 | | |
| |||
375 | 388 | | |
376 | 389 | | |
377 | 390 | | |
378 | | - | |
| 391 | + | |
| 392 | + | |
| 393 | + | |
| 394 | + | |
| 395 | + | |
| 396 | + | |
| 397 | + | |
379 | 398 | | |
380 | | - | |
| 399 | + | |
| 400 | + | |
| 401 | + | |
381 | 402 | | |
382 | 403 | | |
383 | 404 | | |
| |||
392 | 413 | | |
393 | 414 | | |
394 | 415 | | |
395 | | - | |
396 | 416 | | |
397 | 417 | | |
398 | 418 | | |
| |||
516 | 536 | | |
517 | 537 | | |
518 | 538 | | |
519 | | - | |
520 | 539 | | |
521 | | - | |
522 | 540 | | |
523 | 541 | | |
524 | 542 | | |
| |||
530 | 548 | | |
531 | 549 | | |
532 | 550 | | |
533 | | - | |
534 | 551 | | |
535 | 552 | | |
536 | 553 | | |
| |||
550 | 567 | | |
551 | 568 | | |
552 | 569 | | |
553 | | - | |
554 | | - | |
555 | 570 | | |
556 | 571 | | |
557 | 572 | | |
| |||
0 commit comments