The patch titled
Memory controller use rcu_read_lock() in mem_cgroup_cache_charge()
has been removed from the -mm tree. Its filename was
memory-controller-use-rcu_read_lock-in-mem_cgroup_cache_charge.patch
This patch was dropped because it was merged into mainline or a subsystem tree
The current -mm tree may be found at http://userweb.kernel.org/~akpm/mmotm/
------------------------------------------------------
Subject: Memory controller use rcu_read_lock() in mem_cgroup_cache_charge()
From: Balbir Singh <[EMAIL PROTECTED]>
Hugh Dickins noticed that we were using rcu_dereference() without
rcu_read_lock() in the cache charging routine. The patch below fixes
this problem
Signed-off-by: Balbir Singh <[EMAIL PROTECTED]>
Acked-by: KAMEZAWA Hiroyuki <[EMAIL PROTECTED]>
Cc: Hugh Dickins <[EMAIL PROTECTED]>
Signed-off-by: Andrew Morton <[EMAIL PROTECTED]>
---
mm/memcontrol.c | 10 +++++++---
1 file changed, 7 insertions(+), 3 deletions(-)
diff -puN
mm/memcontrol.c~memory-controller-use-rcu_read_lock-in-mem_cgroup_cache_charge
mm/memcontrol.c
---
a/mm/memcontrol.c~memory-controller-use-rcu_read_lock-in-mem_cgroup_cache_charge
+++ a/mm/memcontrol.c
@@ -456,16 +456,20 @@ int mem_cgroup_charge(struct page *page,
int mem_cgroup_cache_charge(struct page *page, struct mm_struct *mm,
gfp_t gfp_mask)
{
+ int ret = 0;
struct mem_cgroup *mem;
if (!mm)
mm = &init_mm;
+ rcu_read_lock();
mem = rcu_dereference(mm->mem_cgroup);
+ css_get(&mem->css);
+ rcu_read_unlock();
if (mem->control_type == MEM_CGROUP_TYPE_ALL)
- return mem_cgroup_charge_common(page, mm, gfp_mask,
+ ret = mem_cgroup_charge_common(page, mm, gfp_mask,
MEM_CGROUP_CHARGE_TYPE_CACHE);
- else
- return 0;
+ css_put(&mem->css);
+ return ret;
}
/*
_
Patches currently in -mm which might be from [EMAIL PROTECTED] are
origin.patch
getdelays-fix-gcc-warnings.patch
-
To unsubscribe from this list: send the line "unsubscribe mm-commits" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at http://vger.kernel.org/majordomo-info.html