blk-throttle: schedule parent dispatch in tg_flush_bios()#857
Open
blktests-ci[bot] wants to merge 1 commit into
Open
blk-throttle: schedule parent dispatch in tg_flush_bios()#857blktests-ci[bot] wants to merge 1 commit into
blktests-ci[bot] wants to merge 1 commit into
Conversation
Author
|
Upstream branch: 70eda68 |
ca57796 to
c1feb59
Compare
Author
|
Upstream branch: 8bc67e4 |
3215068 to
289b9cd
Compare
c1feb59 to
ea833a1
Compare
Author
|
Upstream branch: 6779b50 |
289b9cd to
83fcc4b
Compare
Author
|
Upstream branch: 6779b50 |
83fcc4b to
99e9641
Compare
ea833a1 to
7af85d1
Compare
tg_flush_bios() schedules pending_timer on the child tg's own service_queue, which causes throtl_pending_timer_fn() to dispatch from the child's pending_tree. For leaf cgroups this tree is empty, so the timer fires and exits without dispatching the throttled bio. The throttled bio sits in the parent's pending_tree with disptime set to jiffies (THROTL_TG_CANCELING zeroes all dispatch times), but the parent's timer is never explicitly rescheduled. The bio only gets dispatched when the parent timer eventually fires at its previously scheduled expiry. Fix by calling throtl_schedule_next_dispatch(sq->parent_sq, true) instead, matching what tg_set_limit() already does. This forces the parent's dispatch cycle to run immediately and flush all canceling bios without waiting for a stale timer. For the device deletion path (blk_throtl_cancel_bios), directly complete throttled bios with EIO via bio_io_error() instead of dispatching them through the timer -> work -> submission chain. This avoids a race with the SCSI state machine where bios can reach the SCSI layer while the device is in SDEV_CANCEL state, causing ENODEV instead of the expected EIO. Reported-by: Shin'ichiro Kawasaki <shinichiro.kawasaki@wdc.com> Link: https://lore.kernel.org/all/ag2owaQQoigp_fSV@shinmob/ Signed-off-by: Tao Cui <cuitao@kylinos.cn>
Author
|
Upstream branch: 79bd2dd |
99e9641 to
69dd8a7
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Pull request for series with
subject: blk-throttle: schedule parent dispatch in tg_flush_bios()
version: 1
url: https://patchwork.kernel.org/project/linux-block/list/?series=1097754