[Intel-gfx] [PATCH 0/2] Disable Android low memory killer

Daniel Vetter daniel at ffwll.ch
Mon Sep 29 15:19:05 CEST 2014


On Fri, Sep 26, 2014 at 12:14:49PM +0100, Chris Wilson wrote:
> On Fri, Sep 26, 2014 at 10:46:48AM +0000, Gore, Tim wrote:
> > 
> > 
> > > -----Original Message-----
> > > From: Chris Wilson [mailto:chris at chris-wilson.co.uk]
> > > Sent: Friday, September 26, 2014 11:30 AM
> > > To: Gore, Tim
> > > Cc: intel-gfx at lists.freedesktop.org
> > > Subject: Re: [Intel-gfx] [PATCH 0/2] Disable Android low memory killer
> > > 
> > > On Fri, Sep 26, 2014 at 10:08:54AM +0000, Gore, Tim wrote:
> > > > I don't think so. This is really just about the Android low memory
> > > > killer having Different goals to kswapd. Kswapd tries to keep a
> > > > certain amount of free memory so that the kernel can run smoothly. On
> > > > Android the lowmemorykiller attempts to maintain somewhat higher
> > > > levels of free memory by killing off processes, because the user is
> > > > not expected to ever close anything and expects new applications to
> > > > open quickly. So if you put the memory under pressure the Android low
> > > > memory killer will inevitably look for something to kill, and if your
> > > > test is the only thing running its toast. The linux oom killer is still there, but
> > > is never needed on Android because the lowmemorykiller gets there first.
> > > 
> > > Though I think the interaction between lowmemkiller and i915 is broken, I do
> > > agree that we need to run our swap tests and that to do so we need to
> > > disable lowmemkiller.
> > > 
> > > I would prefer it if only the swap-thrash tests disabled the lowmemkiller
> > > though, as I think we still need to test integration behaviour and if
> > > lowmemkiller starts killing tests that we think should be well within the limits,
> > > that is likely to be our bug.
> > > -Chris
> > > 
> > We could do it on a test by test basis if people prefer. It just puts the responsibility
> > on test writers to know when they might trigger the lowmemorykiller. The trouble
> > is that the kernel is pretty lazy when comes to freeing up memory. You may think
> > there should be plenty "free", but that doesn't mean those pages are on the free list.
> > Once kswapd has achieved its high water mark its done. But the lowmemorykiller
> > always looks for more than the high water mark (its threshold is based on the
> > high water mark, so is always higher). If you have enough file backed pages you're ok,
> > but igt tests don't tend to do much file reading.
> 
> The principle is that mempressure tests call intel_check_memory() first
> to see if it valid to run. One of its side-effects is kick the kernel
> into freeing up all of its caches. It seems reasonable that we could
> disable lowmemkiller here if the test declares that it wants to use
> swap. The trick I leave up to you is how to reenable lowmemkiller
> automatically when the test completes...
> 
> Or since swap tests are already special, there is no problem in having
>   igt_swapping_start();
>   ...
>   igt_swapping_end();
> bracketing them.

Iiui corrrectly then this isn't good enough, and the lowmemory killer will
go beserk even for the tests that exercise purgeable behaviour.

Imo this stuff is just fundamentally misdesigned, but if our Android gfx
people are ok with the state of affairs and don't want to fix the
lowmemory killer for i915 then I'm ok with merging this hack. And then it
also makes sense to have it unconditionally for all tests. We just need to
add a big comment explaining that if someone ever fixes up the lowmemory
killer we need to drop this again.
-Daniel
-- 
Daniel Vetter
Software Engineer, Intel Corporation
+41 (0) 79 365 57 48 - http://blog.ffwll.ch



More information about the Intel-gfx mailing list