Skip to contentSkip to conversation

min_free_kbytes: Check panic_on_oom in advance

PATCH Superseded [email protected] 2 participants 3 messages Mar 3, 2017 – Mar 5, 2017

v2 of 3 Superseded Latest is v3 →

lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 min_free_kbytes: Check panic_on_oom in advance

From: Hoang Nguyen <[email protected]>

Testcase usually trigger reset if panic_on_oom is enabled by default. Add panic_on_oom checking before running.

---
 testcases/kernel/mem/tunable/min_free_kbytes.c | 5 +++++
 1 file changed, 5 insertions(+)
testcases/kernel/mem/tunable/min_free_kbytes.c +5 -0
index cb00f40..1f6fc8f 100644
@@ -239,6 +239,11 @@ static void sighandler(int signo LTP_ATTRIBUTE_UNUSED)
 void setup(void)
 {
 	tst_require_root();
+    if (get_sys_tune("panic_on_oom")) {
+        tst_brkm(TCONF, NULL,
+            "panic_on_oom is set, disable it to run these testcases");
+    }
+
 	tst_sig(FORK, DEF_HANDLER, cleanup);
 	TEST_PAUSE;
 
Signature · 1 line
2.7.4
#1 lore raw

PATCH v2 1/1 min_free_kbytes: Check panic_on_oom in advance

Hi!

Quoted 10 lines
---
 testcases/kernel/mem/tunable/min_free_kbytes.c | 5 +++++
 1 file changed, 5 insertions(+)
testcases/kernel/mem/tunable/min_free_kbytes.c +0 -0
index cb00f40..1f6fc8f 100644

testcases/kernel/mem/tunable/min_free_kbytes.c static void sighandler(int signo LTP_ATTRIBUTE_UNUSED) · line 245

Quoted 7 lines
testcases/kernel/mem/tunable/min_free_kbytes.c +4 -0
@@ -239,6 +239,11 @@ static void sighandler(int signo LTP_ATTRIBUTE_UNUSED)
 void setup(void)
 {
 	tst_require_root();
+    if (get_sys_tune("panic_on_oom")) {
+        tst_brkm(TCONF, NULL,
+            "panic_on_oom is set, disable it to run these testcases");
+    }

Now the indentation is wrong, please make sure to use tabs. FYI you can use checkpatch.pl from kernel git repo to check patches before sending them for review.

Signature · 2 lines
Cyril Hrubis
[email protected]
#2 lore raw

PATCH v2 1/1 min_free_kbytes: Check panic_on_oom in advance

Hi Cyril,
Thanks. I'll fix it in new patch.
Best regards,
Hoang

From: Cyril Hrubis <[email protected]>
To: [email protected]
Cc: [email protected]
Sent: Friday, 3 March 2017, 16:45
Subject: Re: [LTP] [PATCH v2] min_free_kbytes: Check panic_on_oom in advance

Hi!

Quoted 10 lines

---
  testcases/kernel/mem/tunable/min_free_kbytes.c | 5 +++++

  1 file changed, 5 insertions(+)
testcases/kernel/mem/tunable/min_free_kbytes.c +0 -0
index cb00f40..1f6fc8f 100644

testcases/kernel/mem/tunable/min_free_kbytes.c static void sighandler(int signo LTP_ATTRIBUTE_UNUSED) · line 245

Quoted 7 lines
testcases/kernel/mem/tunable/min_free_kbytes.c +4 -0
@@ -239,6 +239,11 @@ static void sighandler(int signo LTP_ATTRIBUTE_UNUSED)
   void setup(void)
   {
       tst_require_root();
+    if (get_sys_tune("panic_on_oom")) {
+        tst_brkm(TCONF, NULL,
+            "panic_on_oom is set, disable it to run these testcases");
+    }

Now the indentation is wrong, please make sure to use tabs. FYI you can use checkpatch.pl from kernel git repo to check patches before sending them for review.

Signature · 8 lines
Cyril Hrubis
[email protected]


   
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.linux.it/pipermail/ltp/attachments/20170305/ffe7e7bf/attachment.html>