intel-gpu-tools: skip gem_mmap_offset_exhaustion on Android
PATCH 1/1 intel-gpu-tools: skip gem_mmap_offset_exhaustion on Android
From: Tim Gore <[email protected]>
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.
--- tests/gem_mmap_offset_exhaustion.c | 4 ++++ 1 file changed, 4 insertions(+)
tests/gem_mmap_offset_exhaustion.c +4 -0
@@ -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 ();
Signature · 1 line
1.9.2
Quoted 10 lines · On Fri, Jul 25, 2014 at 10:00:19AM +0100, [email protected] wrote:
From: Tim Gore <[email protected]>
gem_mmap_offset_exhaustionrelies 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 <[email protected]>
/* 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
Quoted 22 lines
--- tests/gem_mmap_offset_exhaustion.c | 4 ++++ 1 file changed, 4 insertions(+)tests/gem_mmap_offset_exhaustion.c +4
-0@@ -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 ();Signature · 1 line
1.9.2
Signature · 3 lines
Daniel Vetter Software Engineer, Intel Corporation +41 (0) 79 365 57 48 - http://blog.ffwll.ch
Quoted 24 lines
-----Original Message-----
From: Daniel Vetter [mailto:[email protected]] On Behalf Of Daniel Vetter
Sent: Friday, July 25, 2014 10:07 AM
To: Gore, Tim
Cc: [email protected]; [email protected]
Subject: Re: [PATCH] intel-gpu-tools: skipgem_mmap_offset_exhaustionon AndroidQuoted 9 lines · On Fri, Jul 25, 2014 at 10:00:19AM +0100, [email protected] wrote:
From: Tim Gore <[email protected]>
gem_mmap_offset_exhaustionrelies 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 <[email protected]>
Quoted 9 lines
/* 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
Quoted 27 lines
Quoted 20 lines
--- tests/gem_mmap_offset_exhaustion.c | 4 ++++ 1 file changed, 4 insertions(+)tests/gem_mmap_offset_exhaustion.c +3
-1@@ -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 (); --Quoted 2 lines
1.9.2
--
Daniel Vetter
Software Engineer, Intel Corporation
+41 (0) 79 365 57 48 - http://blog.ffwll.ch
Quoted 29 lines · Tim
Quoted 29 lines
-----Original Message-----
From: Daniel Vetter [mailto:[email protected]] On Behalf Of Daniel Vetter
Sent: Friday, July 25, 2014 10:07 AM
To: Gore, Tim
Cc: [email protected]; [email protected]
Subject: Re: [PATCH] intel-gpu-tools: skipgem_mmap_offset_exhaustionon AndroidQuoted 9 lines · On Fri, Jul 25, 2014 at 10:00:19AM +0100, [email protected] wrote:
From: Tim Gore <[email protected]>
gem_mmap_offset_exhaustionrelies 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 <[email protected]>/* we happily leak objects to exhaust mmap offset space, the kernel will * reap backing storage. */ gem_madvise(fd, handle, I915_MADV_DONTNEED);
Quoted 8 lines
Quoted 4 lines
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.
-DanielWell, 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
Signature · 3 lines
Daniel Vetter Software Engineer, Intel Corporation +41 (0) 79 365 57 48 - http://blog.ffwll.ch
Quoted 14 lines · Daniel Vetter
Quoted 10 lines · On Fri, Jul 25, 2014 at 10:00:19AM +0100, [email protected] wrote:
From: Tim Gore <[email protected]>
gem_mmap_offset_exhaustionrelies 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 <[email protected]>
Quoted 6 lines
/* 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
Signature · 1 line
Chris Wilson, Intel Open Source Technology Centre
Quoted 19 lines · Chris Wilson
Quoted 18 lines · Daniel Vetter
Quoted 10 lines · On Fri, Jul 25, 2014 at 10:00:19AM +0100, [email protected] wrote:
From: Tim Gore <[email protected]>
gem_mmap_offset_exhaustionrelies 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 <[email protected]>/* we happily leak objects to exhaust mmap offset space, the kernel will * reap backing storage. */ gem_madvise(fd, handle, I915_MADV_DONTNEED);
Quoted 5 lines
Quoted 2 lines
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
Signature · 3 lines
Daniel Vetter Software Engineer, Intel Corporation +41 (0) 79 365 57 48 - http://blog.ffwll.ch
Quoted 20 lines · Daniel Vetter
Quoted 19 lines · Chris Wilson
Quoted 18 lines · Daniel Vetter
Quoted 10 lines · On Fri, Jul 25, 2014 at 10:00:19AM +0100, [email protected] wrote:
From: Tim Gore <[email protected]>
gem_mmap_offset_exhaustionrelies 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 <[email protected]>/* we happily leak objects to exhaust mmap offset space, the kernel will * reap backing storage. */ gem_madvise(fd, handle, I915_MADV_DONTNEED);
Quoted 8 lines
Quoted 5 lines
Quoted 2 lines
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