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.

sched/isolation: Flush vmstat workqueues on cpuset isolated partition change

The HK_TYPE_DOMAIN housekeeping cpumask is now modifiable at runtime.
In order to synchronize against vmstat workqueue to make sure
that no asynchronous vmstat work is still pending or executing on a
newly made isolated CPU, the housekeeping susbsystem must flush the
vmstat workqueues.

This involves flushing the whole mm_percpu_wq workqueue, shared with
LRU drain, introducing here a welcome side effect.

Signed-off-by: Frederic Weisbecker <frederic@kernel.org>
Cc: Andrew Morton <akpm@linux-foundation.org>
Cc: Ingo Molnar <mingo@redhat.com>
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

+9
+2
include/linux/vmstat.h
··· 303 303 int calculate_normal_threshold(struct zone *zone); 304 304 void set_pgdat_percpu_threshold(pg_data_t *pgdat, 305 305 int (*calculate_pressure)(struct zone *)); 306 + void vmstat_flush_workqueue(void); 306 307 #else /* CONFIG_SMP */ 307 308 308 309 /* ··· 404 403 static inline void refresh_zone_stat_thresholds(void) { } 405 404 static inline void cpu_vm_stats_fold(int cpu) { } 406 405 static inline void quiet_vmstat(void) { } 406 + static inline void vmstat_flush_workqueue(void) { } 407 407 408 408 static inline void drain_zonestat(struct zone *zone, 409 409 struct per_cpu_zonestat *pzstats) { }
+1
kernel/sched/isolation.c
··· 145 145 synchronize_rcu(); 146 146 147 147 mem_cgroup_flush_workqueue(); 148 + vmstat_flush_workqueue(); 148 149 149 150 kfree(old); 150 151
+1
kernel/sched/sched.h
··· 68 68 #include <linux/types.h> 69 69 #include <linux/u64_stats_sync_api.h> 70 70 #include <linux/uaccess.h> 71 + #include <linux/vmstat.h> 71 72 #include <linux/wait_api.h> 72 73 #include <linux/wait_bit.h> 73 74 #include <linux/workqueue_api.h>
+5
mm/vmstat.c
··· 2124 2124 2125 2125 static DECLARE_DEFERRABLE_WORK(shepherd, vmstat_shepherd); 2126 2126 2127 + void vmstat_flush_workqueue(void) 2128 + { 2129 + flush_workqueue(mm_percpu_wq); 2130 + } 2131 + 2127 2132 static void vmstat_shepherd(struct work_struct *w) 2128 2133 { 2129 2134 int cpu;