All of lore.kernel.org
 help / color / mirror / Atom feed
* [LTP] [PATCH 1/1] swapping01: make test more robust
@ 2021-01-15 14:32 Alexander Egorenkov
  2021-01-18 10:50 ` Li Wang
  2021-01-18 12:57 ` Li Wang
  0 siblings, 2 replies; 14+ messages in thread
From: Alexander Egorenkov @ 2021-01-15 14:32 UTC (permalink / raw)
  To: ltp

Increase time waiting for swap memory to settle before
performing checks with occupied swap memory. This decreases the chance
of the test to fail in the case of the swap memory taking longer
than expected to settle.

This fixes sporadic failures observed on IBM s390x systems such as this:

swapping01.c:149: TPASS: no heavy swapping detected, 4534 MB swapped.
swapping01.c:106: TINFO: available physical memory: 7348 MB
swapping01.c:109: TINFO: try to allocate: 9552 MB
swapping01.c:112: TINFO: memory allocated: 9552 MB
swapping01.c:140: TINFO: swap free init: 25019 MB
swapping01.c:141: TINFO: swap free now: 20484 MB
swapping01.c:149: TPASS: no heavy swapping detected, 4534 MB swapped.
swapping01.c:106: TINFO: available physical memory: 7348 MB
swapping01.c:109: TINFO: try to allocate: 9553 MB
swapping01.c:112: TINFO: memory allocated: 9553 MB
swapping01.c:140: TINFO: swap free init: 25018 MB
swapping01.c:141: TINFO: swap free now: 17694 MB
swapping01.c:149: TPASS: no heavy swapping detected, 7323 MB swapped.
swapping01.c:106: TINFO: available physical memory: 7318 MB
swapping01.c:109: TINFO: try to allocate: 9514 MB
swapping01.c:112: TINFO: memory allocated: 9514 MB
swapping01.c:140: TINFO: swap free init: 25019 MB
swapping01.c:141: TINFO: swap free now: 17697 MB
swapping01.c:145: TFAIL: heavy swapping detected: 7322 MB swapped.

Signed-off-by: Alexander Egorenkov <egorenar@linux.ibm.com>
---
 testcases/kernel/mem/swapping/swapping01.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/testcases/kernel/mem/swapping/swapping01.c b/testcases/kernel/mem/swapping/swapping01.c
index 24b8313f3..befb52e91 100644
--- a/testcases/kernel/mem/swapping/swapping01.c
+++ b/testcases/kernel/mem/swapping/swapping01.c
@@ -127,10 +127,10 @@ static void check_swapping(void)
 
 	/* Still occupying memory, loop for a while */
 	i = 0;
-	while (i < 10) {
+	while (i < 30) {
 		swap_free_now = SAFE_READ_MEMINFO("SwapFree:");
 		sleep(1);
-		if (labs(swap_free_now - SAFE_READ_MEMINFO("SwapFree:")) < 512)
+		if (labs(swap_free_now - SAFE_READ_MEMINFO("SwapFree:")) < 10)
 			break;
 
 		i++;
-- 
2.26.2


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

end of thread, other threads:[~2021-01-24  4:32 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-01-15 14:32 [LTP] [PATCH 1/1] swapping01: make test more robust Alexander Egorenkov
2021-01-18 10:50 ` Li Wang
2021-01-18 12:57 ` Li Wang
2021-01-18 14:04   ` Alexander Egorenkov
2021-01-20  7:25   ` Alexander Egorenkov
2021-01-20 12:46     ` Petr Vorel
2021-01-21  9:44       ` Li Wang
2021-01-22  6:40         ` Li Wang
2021-01-22  7:41           ` Petr Vorel
2021-01-22  7:56           ` Alexander Egorenkov
2021-01-24  4:32             ` Li Wang
2021-01-22  7:16       ` Alexander Egorenkov
2021-01-22  7:36         ` Petr Vorel
2021-01-21  9:30     ` Li Wang

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.