diff options
Diffstat (limited to 'mm/memcontrol.c')
| -rw-r--r-- | mm/memcontrol.c | 6 | 
1 files changed, 2 insertions, 4 deletions
diff --git a/mm/memcontrol.c b/mm/memcontrol.c index f4ede99c8b9..8a79a6f0f02 100644 --- a/mm/memcontrol.c +++ b/mm/memcontrol.c @@ -1601,7 +1601,6 @@ static int __mem_cgroup_try_charge(struct mm_struct *mm,  			 * There is a small race that "from" or "to" can be  			 * freed by rmdir, so we use css_tryget().  			 */ -			rcu_read_lock();  			from = mc.from;  			to = mc.to;  			if (from && css_tryget(&from->css)) { @@ -1622,7 +1621,6 @@ static int __mem_cgroup_try_charge(struct mm_struct *mm,  					do_continue = (to == mem_over_limit);  				css_put(&to->css);  			} -			rcu_read_unlock();  			if (do_continue) {  				DEFINE_WAIT(wait);  				prepare_to_wait(&mc.waitq, &wait, @@ -2429,11 +2427,11 @@ int mem_cgroup_prepare_migration(struct page *page, struct mem_cgroup **ptr)  	}  	unlock_page_cgroup(pc); +	*ptr = mem;  	if (mem) { -		ret = __mem_cgroup_try_charge(NULL, GFP_KERNEL, &mem, false); +		ret = __mem_cgroup_try_charge(NULL, GFP_KERNEL, ptr, false);  		css_put(&mem->css);  	} -	*ptr = mem;  	return ret;  }  |