diff options
author | Ming Lei <[email protected]> | 2018-01-18 00:41:51 +0800 |
---|---|---|
committer | Jens Axboe <[email protected]> | 2018-01-17 09:46:26 -0700 |
commit | 7bed45954b95601230ebf387d3e4e20e4a3cc025 (patch) | |
tree | 546b673aef51257fc7479cf73d71abe4f511c865 /tools/perf/scripts/python | |
parent | 85cf955df8317bbc513663b5610979fdd6a0da2a (diff) |
blk-mq: make sure hctx->next_cpu is set correctly
When hctx->next_cpu is set from possible online CPUs, there is one
race in which hctx->next_cpu may be set as >= nr_cpu_ids, and finally
break workqueue.
The race can be triggered in the following two sitations:
1) when one CPU is becoming DEAD, blk_mq_hctx_notify_dead() is called
to dispatch requests from the DEAD cpu context, but at that
time, this DEAD CPU has been cleared from 'cpu_online_mask', so all
CPUs in hctx->cpumask may become offline, and cause hctx->next_cpu set
a bad value.
2) blk_mq_delay_run_hw_queue() is called from CPU B, and found the queue
should be run on the other CPU A, then CPU A may become offline at the
same time and all CPUs in hctx->cpumask become offline.
This patch deals with this issue by re-selecting next CPU, and making
sure it is set correctly.
Cc: Christian Borntraeger <[email protected]>
Cc: Stefan Haberland <[email protected]>
Cc: Christoph Hellwig <[email protected]>
Cc: Thomas Gleixner <[email protected]>
Reported-by: "jianchao.wang" <[email protected]>
Tested-by: "jianchao.wang" <[email protected]>
Fixes: 20e4d81393 ("blk-mq: simplify queue mapping & schedule with each possisble CPU")
Signed-off-by: Ming Lei <[email protected]>
Signed-off-by: Jens Axboe <[email protected]>
Diffstat (limited to 'tools/perf/scripts/python')
0 files changed, 0 insertions, 0 deletions