public inbox for intel-gfx@lists.freedesktop.org
 help / color / mirror / Atom feed
From: Daniel Vetter <daniel@ffwll.ch>
To: "Gore, Tim" <tim.gore@intel.com>
Cc: "daniel.vetter@ffwll.ch" <daniel.vetter@ffwll.ch>,
	"intel-gfx@lists.freedesktop.org"
	<intel-gfx@lists.freedesktop.org>
Subject: Re: [PATCH] intel-gpu-tools: skip gem_mmap_offset_exhaustion on Android
Date: Fri, 25 Jul 2014 11:39:42 +0200	[thread overview]
Message-ID: <20140725093942.GU4747@phenom.ffwll.local> (raw)
In-Reply-To: <8FCC70911F3E9548866CA0E51893BCC31A1DC5EE@IRSMSX105.ger.corp.intel.com>

On Fri, Jul 25, 2014 at 09:14:51AM +0000, Gore, Tim wrote:
> 
> 
> > -----Original Message-----
> > From: Daniel Vetter [mailto:daniel.vetter@ffwll.ch] On Behalf Of Daniel
> > Vetter
> > Sent: Friday, July 25, 2014 10:07 AM
> > To: Gore, Tim
> > Cc: intel-gfx@lists.freedesktop.org; daniel.vetter@ffwll.ch
> > Subject: Re: [PATCH] intel-gpu-tools: skip gem_mmap_offset_exhaustion on
> > Android
> > 
> > On Fri, Jul 25, 2014 at 10:00:19AM +0100, tim.gore@intel.com wrote:
> > > From: Tim Gore <tim.gore@intel.com>
> > >
> > > gem_mmap_offset_exhaustion relies on purgeable memory allocations
> > > getting swapped out, freeing up physical memory for further
> > > allocations. On Android we have no swap partition so this cannot
> > > happen and the test gets killed by the low memory killer before mmap
> > > offset exhaustion can happen, thus defeating the tests purpose.
> > >
> > > Signed-off-by: Tim Gore <tim.gore@intel.com>
> > 
> > 
> > 
> > 	/* we happily leak objects to exhaust mmap offset space, the kernel
> > will
> > 	 * reap backing storage. */
> > 	gem_madvise(fd, handle, I915_MADV_DONTNEED);
> > 
> > There's really no way you should be able to run out of memory. I suspect
> > android kernel's will fall over even with swap.
> > -Daniel
> > 
> Well, not sure I fully understand how GEM works, but I can clearly see the free memory
> Shrinking until the OOM killer steps in. Since the bo's are not destroyed, surely the only
> Way for the physical memory to be reclaimed is if it gets swapped out, which Android
> Wont do. Perhaps I misunderstand "purgeable". Should kswapd free such memory?

Well that's how i915 is designed. The shrinker is officially the right
interface for the core vm to tell various other pieces in the kernel when
they should tighten up. If the lowmemkiller in android is a bit too
enthusiastic about this and starts shooting down random process even
before we run out of memory for real then that's a design-screw up.

I've never looked at it, but a possible fix might be to remove the
lowmemkiller from the shrinker and instead wire it up as a true OOM
callback.

Disabling the test because memory pressure handling on android is busted
is certainly not the right fix.
-Daniel
-- 
Daniel Vetter
Software Engineer, Intel Corporation
+41 (0) 79 365 57 48 - http://blog.ffwll.ch

  reply	other threads:[~2014-07-25  9:39 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-07-25  9:00 [PATCH] intel-gpu-tools: skip gem_mmap_offset_exhaustion on Android tim.gore
2014-07-25  9:06 ` Daniel Vetter
2014-07-25  9:14   ` Gore, Tim
2014-07-25  9:39     ` Daniel Vetter [this message]
2014-07-25  9:17   ` Chris Wilson
2014-07-25  9:37     ` Daniel Vetter
2014-07-25  9:56       ` Tvrtko Ursulin

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=20140725093942.GU4747@phenom.ffwll.local \
    --to=daniel@ffwll.ch \
    --cc=daniel.vetter@ffwll.ch \
    --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