Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1716498 > unrolled thread
| Started by | Laurent Vivier <lvivier@redhat.com> |
|---|---|
| First post | 2017-08-21 16:00 +0200 |
| Last post | 2017-08-21 16:50 +0200 |
| Articles | 2 — 2 participants |
Back to article view | Back to linux.kernel
This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by
below is the oldest one visible, not the original post.
[PATCH 2/2] blk-mq: don't use WORK_CPU_UNBOUND Laurent Vivier <lvivier@redhat.com> - 2017-08-21 16:00 +0200
Re: [PATCH 2/2] blk-mq: don't use WORK_CPU_UNBOUND Tejun Heo <tj@kernel.org> - 2017-08-21 16:50 +0200
| From | Laurent Vivier <lvivier@redhat.com> |
|---|---|
| Date | 2017-08-21 16:00 +0200 |
| Subject | [PATCH 2/2] blk-mq: don't use WORK_CPU_UNBOUND |
| Message-ID | <ugVpg-54m-11@gated-at.bofh.it> |
cpumask is the list of CPUs present when the queue is built.
If a new CPU is hotplugged, this list is not updated,
and when the scheduler asks for a CPU id, blk_mq_hctx_next_cpu()
can return WORK_CPU_UNBOUND.
And in this case _blk_mq_run_hw_queue() can be executed by the new CPU
(that is not present in cpumask) and raises the following warning:
WARN_ON(!cpumask_test_cpu(raw_smp_processor_id(), hctx->cpumask) &&
cpu_online(hctx->next_cpu));
To fix this problem, this patch modifies blk_mq_hctx_next_cpu()
to only return a CPU id present in cpumask.
Signed-off-by: Laurent Vivier <lvivier@redhat.com>
---
block/blk-mq.c | 3 ---
1 file changed, 3 deletions(-)
diff --git a/block/blk-mq.c b/block/blk-mq.c
index 4603b115e234..bdac1e654814 100644
--- a/block/blk-mq.c
+++ b/block/blk-mq.c
@@ -1126,9 +1126,6 @@ static void __blk_mq_run_hw_queue(struct blk_mq_hw_ctx *hctx)
*/
static int blk_mq_hctx_next_cpu(struct blk_mq_hw_ctx *hctx)
{
- if (hctx->queue->nr_hw_queues == 1)
- return WORK_CPU_UNBOUND;
-
if (--hctx->next_cpu_batch <= 0) {
int next_cpu;
--
2.13.5
[toc] | [next] | [standalone]
| From | Tejun Heo <tj@kernel.org> |
|---|---|
| Date | 2017-08-21 16:50 +0200 |
| Message-ID | <ugWbF-5BL-27@gated-at.bofh.it> |
| In reply to | #1716498 |
On Mon, Aug 21, 2017 at 03:49:51PM +0200, Laurent Vivier wrote: > cpumask is the list of CPUs present when the queue is built. > If a new CPU is hotplugged, this list is not updated, > and when the scheduler asks for a CPU id, blk_mq_hctx_next_cpu() > can return WORK_CPU_UNBOUND. > And in this case _blk_mq_run_hw_queue() can be executed by the new CPU > (that is not present in cpumask) and raises the following warning: > > WARN_ON(!cpumask_test_cpu(raw_smp_processor_id(), hctx->cpumask) && > cpu_online(hctx->next_cpu)); > > To fix this problem, this patch modifies blk_mq_hctx_next_cpu() > to only return a CPU id present in cpumask. So, this one isn't needed either. Thanks. -- tejun
[toc] | [prev] | [standalone]
Back to top | Article view | linux.kernel
csiph-web