]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
cpusets-stall-when-updating-mems_allowed-for-mempolicy-or-disjoint-nodemask-fix-2
authorDavid Rientjes <rientjes@google.com>
Fri, 16 Dec 2011 04:49:22 +0000 (15:49 +1100)
committerStephen Rothwell <sfr@canb.auug.org.au>
Mon, 19 Dec 2011 07:19:11 +0000 (18:19 +1100)
Here's a cleaner way of doing it, we can extend it to mm/slab.c later.
Please fold into
cpusets-stall-when-updating-mems_allowed-for-mempolicy-or-disjoint-nodemask.patch.

Signed-off-by: David Rientjes <rientjes@google.com>
Cc: KOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com>
Cc: Miao Xie <miaox@cn.fujitsu.com>
Cc: Paul Menage <paul@paulmenage.org>
Cc: Stephen Rothwell <sfr@canb.auug.org.au>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
include/linux/mempolicy.h
kernel/cpuset.c

index 7978eec1b7d9964420c2e854afba51a8f9cbf8f5..d2589e298215864aa7d37d5ccbb6461f6542abfb 100644 (file)
@@ -253,6 +253,11 @@ static inline int vma_migratable(struct vm_area_struct *vma)
        return 1;
 }
 
+static inline bool task_has_mempolicy(struct task_struct *task)
+{
+       return task->mempolicy;
+}
+
 #else
 
 struct mempolicy {};
@@ -379,6 +384,11 @@ static inline int mpol_to_str(char *buffer, int maxlen, struct mempolicy *pol,
        return 0;
 }
 
+static inline bool task_has_mempolicy(struct task_struct *task)
+{
+       return false;
+}
+
 #endif /* CONFIG_NUMA */
 #endif /* __KERNEL__ */
 
index e8ed75afb755f590b633626dceda5f4eda789905..841a440b4d37ff9f3e1d5ad53f2ca201a111f430 100644 (file)
@@ -968,10 +968,7 @@ repeat:
         * tsk does not have a mempolicy, then an empty nodemask will not be
         * possible when mems_allowed is larger than a word.
         */
-       need_loop =
-#ifdef CONFIG_NUMA
-               tsk->mempolicy ||
-#endif
+       need_loop = task_has_mempolicy(tsk) ||
                        !nodes_intersects(*newmems, tsk->mems_allowed);
        nodes_or(tsk->mems_allowed, tsk->mems_allowed, *newmems);
        mpol_rebind_task(tsk, newmems, MPOL_REBIND_STEP1);