Re: [patch 6/6] mm: memcg: do not trap chargers with full callstack on OOM

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Tue 30-07-13 10:32:28, Johannes Weiner wrote:
> On Tue, Jul 30, 2013 at 04:09:13PM +0200, Michal Hocko wrote:
> > On Fri 26-07-13 17:28:09, Johannes Weiner wrote:
[...]
> > >  	} else {
> > >  		schedule();
> > > +		mem_cgroup_unmark_under_oom(memcg);
> > >  		finish_wait(&memcg_oom_waitq, &owait.wait);
> > >  	}
> > > -	spin_lock(&memcg_oom_lock);
> > > -	if (locked)
> > > -		mem_cgroup_oom_unlock(memcg);
> > > -	memcg_wakeup_oom(memcg);
> > > -	spin_unlock(&memcg_oom_lock);
> > >  
> > > -	mem_cgroup_unmark_under_oom(memcg);
> > > +	if (locked) {
> > > +		mem_cgroup_oom_unlock(memcg);
> > > +		/*
> > > +		 * There is no guarantee that a OOM-lock contender
> > > +		 * sees the wakeups triggered by the OOM kill
> > > +		 * uncharges.  Wake any sleepers explicitely.
> > > +		 */
> > > +		memcg_oom_recover(memcg);
> > 
> > This will be a noop because memcg is no longer under_oom (you wanted
> > memcg_wakeup_oom here I guess). Moreover, even the killed wouldn't wake
> > up anybody for the same reason.
> 
> Anybody entering this path will increase the under_oom counter.  The
> killer decreases it again, but everybody who is sleeping because they
> failed the trylock still hasn't unmarked the hierarchy (they call
> schedule() before unmark_under_oom()).  So we issue wakeups when there
> is somebody waiting for the lock.

True, sorry for the noise. Feel free to add

Acked-by: Michal Hocko <mhocko@xxxxxxx>
-- 
Michal Hocko
SUSE Labs
--
To unsubscribe from this list: send the line "unsubscribe linux-arch" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Linux Kernel]     [Kernel Newbies]     [x86 Platform Driver]     [Netdev]     [Linux Wireless]     [Netfilter]     [Bugtraq]     [Linux Filesystems]     [Yosemite Discussion]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Samba]     [Device Mapper]

  Powered by Linux