Re: [PATCH] mm,oom: do not loop !__GFP_FS allocation if the OOM killer is disabled.

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

 



On Mon 11-01-16 12:43:29, Johannes Weiner wrote:
> On Mon, Jan 11, 2016 at 06:20:58PM +0100, Michal Hocko wrote:
> > On Mon 11-01-16 12:00:47, Johannes Weiner wrote:
> > > On Mon, Jan 11, 2016 at 02:07:16PM +0900, Tetsuo Handa wrote:
> > > > After the OOM killer is disabled during suspend operation,
> > > > any !__GFP_NOFAIL && __GFP_FS allocations are forced to fail.
> > > > Thus, any !__GFP_NOFAIL && !__GFP_FS allocations should be
> > > > forced to fail as well.
> > > > 
> > > > Signed-off-by: Tetsuo Handa <penguin-kernel@xxxxxxxxxxxxxxxxxxx>
> > > 
> > > Why? We had to acknowledge that !__GFP_FS allocations can not fail
> > > even when they can't invoke the OOM killer. They are NOFAIL. Just like
> > > an explicit __GFP_NOFAIL they should trigger a warning when they occur
> > > after the OOM killer has been disabled and then keep looping.
> > 
> > They are more like GFP_KERNEL than GFP_NOFAIL IMO because unlike
> > GFP_NOFAIL they are already allowed to fail due to fatal_signals_pending
> > and this has been the case for a really long time.  Even semantically
> > they are basically GFP_KERNEL with FS recursion protection in majority
> > cases. And I believe that we should allow them to fail long term after
> > some FS (btrfs at least) catch up and start handling failures properly.
> 
> I see, yeah that's probably a better way to look at it.
> 
> Thanks!
> 
> Scratch my objection to this patch then. But please do add to/update
> that XXX comment above that line, or it'll be confusing. Hm?
> 
> 			/*
> 			 * XXX: Page reclaim didn't yield anything,
> 			 * and the OOM killer can't be invoked, but
> 			 * keep looping as per tradition. Unless the
> 			 * system is trying to enter a quiescent state
> 			 * during suspend and the OOM killer has been
> 			 * shut off already. Give up like with other
> 			 * !__GFP_NOFAIL allocations in that case.
> 			 */
> 			*did_some_progress = !oom_killer_disabled;

Yes this makes it more clear IMO.

-- 
Michal Hocko
SUSE Labs

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@xxxxxxxxx.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@xxxxxxxxx";> email@xxxxxxxxx </a>



[Index of Archives]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Bugtraq]     [Linux]     [Linux OMAP]     [Linux MIPS]     [ECOS]     [Asterisk Internet PBX]     [Linux API]