[Intel-gfx] [PATCH i-g-t 1/2] lib/igt_core.c: Add new parameter to prevent disabling LMK

Piotr Luc piotr.luc at intel.com
Tue Mar 22 17:26:47 UTC 2016


From: Piotr Luc <Piotr.Luc at intel.com>

The 'keep-lmk-working' parameter added to prevent disabling the
Low Memory Killer.

Signed-off-by: Piotr Luc <Piotr.Luc at intel.com>
---
 lib/igt_core.c | 15 +++++++++++++--
 1 file changed, 13 insertions(+), 2 deletions(-)

diff --git a/lib/igt_core.c b/lib/igt_core.c
index 1f9be7d..734457a 100644
--- a/lib/igt_core.c
+++ b/lib/igt_core.c
@@ -228,6 +228,7 @@
 
 static unsigned int exit_handler_count;
 const char *igt_interactive_debug;
+static bool igt_disable_memory_killer = true;
 
 /* subtests helpers */
 static bool list_subtests = false;
@@ -257,6 +258,7 @@ enum {
  OPT_DESCRIPTION,
  OPT_DEBUG,
  OPT_INTERACTIVE_DEBUG,
+ OPT_KEEP_LOW_MEM_KILLER_WORKING,
  OPT_HELP = 'h'
 };
 
@@ -514,7 +516,9 @@ bool igt_exit_called;
 static void common_exit_handler(int sig)
 {
 	if (!igt_only_list_subtests()) {
-		low_mem_killer_disable(false);
+		if (igt_disable_memory_killer) {
+			low_mem_killer_disable(false);
+		}
 	}
 
 	/* When not killed by a signal check that igt_exit() has been properly
@@ -551,6 +555,7 @@ static void print_usage(const char *help_str, bool output_on_stderr)
 		   "  --run-subtest <pattern>\n"
 		   "  --debug[=log-domain]\n"
 		   "  --interactive-debug[=domain]\n"
+		   "  --keep-lmk-working\n"
 		   "  --help-description\n"
 		   "  --help\n");
 	if (help_str)
@@ -584,6 +589,7 @@ static int common_init(int *argc, char **argv,
 		{"help-description", 0, 0, OPT_DESCRIPTION},
 		{"debug", optional_argument, 0, OPT_DEBUG},
 		{"interactive-debug", optional_argument, 0, OPT_INTERACTIVE_DEBUG},
+		{"keep-lmk-working", optional_argument, 0, OPT_KEEP_LOW_MEM_KILLER_WORKING},
 		{"help", 0, 0, OPT_HELP},
 		{0, 0, 0, 0}
 	};
@@ -699,6 +705,9 @@ static int common_init(int *argc, char **argv,
 			print_test_description();
 			ret = -1;
 			goto out;
+		case OPT_KEEP_LOW_MEM_KILLER_WORKING:
+			igt_disable_memory_killer = false;
+			break;
 		case OPT_HELP:
 			print_usage(help_str, false);
 			ret = -1;
@@ -738,7 +747,9 @@ out:
 		print_version();
 
 		oom_adjust_for_doom();
-		low_mem_killer_disable(true);
+		if (igt_disable_memory_killer) {
+			low_mem_killer_disable(true);
+		}
 	}
 
 	/* install exit handler, to ensure we clean up */
-- 
2.5.0



More information about the Intel-gfx mailing list