lib/igt_core.c : only disable low mem killer once
PATCH 1/1 lib/igt_core.c : only disable low mem killer once
From: Tim Gore <[email protected]>
The call to low_mem_killer_disable(true) was being done from within function oom_adjust_for_doom. However, oom_adjust_for_doom gets called from 3 places. We only want the call to low_mem_killer_disable(true) to happen during common_init, so call it from here instead of from oom_adjust_for_doom.
--- lib/igt_core.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
lib/igt_core.c +1 -1
@@ -490,7 +490,6 @@ static void oom_adjust_for_doom(void)igt_assert (write (fd, always_kill,sizeof (always_kill)) ==sizeof (always_kill));close (fd); -low_mem_killer_disable (true); } static int common_init(int *argc, char **argv,
@@ -653,6 +652,7 @@ out:print_version ();oom_adjust_for_doom (); +low_mem_killer_disable (true); }/* install exit handler, to ensure we clean up */
Signature · 6 lines
2.3.0 _______________________________________________ Intel-gfx mailing list [email protected] http://lists.freedesktop.org/mailman/listinfo/intel-gfx
Quoted 8 lines · On 24 April 2015 at 14:43, <[email protected]> wrote:
From: Tim Gore <[email protected]>
The call to
low_mem_killer_disable(true)was being done from within functionoom_adjust_for_doom. However,oom_adjust_for_doomgets called from 3 places. We only want the call tolow_mem_killer_disable(true)to happen duringcommon_init, so call it from here instead of fromoom_adjust_for_doom.
I guess the reason you only want to call it once is because otherwise restoring the previous values won't work?
I think low_mem_killer_disable needs some more protection against being called unexpectedly. At the moment, it is always called from common_exit_handler to restore the previous values, but when listing subtests the initial call to low_mem_killer_disable is skipped, which means the uninitialised value of prev_adj_scores will be written to the sysfs file.
Quoted 27 lines
Signed-off-by Tim Gore <[email protected]>--- lib/igt_core.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)lib/igt_core.c +1
-2@@ -490,7 +490,6 @@ static void oom_adjust_for_doom(void)igt_assert (write (fd, always_kill,sizeof (always_kill)) ==sizeof (always_kill));close (fd); -low_mem_killer_disable (true); } static int common_init(int *argc, char **argv,@@ -653,6 +652,7 @@ out:print_version ();oom_adjust_for_doom (); +low_mem_killer_disable (true); }/* install exit handler, to ensure we clean up */ --
Quoted 2 lines
2.3.0
_______________________________________________
Intel-gfx mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/intel-gfx