All of lore.kernel.org
 help / color / mirror / Atom feed
From: Gerald Schaefer <gerald.schaefer@linux.ibm.com>
To: Andrew Morton <akpm@linux-foundation.org>,
	Shuah Khan <shuah@kernel.org>,
	Muchun Song <songmuchun@bytedance.com>
Cc: linux-mm <linux-mm@kvack.org>,
	LKML <linux-kernel@vger.kernel.org>,
	<linux-kselftest@vger.kernel.org>,
	linux-s390 <linux-s390@vger.kernel.org>
Subject: [PATCH] selftests: vm: use 1 MB hugepage size for s390
Date: Tue, 25 Oct 2022 17:26:10 +0200	[thread overview]
Message-ID: <20221025152610.3439102-1-gerald.schaefer@linux.ibm.com> (raw)

hugepage-vmemmap test fails for s390 because it assumes a hugepagesize
of 2 MB, while we have 1 MB on s390. This results in iterating over two
hugepages. If they are consecutive in memory, check_page_flags() will
stumble over the additional head page. Otherwise, it will stumble over
non-huge pageflags, after crossing the first 1 MB hugepage.

Fix this by using 1 MB MAP_LENGTH for s390.

Signed-off-by: Gerald Schaefer <gerald.schaefer@linux.ibm.com>
---
 tools/testing/selftests/vm/hugepage-vmemmap.c | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/tools/testing/selftests/vm/hugepage-vmemmap.c b/tools/testing/selftests/vm/hugepage-vmemmap.c
index 557bdbd4f87e..a4695f138cec 100644
--- a/tools/testing/selftests/vm/hugepage-vmemmap.c
+++ b/tools/testing/selftests/vm/hugepage-vmemmap.c
@@ -11,7 +11,14 @@
 #include <sys/mman.h>
 #include <fcntl.h>
 
+/*
+ * 1 MB hugepage size for s390
+ */
+#if defined(__s390x__)
+#define MAP_LENGTH		(1UL * 1024 * 1024)
+#else
 #define MAP_LENGTH		(2UL * 1024 * 1024)
+#endif
 
 #ifndef MAP_HUGETLB
 #define MAP_HUGETLB		0x40000	/* arch specific */
-- 
2.34.1


             reply	other threads:[~2022-10-25 15:27 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-10-25 15:26 Gerald Schaefer [this message]
2022-10-25 15:34 ` [PATCH] selftests: vm: use 1 MB hugepage size for s390 David Hildenbrand
2022-10-26 12:44   ` Gerald Schaefer

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=20221025152610.3439102-1-gerald.schaefer@linux.ibm.com \
    --to=gerald.schaefer@linux.ibm.com \
    --cc=akpm@linux-foundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-kselftest@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=linux-s390@vger.kernel.org \
    --cc=shuah@kernel.org \
    --cc=songmuchun@bytedance.com \
    /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.