diff options
| author | He Zhe <zhe.he@windriver.com> | 2019-10-29 17:03:30 +0800 |
|---|---|---|
| committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2019-11-13 22:02:16 +0000 |
| commit | 9c38686e17261c39d0241958f11207dc6ab967db (patch) | |
| tree | ba5d921cb43aff447c7e21feb9c40d951f484e49 | |
| parent | 2a6773b376871a5954539123b0dad91375742638 (diff) | |
| download | poky-9c38686e17261c39d0241958f11207dc6ab967db.tar.gz | |
ltp: Fix overcommit_memory failure
Backport a patch from upstream to fix the following runtime failure.
mem.c:814: INFO: set overcommit_memory to 0
overcommit_memory.c:213: FAIL: alloc passed, expected to fail
(From OE-Core rev: 869f46863e218c2d18ae7b4c0b28775fa07ba8b8)
Signed-off-by: He Zhe <zhe.he@windriver.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Armin Kuster <akuster808@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
| -rw-r--r-- | meta/recipes-extended/ltp/ltp/0001-overcommit_memory-update-for-mm-fix-false-positive-O.patch | 57 | ||||
| -rw-r--r-- | meta/recipes-extended/ltp/ltp_20190517.bb | 1 |
2 files changed, 58 insertions, 0 deletions
diff --git a/meta/recipes-extended/ltp/ltp/0001-overcommit_memory-update-for-mm-fix-false-positive-O.patch b/meta/recipes-extended/ltp/ltp/0001-overcommit_memory-update-for-mm-fix-false-positive-O.patch new file mode 100644 index 0000000000..bed84712a1 --- /dev/null +++ b/meta/recipes-extended/ltp/ltp/0001-overcommit_memory-update-for-mm-fix-false-positive-O.patch | |||
| @@ -0,0 +1,57 @@ | |||
| 1 | From d656a447893dccc310c975a239f482278550c3e0 Mon Sep 17 00:00:00 2001 | ||
| 2 | From: Jan Stancek <jstancek@redhat.com> | ||
| 3 | Date: Tue, 21 May 2019 10:10:44 +0200 | ||
| 4 | Subject: [PATCH] overcommit_memory: update for "mm: fix false-positive | ||
| 5 | OVERCOMMIT_GUESS failures" | ||
| 6 | |||
| 7 | commit 8c7829b04c52 ("mm: fix false-positive OVERCOMMIT_GUESS failures") | ||
| 8 | changes logic of __vm_enough_memory(), simplifying it to: | ||
| 9 | When in GUESS mode, catch wild allocations by comparing their request | ||
| 10 | size to total amount of ram and swap in the system. | ||
| 11 | |||
| 12 | Testcase currently allocates mem_total + swap_total, which doesn't trigger | ||
| 13 | new condition. Make it more extreme, but assuming free_total / 2 will PASS, | ||
| 14 | and 2*sum_total will FAIL. | ||
| 15 | |||
| 16 | Signed-off-by: Jan Stancek <jstancek@redhat.com> | ||
| 17 | Acked-by: Cyril Hrubis <chrubis@suse.cz> | ||
| 18 | |||
| 19 | Upstream-Status: Backport [https://github.com/linux-test-project/ltp/commit/d656a447893dccc310c975a239f482278550c3e0] | ||
| 20 | Signed-off-by: He Zhe <zhe.he@windriver.com> | ||
| 21 | --- | ||
| 22 | testcases/kernel/mem/tunable/overcommit_memory.c | 11 ++++------- | ||
| 23 | 1 file changed, 4 insertions(+), 7 deletions(-) | ||
| 24 | |||
| 25 | diff --git a/testcases/kernel/mem/tunable/overcommit_memory.c b/testcases/kernel/mem/tunable/overcommit_memory.c | ||
| 26 | index 555298f..345764d 100644 | ||
| 27 | --- a/testcases/kernel/mem/tunable/overcommit_memory.c | ||
| 28 | +++ b/testcases/kernel/mem/tunable/overcommit_memory.c | ||
| 29 | @@ -36,11 +36,10 @@ | ||
| 30 | * | ||
| 31 | * The program is designed to test the two tunables: | ||
| 32 | * | ||
| 33 | - * When overcommit_memory = 0, allocatable memory can't overextends | ||
| 34 | - * the amount of free memory. I choose the three cases: | ||
| 35 | + * When overcommit_memory = 0, allocatable memory can't overextend | ||
| 36 | + * the amount of total memory: | ||
| 37 | * a. less than free_total: free_total / 2, alloc should pass. | ||
| 38 | - * b. greater than free_total: free_total * 2, alloc should fail. | ||
| 39 | - * c. equal to sum_total: sum_tatal, alloc should fail | ||
| 40 | + * b. greater than sum_total: sum_total * 2, alloc should fail. | ||
| 41 | * | ||
| 42 | * When overcommit_memory = 1, it can alloc enough much memory, I | ||
| 43 | * choose the three cases: | ||
| 44 | @@ -164,9 +163,7 @@ static void overcommit_memory_test(void) | ||
| 45 | |||
| 46 | update_mem(); | ||
| 47 | alloc_and_check(free_total / 2, EXPECT_PASS); | ||
| 48 | - update_mem(); | ||
| 49 | - alloc_and_check(free_total * 2, EXPECT_FAIL); | ||
| 50 | - alloc_and_check(sum_total, EXPECT_FAIL); | ||
| 51 | + alloc_and_check(sum_total * 2, EXPECT_FAIL); | ||
| 52 | |||
| 53 | /* start to test overcommit_memory=1 */ | ||
| 54 | set_sys_tune("overcommit_memory", 1, 1); | ||
| 55 | -- | ||
| 56 | 2.7.4 | ||
| 57 | |||
diff --git a/meta/recipes-extended/ltp/ltp_20190517.bb b/meta/recipes-extended/ltp/ltp_20190517.bb index 4650715607..5915b1c72a 100644 --- a/meta/recipes-extended/ltp/ltp_20190517.bb +++ b/meta/recipes-extended/ltp/ltp_20190517.bb | |||
| @@ -49,6 +49,7 @@ SRC_URI = "git://github.com/linux-test-project/ltp.git \ | |||
| 49 | file://0001-testcases-use-python3-everywhere-to-run-python-scrip.patch \ | 49 | file://0001-testcases-use-python3-everywhere-to-run-python-scrip.patch \ |
| 50 | file://0001-syscall-rt_sigtimedwait01-Fix-wrong-sigset-length-fo.patch \ | 50 | file://0001-syscall-rt_sigtimedwait01-Fix-wrong-sigset-length-fo.patch \ |
| 51 | file://0001-cve-2017-17052-Avoid-unsafe-exits-in-threads.patch \ | 51 | file://0001-cve-2017-17052-Avoid-unsafe-exits-in-threads.patch \ |
| 52 | file://0001-overcommit_memory-update-for-mm-fix-false-positive-O.patch \ | ||
| 52 | " | 53 | " |
| 53 | 54 | ||
| 54 | S = "${WORKDIR}/git" | 55 | S = "${WORKDIR}/git" |
