aboutsummaryrefslogtreecommitdiffstats
path: root/kernel/cpuset.c
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2011-11-02 19:07:27 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2011-11-02 19:07:27 -0400
commit092f4c56c1927e4b61a41ee8055005f1cb437009 (patch)
tree616ceb54b7671ccc13922ae9e002b8b972f6e09e /kernel/cpuset.c
parent80c2861672bbf000f6af838656959ee937e4ee4d (diff)
parentc1e2ee2dc436574880758b3836fc96935b774c32 (diff)
Merge branch 'akpm' (Andrew's incoming - part two)
Says Andrew: "60 patches. That's good enough for -rc1 I guess. I have quite a lot of detritus to be rechecked, work through maintainers, etc. - most of the remains of MM - rtc - various misc - cgroups - memcg - cpusets - procfs - ipc - rapidio - sysctl - pps - w1 - drivers/misc - aio" * akpm: (60 commits) memcg: replace ss->id_lock with a rwlock aio: allocate kiocbs in batches drivers/misc/vmw_balloon.c: fix typo in code comment drivers/misc/vmw_balloon.c: determine page allocation flag can_sleep outside loop w1: disable irqs in critical section drivers/w1/w1_int.c: multiple masters used same init_name drivers/power/ds2780_battery.c: fix deadlock upon insertion and removal drivers/power/ds2780_battery.c: add a nolock function to w1 interface drivers/power/ds2780_battery.c: create central point for calling w1 interface w1: ds2760 and ds2780, use ida for id and ida_simple_get() to get it pps gpio client: add missing dependency pps: new client driver using GPIO pps: default echo function include/linux/dma-mapping.h: add dma_zalloc_coherent() sysctl: make CONFIG_SYSCTL_SYSCALL default to n sysctl: add support for poll() RapidIO: documentation update drivers/net/rionet.c: fix ethernet address macros for LE platforms RapidIO: fix potential null deref in rio_setup_device() RapidIO: add mport driver for Tsi721 bridge ...
Diffstat (limited to 'kernel/cpuset.c')
-rw-r--r--kernel/cpuset.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/kernel/cpuset.c b/kernel/cpuset.c
index 10131fdaff70..ed0ff443f036 100644
--- a/kernel/cpuset.c
+++ b/kernel/cpuset.c
@@ -949,6 +949,8 @@ static void cpuset_migrate_mm(struct mm_struct *mm, const nodemask_t *from,
949static void cpuset_change_task_nodemask(struct task_struct *tsk, 949static void cpuset_change_task_nodemask(struct task_struct *tsk,
950 nodemask_t *newmems) 950 nodemask_t *newmems)
951{ 951{
952 bool masks_disjoint = !nodes_intersects(*newmems, tsk->mems_allowed);
953
952repeat: 954repeat:
953 /* 955 /*
954 * Allow tasks that have access to memory reserves because they have 956 * Allow tasks that have access to memory reserves because they have
@@ -963,7 +965,6 @@ repeat:
963 nodes_or(tsk->mems_allowed, tsk->mems_allowed, *newmems); 965 nodes_or(tsk->mems_allowed, tsk->mems_allowed, *newmems);
964 mpol_rebind_task(tsk, newmems, MPOL_REBIND_STEP1); 966 mpol_rebind_task(tsk, newmems, MPOL_REBIND_STEP1);
965 967
966
967 /* 968 /*
968 * ensure checking ->mems_allowed_change_disable after setting all new 969 * ensure checking ->mems_allowed_change_disable after setting all new
969 * allowed nodes. 970 * allowed nodes.
@@ -980,9 +981,11 @@ repeat:
980 981
981 /* 982 /*
982 * Allocation of memory is very fast, we needn't sleep when waiting 983 * Allocation of memory is very fast, we needn't sleep when waiting
983 * for the read-side. 984 * for the read-side. No wait is necessary, however, if at least one
985 * node remains unchanged.
984 */ 986 */
985 while (ACCESS_ONCE(tsk->mems_allowed_change_disable)) { 987 while (masks_disjoint &&
988 ACCESS_ONCE(tsk->mems_allowed_change_disable)) {
986 task_unlock(tsk); 989 task_unlock(tsk);
987 if (!task_curr(tsk)) 990 if (!task_curr(tsk))
988 yield(); 991 yield();