On Tue, Mar 31, 2015 at 10:27:26AM -0400, Rik van Riel wrote:
CPUs with nohz_full do not want disruption from timer interrupts,
or other random system things. This includes block mq work.
There is another issue with block mq vs. realtime tasks that run
100% of the time, which is not uncommon on systems that have CPUs
dedicated to real time use with isolcpus= and nohz_full=
Specifically, on systems like that, a block work item may never
get to run, which could lead to filesystems getting stuck forever.
We can avoid both issues by not scheduling blk-mq workqueues on
cpus in nohz_full mode.
Question for Jens: should we try to spread out the load for
currently offline and nohz CPUs across the remaining CPUs in
the system, to get the full benefit of blk-mq in these situations?
If so, do you have any preference on how I should implement that?
Cc: Frederic Weisbecker <fweisbec@xxxxxxxxxx>
Cc: Ingo Molnar <mingo@xxxxxxxxxx>
Cc: Jens Axboe <axboe@xxxxxxxxxx>
Signed-off-by: Rik van Riel <riel@xxxxxxxxxx>
block/blk-mq.c | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/block/blk-mq.c b/block/blk-mq.c
index 4f4bea21052e..1004d6817fa4 100644
@@ -21,6 +21,7 @@
@@ -1760,6 +1761,10 @@ static void blk_mq_init_cpu_queues(struct request_queue *q,
+ /* Do not schedule work on nohz full dedicated CPUs. */
+ if (tick_nohz_full_cpu(i))
hctx = q->mq_ops->map_queue(q, i);
I suppose any bound workqueue queued on isolated CPUs should be moved at
queue time to other CPUs (sacrifficing performance).
So that by doing "queue_work" on an isolated CPU would move that
work somewhere else.