* [PATCH] intel-gpu-tools: skip gem_mmap_offset_exhaustion on Android @ 2014-07-25 9:00 tim.gore 2014-07-25 9:06 ` Daniel Vetter 0 siblings, 1 reply; 7+ messages in thread From: tim.gore @ 2014-07-25 9:00 UTC (permalink / raw) To: intel-gfx; +Cc: daniel.vetter 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> --- tests/gem_mmap_offset_exhaustion.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/tests/gem_mmap_offset_exhaustion.c b/tests/gem_mmap_offset_exhaustion.c index 914fe6e..016143d 100644 --- a/tests/gem_mmap_offset_exhaustion.c +++ b/tests/gem_mmap_offset_exhaustion.c @@ -77,6 +77,10 @@ igt_simple_main { int fd, i; +#ifdef ANDROID + igt_skip("Test not valid on Android\n"); +#endif + igt_skip_on_simulation(); fd = drm_open_any(); -- 1.9.2 ^ permalink raw reply related [flat|nested] 7+ messages in thread
* Re: [PATCH] intel-gpu-tools: skip gem_mmap_offset_exhaustion on Android 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:17 ` Chris Wilson 0 siblings, 2 replies; 7+ messages in thread From: Daniel Vetter @ 2014-07-25 9:06 UTC (permalink / raw) To: tim.gore; +Cc: daniel.vetter, intel-gfx 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 > --- > tests/gem_mmap_offset_exhaustion.c | 4 ++++ > 1 file changed, 4 insertions(+) > > diff --git a/tests/gem_mmap_offset_exhaustion.c b/tests/gem_mmap_offset_exhaustion.c > index 914fe6e..016143d 100644 > --- a/tests/gem_mmap_offset_exhaustion.c > +++ b/tests/gem_mmap_offset_exhaustion.c > @@ -77,6 +77,10 @@ igt_simple_main > { > int fd, i; > > +#ifdef ANDROID > + igt_skip("Test not valid on Android\n"); > +#endif > + > igt_skip_on_simulation(); > > fd = drm_open_any(); > -- > 1.9.2 > -- Daniel Vetter Software Engineer, Intel Corporation +41 (0) 79 365 57 48 - http://blog.ffwll.ch ^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH] intel-gpu-tools: skip gem_mmap_offset_exhaustion on Android 2014-07-25 9:06 ` Daniel Vetter @ 2014-07-25 9:14 ` Gore, Tim 2014-07-25 9:39 ` Daniel Vetter 2014-07-25 9:17 ` Chris Wilson 1 sibling, 1 reply; 7+ messages in thread From: Gore, Tim @ 2014-07-25 9:14 UTC (permalink / raw) To: Daniel Vetter; +Cc: daniel.vetter@ffwll.ch, intel-gfx@lists.freedesktop.org > -----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? Tim > > --- > > tests/gem_mmap_offset_exhaustion.c | 4 ++++ > > 1 file changed, 4 insertions(+) > > > > diff --git a/tests/gem_mmap_offset_exhaustion.c > > b/tests/gem_mmap_offset_exhaustion.c > > index 914fe6e..016143d 100644 > > --- a/tests/gem_mmap_offset_exhaustion.c > > +++ b/tests/gem_mmap_offset_exhaustion.c > > @@ -77,6 +77,10 @@ igt_simple_main > > { > > int fd, i; > > > > +#ifdef ANDROID > > + igt_skip("Test not valid on Android\n"); #endif > > + > > igt_skip_on_simulation(); > > > > fd = drm_open_any(); > > -- > > 1.9.2 > > > > -- > Daniel Vetter > Software Engineer, Intel Corporation > +41 (0) 79 365 57 48 - http://blog.ffwll.ch ^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH] intel-gpu-tools: skip gem_mmap_offset_exhaustion on Android 2014-07-25 9:14 ` Gore, Tim @ 2014-07-25 9:39 ` Daniel Vetter 0 siblings, 0 replies; 7+ messages in thread From: Daniel Vetter @ 2014-07-25 9:39 UTC (permalink / raw) To: Gore, Tim; +Cc: daniel.vetter@ffwll.ch, intel-gfx@lists.freedesktop.org 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 ^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH] intel-gpu-tools: skip gem_mmap_offset_exhaustion on Android 2014-07-25 9:06 ` Daniel Vetter 2014-07-25 9:14 ` Gore, Tim @ 2014-07-25 9:17 ` Chris Wilson 2014-07-25 9:37 ` Daniel Vetter 1 sibling, 1 reply; 7+ messages in thread From: Chris Wilson @ 2014-07-25 9:17 UTC (permalink / raw) To: Daniel Vetter; +Cc: daniel.vetter, intel-gfx On Fri, Jul 25, 2014 at 11:06:38AM +0200, Daniel Vetter wrote: > 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. No, it's just the android lowmemkiller hates i915 by design. The two are more or less incompatible. -Chris -- Chris Wilson, Intel Open Source Technology Centre ^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH] intel-gpu-tools: skip gem_mmap_offset_exhaustion on Android 2014-07-25 9:17 ` Chris Wilson @ 2014-07-25 9:37 ` Daniel Vetter 2014-07-25 9:56 ` Tvrtko Ursulin 0 siblings, 1 reply; 7+ messages in thread From: Daniel Vetter @ 2014-07-25 9:37 UTC (permalink / raw) To: Chris Wilson, Daniel Vetter, tim.gore, daniel.vetter, intel-gfx On Fri, Jul 25, 2014 at 10:17:26AM +0100, Chris Wilson wrote: > On Fri, Jul 25, 2014 at 11:06:38AM +0200, Daniel Vetter wrote: > > 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. > > No, it's just the android lowmemkiller hates i915 by design. The two are > more or less incompatible. Well someone should fix up the lowmemkiller then. Disabling the test is not really fixing it. -Daniel -- Daniel Vetter Software Engineer, Intel Corporation +41 (0) 79 365 57 48 - http://blog.ffwll.ch ^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH] intel-gpu-tools: skip gem_mmap_offset_exhaustion on Android 2014-07-25 9:37 ` Daniel Vetter @ 2014-07-25 9:56 ` Tvrtko Ursulin 0 siblings, 0 replies; 7+ messages in thread From: Tvrtko Ursulin @ 2014-07-25 9:56 UTC (permalink / raw) To: Daniel Vetter, Chris Wilson, tim.gore, daniel.vetter, intel-gfx On 07/25/2014 10:37 AM, Daniel Vetter wrote: > On Fri, Jul 25, 2014 at 10:17:26AM +0100, Chris Wilson wrote: >> On Fri, Jul 25, 2014 at 11:06:38AM +0200, Daniel Vetter wrote: >>> 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. >> >> No, it's just the android lowmemkiller hates i915 by design. The two are >> more or less incompatible. > > Well someone should fix up the lowmemkiller then. Disabling the test is > not really fixing it. AFAIR lowmemorykiller is a weird thing which tries to prevent pagecache dropping below a configurable threshold by killing processes. If free pages are below a threshold _and_ page cache is below the same threshold it will try to kill something. I suppose this is to prevent kernel in purging the page cache on its own. Interactions must be quite complex here given that thresholds (in num pages) and oom scores triggers per each threshold are multiple and configurable. I was just disabling it when running IGT (echo 0 >/sys/module/lowmemorykiller/parameters/minfree). It is probably debatable whether this is OK or not, depending how you look at IGT in the overall pool of testing. Tvrtko ^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2014-07-25 9:56 UTC | newest] Thread overview: 7+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- 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 2014-07-25 9:17 ` Chris Wilson 2014-07-25 9:37 ` Daniel Vetter 2014-07-25 9:56 ` Tvrtko Ursulin
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox