diff options
author | Trond Myklebust <Trond.Myklebust@netapp.com> | 2011-01-10 14:48:02 -0500 |
---|---|---|
committer | Trond Myklebust <Trond.Myklebust@netapp.com> | 2011-01-10 14:48:02 -0500 |
commit | 68c404b18f6fba404b2753622d0459c68ee128ae (patch) | |
tree | c1ec0bb12f19d91071b461cc2831d9d3dd4c74f3 /mm/memcontrol.c | |
parent | d035c36c58dd9183ad6aa7875dea89893faedb55 (diff) | |
parent | 6650239a4b01077e80d5a4468562756d77afaa59 (diff) |
Merge branch 'bugfixes' into nfs-for-2.6.38
Conflicts:
fs/nfs/nfs2xdr.c
fs/nfs/nfs3xdr.c
fs/nfs/nfs4xdr.c
Diffstat (limited to 'mm/memcontrol.c')
-rw-r--r-- | mm/memcontrol.c | 19 |
1 files changed, 9 insertions, 10 deletions
diff --git a/mm/memcontrol.c b/mm/memcontrol.c index 7a22b4129211..00bb8a64d028 100644 --- a/mm/memcontrol.c +++ b/mm/memcontrol.c | |||
@@ -1925,19 +1925,18 @@ again: | |||
1925 | 1925 | ||
1926 | rcu_read_lock(); | 1926 | rcu_read_lock(); |
1927 | p = rcu_dereference(mm->owner); | 1927 | p = rcu_dereference(mm->owner); |
1928 | VM_BUG_ON(!p); | ||
1929 | /* | 1928 | /* |
1930 | * because we don't have task_lock(), "p" can exit while | 1929 | * Because we don't have task_lock(), "p" can exit. |
1931 | * we're here. In that case, "mem" can point to root | 1930 | * In that case, "mem" can point to root or p can be NULL with |
1932 | * cgroup but never be NULL. (and task_struct itself is freed | 1931 | * race with swapoff. Then, we have small risk of mis-accouning. |
1933 | * by RCU, cgroup itself is RCU safe.) Then, we have small | 1932 | * But such kind of mis-account by race always happens because |
1934 | * risk here to get wrong cgroup. But such kind of mis-account | 1933 | * we don't have cgroup_mutex(). It's overkill and we allo that |
1935 | * by race always happens because we don't have cgroup_mutex(). | 1934 | * small race, here. |
1936 | * It's overkill and we allow that small race, here. | 1935 | * (*) swapoff at el will charge against mm-struct not against |
1936 | * task-struct. So, mm->owner can be NULL. | ||
1937 | */ | 1937 | */ |
1938 | mem = mem_cgroup_from_task(p); | 1938 | mem = mem_cgroup_from_task(p); |
1939 | VM_BUG_ON(!mem); | 1939 | if (!mem || mem_cgroup_is_root(mem)) { |
1940 | if (mem_cgroup_is_root(mem)) { | ||
1941 | rcu_read_unlock(); | 1940 | rcu_read_unlock(); |
1942 | goto done; | 1941 | goto done; |
1943 | } | 1942 | } |