From: Daniel Vetter <daniel@ffwll.ch>
To: Chris Wilson <chris@chris-wilson.co.uk>,
"Gore, Tim" <tim.gore@intel.com>,
"intel-gfx@lists.freedesktop.org"
<intel-gfx@lists.freedesktop.org>
Subject: Re: [PATCH 0/2] Disable Android low memory killer
Date: Mon, 29 Sep 2014 15:19:05 +0200 [thread overview]
Message-ID: <20140929131905.GO4109@phenom.ffwll.local> (raw)
In-Reply-To: <20140926111449.GA9308@nuc-i3427.alporthouse.com>
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@chris-wilson.co.uk]
> > > Sent: Friday, September 26, 2014 11:30 AM
> > > To: Gore, Tim
> > > Cc: intel-gfx@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
prev parent reply other threads:[~2014-09-29 13:19 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-09-26 9:27 [PATCH 0/2] Disable Android low memory killer tim.gore
2014-09-26 9:27 ` [PATCH 1/2] lib/igt_core: make single/simple tests use igt_exit tim.gore
2014-09-29 13:15 ` Daniel Vetter
2014-09-26 9:27 ` [PATCH 2/2] lib/igt_core.c: disable lowmemorykiller during tests tim.gore
2014-09-26 9:49 ` [PATCH 0/2] Disable Android low memory killer Chris Wilson
2014-09-26 10:08 ` Gore, Tim
2014-09-26 10:20 ` Chris Wilson
2014-09-26 10:29 ` Chris Wilson
2014-09-26 10:46 ` Gore, Tim
2014-09-26 11:14 ` Chris Wilson
2014-09-29 13:19 ` Daniel Vetter [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20140929131905.GO4109@phenom.ffwll.local \
--to=daniel@ffwll.ch \
--cc=chris@chris-wilson.co.uk \
--cc=intel-gfx@lists.freedesktop.org \
--cc=tim.gore@intel.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox