All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jan Stancek <jstancek@redhat.com>
To: ltp@lists.linux.it, liwan@redhat.com
Subject: [LTP] [PATCH] hugeshmat04: don't attach at specific address
Date: Tue, 21 Sep 2021 18:45:54 +0200	[thread overview]
Message-ID: <8b4c1fad2914aee00c8a160d1f9e482574b8e5ae.1632242721.git.jstancek@redhat.com> (raw)

The test intermittently fails on ppc64le, when heap
happens to overlap with segment that the test is trying
to attach at 1GB boundary.

Let the kernel find suitable address.

Signed-off-by: Jan Stancek <jstancek@redhat.com>
---
 testcases/kernel/mem/hugetlb/hugeshmat/hugeshmat04.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/testcases/kernel/mem/hugetlb/hugeshmat/hugeshmat04.c b/testcases/kernel/mem/hugetlb/hugeshmat/hugeshmat04.c
index e9bb9fbf7b4b..75f61de066d7 100644
--- a/testcases/kernel/mem/hugetlb/hugeshmat/hugeshmat04.c
+++ b/testcases/kernel/mem/hugetlb/hugeshmat/hugeshmat04.c
@@ -22,7 +22,6 @@
 #include "hugetlb.h"
 
 #define SIZE	(1024 * 1024 * 1024)
-#define BOUNDARY (1024 * 1024 * 1024)
 
 static long huge_free;
 static long huge_free2;
@@ -54,7 +53,7 @@ static void shared_hugepage(void)
 	if (shmid < 0)
 		tst_brk(TBROK | TERRNO, "shmget");
 
-	buf = shmat(shmid, (void *)BOUNDARY, SHM_RND | 0777);
+	buf = shmat(shmid, NULL, 0777);
 	if (buf == (void *)-1) {
 		shmctl(shmid, IPC_RMID, NULL);
 		tst_brk(TBROK | TERRNO, "shmat");
-- 
2.27.0


-- 
Mailing list info: https://lists.linux.it/listinfo/ltp

             reply	other threads:[~2021-09-21 16:46 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-09-21 16:45 Jan Stancek [this message]
2021-09-22  6:34 ` [LTP] [PATCH] hugeshmat04: don't attach at specific address Li Wang
2021-09-22 14:29   ` Cyril Hrubis
2021-09-23  6:49     ` Li Wang
2021-09-23  8:50 ` [LTP] [PATCH v2] hugeshmat04: try to find unmapped range for test Jan Stancek
2021-09-23  9:04   ` Li Wang
2021-09-23  9:07   ` Cyril Hrubis
2021-09-24  3:15     ` Li Wang

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=8b4c1fad2914aee00c8a160d1f9e482574b8e5ae.1632242721.git.jstancek@redhat.com \
    --to=jstancek@redhat.com \
    --cc=liwan@redhat.com \
    --cc=ltp@lists.linux.it \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.