public inbox for ltp@lists.linux.it
 help / color / mirror / Atom feed
* [LTP] [PATCH] max_map_count: use default overcommit mode
@ 2020-01-24 14:58 Jan Stancek
  2020-01-28 13:54 ` Cyril Hrubis
  0 siblings, 1 reply; 3+ messages in thread
From: Jan Stancek @ 2020-01-24 14:58 UTC (permalink / raw)
  To: ltp

max_map_count has been observed to sporadically fail on some
architectures, for example ppc64le (64k pages, ~3GB RAM).

Even though we don't touch all the mappings, the test is configuring
NO_OVERCOMMIT policy, which makes __vm_enough_memory() more strict
and we sporadically fail on a percpu counter, when we come close
to global CommitLimit:
        if (percpu_counter_read_positive(&vm_committed_as) < allowed)
                return 0;

Per comments from 2012 the main reason for this was bad OOM behaviour.
Let's go back to default overcommit mode. If we run into issues with
OOM again, we can lower the number of mappings to have larger reserve.

Signed-off-by: Jan Stancek <jstancek@redhat.com>
---
 testcases/kernel/mem/tunable/max_map_count.c | 9 ++-------
 1 file changed, 2 insertions(+), 7 deletions(-)

diff --git a/testcases/kernel/mem/tunable/max_map_count.c b/testcases/kernel/mem/tunable/max_map_count.c
index 5b03a60ec860..aa70fde59c77 100644
--- a/testcases/kernel/mem/tunable/max_map_count.c
+++ b/testcases/kernel/mem/tunable/max_map_count.c
@@ -65,7 +65,7 @@ static void setup(void)
 
 	old_max_map_count = get_sys_tune("max_map_count");
 	old_overcommit = get_sys_tune("overcommit_memory");
-	set_sys_tune("overcommit_memory", 2, 1);
+	set_sys_tune("overcommit_memory", 0, 1);
 
 	if (uname(&un) != 0)
 		tst_brk(TBROK | TERRNO, "uname error");
@@ -154,13 +154,8 @@ static void max_map_count_test(void)
 	 * 1) use a safe maximum max_map_count value as upper-bound,
 	 *    we set it 65536 in this case, i.e., we don't test too big
 	 *    value;
-	 * 2) make sure total mapping isn't larger tha
+	 * 2) make sure total mapping isn't larger than
 	 *        CommitLimit - Committed_AS
-	 *    and set overcommit_memory to 2, this could help mapping
-	 *    returns ENOMEM instead of triggering oom-killer when
-	 *    memory is tight. (When there are enough free memory,
-	 *    step 1) will be used first.
-	 * Hope OOM-killer can be more stable oneday.
 	 */
 	memfree = SAFE_READ_MEMINFO("CommitLimit:") - SAFE_READ_MEMINFO("Committed_AS:");
 	/* 64 used as a bias to make sure no overflow happen */
-- 
2.18.1


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* [LTP] [PATCH] max_map_count: use default overcommit mode
  2020-01-24 14:58 [LTP] [PATCH] max_map_count: use default overcommit mode Jan Stancek
@ 2020-01-28 13:54 ` Cyril Hrubis
  2020-01-29  9:05   ` Jan Stancek
  0 siblings, 1 reply; 3+ messages in thread
From: Cyril Hrubis @ 2020-01-28 13:54 UTC (permalink / raw)
  To: ltp

Hi!
Sounds reasonable to me, acked.

-- 
Cyril Hrubis
chrubis@suse.cz

^ permalink raw reply	[flat|nested] 3+ messages in thread

* [LTP] [PATCH] max_map_count: use default overcommit mode
  2020-01-28 13:54 ` Cyril Hrubis
@ 2020-01-29  9:05   ` Jan Stancek
  0 siblings, 0 replies; 3+ messages in thread
From: Jan Stancek @ 2020-01-29  9:05 UTC (permalink / raw)
  To: ltp


----- Original Message -----
> Hi!
> Sounds reasonable to me, acked.

Pushed.


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2020-01-29  9:05 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-01-24 14:58 [LTP] [PATCH] max_map_count: use default overcommit mode Jan Stancek
2020-01-28 13:54 ` Cyril Hrubis
2020-01-29  9:05   ` Jan Stancek

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox