Commit 53c2f9d1 authored by Frederic Weisbecker's avatar Frederic Weisbecker
Browse files

block: Protect against concurrent isolated cpuset change



The block subsystem prevents running the workqueue to isolated CPUs,
including those defined by cpuset isolated partitions. Since
HK_TYPE_DOMAIN will soon contain both and be subject to runtime
modifications, synchronize against housekeeping using the relevant lock.

For full support of cpuset changes, the block subsystem may need to
propagate changes to isolated cpumask through the workqueue in the
future.

Signed-off-by: default avatarFrederic Weisbecker <frederic@kernel.org>
Acked-by: default avatarJens Axboe <axboe@kernel.dk>
Cc: Jens Axboe <axboe@kernel.dk>
Cc: Marco Crivellari <marco.crivellari@suse.com>
Cc: Michal Hocko <mhocko@suse.com>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Tejun Heo <tj@kernel.org>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: Vlastimil Babka <vbabka@suse.cz>
Cc: Waiman Long <longman@redhat.com>
Cc: linux-block@vger.kernel.org
parent 662ff1aa
Loading
Loading
Loading
Loading
+5 −1
Original line number Diff line number Diff line
@@ -4257,12 +4257,16 @@ static void blk_mq_map_swqueue(struct request_queue *q)

		/*
		 * Rule out isolated CPUs from hctx->cpumask to avoid
		 * running block kworker on isolated CPUs
		 * running block kworker on isolated CPUs.
		 * FIXME: cpuset should propagate further changes to isolated CPUs
		 * here.
		 */
		rcu_read_lock();
		for_each_cpu(cpu, hctx->cpumask) {
			if (cpu_is_isolated(cpu))
				cpumask_clear_cpu(cpu, hctx->cpumask);
		}
		rcu_read_unlock();

		/*
		 * Initialize batch roundrobin counts