Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

mm: vmstat: Prepare to protect against concurrent isolated cpuset change

The HK_TYPE_DOMAIN housekeeping cpumask will soon be made modifiable at
runtime. In order to synchronize against vmstat workqueue to make sure
that no asynchronous vmstat work is pending or executing on a newly made
isolated CPU, target and queue a vmstat work under the same RCU read
side critical section.

Whenever housekeeping will update the HK_TYPE_DOMAIN cpumask, a vmstat
workqueue flush will also be issued in a further change to make sure
that no work remains pending after a CPU has been made isolated.

Acked-by: Michal Hocko <mhocko@suse.com>
Signed-off-by: Frederic Weisbecker <frederic@kernel.org>
Cc: Andrew Morton <akpm@linux-foundation.org>
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-mm@kvack.org

+6 -4
+6 -4
mm/vmstat.c
··· 2144 2144 * infrastructure ever noticing. Skip regular flushing from vmstat_shepherd 2145 2145 * for all isolated CPUs to avoid interference with the isolated workload. 2146 2146 */ 2147 - if (cpu_is_isolated(cpu)) 2148 - continue; 2147 + scoped_guard(rcu) { 2148 + if (cpu_is_isolated(cpu)) 2149 + continue; 2149 2150 2150 - if (!delayed_work_pending(dw) && need_update(cpu)) 2151 - queue_delayed_work_on(cpu, mm_percpu_wq, dw, 0); 2151 + if (!delayed_work_pending(dw) && need_update(cpu)) 2152 + queue_delayed_work_on(cpu, mm_percpu_wq, dw, 0); 2153 + } 2152 2154 2153 2155 cond_resched(); 2154 2156 }