From: David Rientjes Since no task descriptor's 'cpuset' field is dereferenced in the execution of the OOM killer anymore, it is no longer necessary to take callback_mutex. Cc: Andrea Arcangeli Acked-by: Christoph Lameter Signed-off-by: David Rientjes Signed-off-by: Andrew Morton --- include/linux/cpuset.h | 6 ------ kernel/cpuset.c | 27 --------------------------- mm/oom_kill.c | 3 --- 3 files changed, 36 deletions(-) diff -puN include/linux/cpuset.h~oom-do-not-take-callback_mutex include/linux/cpuset.h --- a/include/linux/cpuset.h~oom-do-not-take-callback_mutex +++ a/include/linux/cpuset.h @@ -59,9 +59,6 @@ extern void __cpuset_memory_pressure_bum extern const struct file_operations proc_cpuset_operations; extern char *cpuset_task_status_allowed(struct task_struct *task, char *buffer); -extern void cpuset_lock(void); -extern void cpuset_unlock(void); - extern int cpuset_mem_spread_node(void); static inline int cpuset_do_page_mem_spread(void) @@ -128,9 +125,6 @@ static inline char *cpuset_task_status_a return buffer; } -static inline void cpuset_lock(void) {} -static inline void cpuset_unlock(void) {} - static inline int cpuset_mem_spread_node(void) { return 0; diff -puN kernel/cpuset.c~oom-do-not-take-callback_mutex kernel/cpuset.c --- a/kernel/cpuset.c~oom-do-not-take-callback_mutex +++ a/kernel/cpuset.c @@ -2521,33 +2521,6 @@ int __cpuset_zone_allowed_hardwall(struc } /** - * cpuset_lock - lock out any changes to cpuset structures - * - * The out of memory (oom) code needs to mutex_lock cpusets - * from being changed while it scans the tasklist looking for a - * task in an overlapping cpuset. Expose callback_mutex via this - * cpuset_lock() routine, so the oom code can lock it, before - * locking the task list. The tasklist_lock is a spinlock, so - * must be taken inside callback_mutex. - */ - -void cpuset_lock(void) -{ - mutex_lock(&callback_mutex); -} - -/** - * cpuset_unlock - release lock on cpuset changes - * - * Undo the lock taken in a previous cpuset_lock() call. - */ - -void cpuset_unlock(void) -{ - mutex_unlock(&callback_mutex); -} - -/** * cpuset_mem_spread_node() - On which node to begin search for a page * * If a task is marked PF_SPREAD_PAGE or PF_SPREAD_SLAB (as for diff -puN mm/oom_kill.c~oom-do-not-take-callback_mutex mm/oom_kill.c --- a/mm/oom_kill.c~oom-do-not-take-callback_mutex +++ a/mm/oom_kill.c @@ -463,7 +463,6 @@ void out_of_memory(struct zonelist *zone * NUMA) that may require different handling. */ constraint = constrained_alloc(zonelist, gfp_mask); - cpuset_lock(); read_lock(&tasklist_lock); switch (constraint) { @@ -495,7 +494,6 @@ retry: /* Found nothing?!?! Either we hang forever, or we panic. */ if (!p) { read_unlock(&tasklist_lock); - cpuset_unlock(); panic("Out of memory and no killable processes...\n"); } @@ -508,7 +506,6 @@ retry: out: read_unlock(&tasklist_lock); - cpuset_unlock(); /* * Give "p" a good chance of killing itself before we _