From: Mike Kravetz <mike.kravetz@oracle.com>
To: Mina Almasry <almasrymina@google.com>
Cc: Andrew Morton <akpm@linux-foundation.org>,
linux-mm@kvack.org, linux-kernel@vger.kernel.org,
Ken Chen <kenchen@google.com>,
Chris Kennelly <ckennelly@google.com>,
Michal Hocko <mhocko@suse.com>, Vlastimil Babka <vbabka@suse.cz>,
Kirill Shutemov <kirill@shutemov.name>
Subject: Re: [PATCH v7 2/2] mm, hugepages: Add hugetlb vma mremap() test
Date: Wed, 13 Oct 2021 17:20:57 -0700 [thread overview]
Message-ID: <2ad01712-1a2d-76dc-a2ef-2fc4650c74cf@oracle.com> (raw)
In-Reply-To: <20211013195825.3058275-2-almasrymina@google.com>
On 10/13/21 12:58 PM, Mina Almasry wrote:
> Signed-off-by: Mina Almasry <almasrymina@google.com>
Thanks for adding the test!
Acked-by: Mike Kravetz <mike.kravetz@oracle.com>
How about adding this to the run_vmtests.sh script with something
like the following:
diff --git a/tools/testing/selftests/vm/hugepage-mremap.c b/tools/testing/selftests/vm/hugepage-mremap.c
index e84b79922fe6..c7ffbc848542 100644
--- a/tools/testing/selftests/vm/hugepage-mremap.c
+++ b/tools/testing/selftests/vm/hugepage-mremap.c
@@ -3,12 +3,8 @@
* hugepage-mremap:
*
* Example of remapping huge page memory in a user application using the
- * mremap system call. Before running this application, make sure that the
- * administrator has mounted the hugetlbfs filesystem (on some directory
- * like /mnt) using the command mount -t hugetlbfs nodev /mnt. In this
- * example, the app is requesting memory of size 10MB that is backed by
- * huge pages.
- *
+ * mremap system call. Code assumes a hugetlbfs filesystem is mounted
+ * at './huge'. The code will use 10MB worth of huge pages.
*/
#define _GNU_SOURCE
@@ -109,7 +105,7 @@ int main(void)
{
int ret = 0;
- int fd = open("/mnt/huge/test", O_CREAT | O_RDWR, 0755);
+ int fd = open("huge/test", O_CREAT | O_RDWR, 0755);
if (fd < 0) {
perror("Open failed");
diff --git a/tools/testing/selftests/vm/run_vmtests.sh b/tools/testing/selftests/vm/run_vmtests.sh
index 45e803af7c77..a24d30af3094 100755
--- a/tools/testing/selftests/vm/run_vmtests.sh
+++ b/tools/testing/selftests/vm/run_vmtests.sh
@@ -108,6 +108,17 @@ else
echo "[PASS]"
fi
+echo "-----------------------"
+echo "running hugepage-mremap"
+echo "-----------------------"
+./hugepage-mremap
+if [ $? -ne 0 ]; then
+ echo "[FAIL]"
+ exitcode=1
+else
+ echo "[PASS]"
+fi
+
echo "NOTE: The above hugetlb tests provide minimal coverage. Use"
echo " https://github.com/libhugetlbfs/libhugetlbfs.git for"
echo " hugetlb regression testing."
next prev parent reply other threads:[~2021-10-14 0:21 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-10-13 19:58 [PATCH v7 1/2] mm, hugepages: add mremap() support for hugepage backed vma Mina Almasry
2021-10-13 19:58 ` [PATCH v7 2/2] mm, hugepages: Add hugetlb vma mremap() test Mina Almasry
2021-10-14 0:20 ` Mike Kravetz [this message]
2021-10-14 20:06 ` Mina Almasry
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=2ad01712-1a2d-76dc-a2ef-2fc4650c74cf@oracle.com \
--to=mike.kravetz@oracle.com \
--cc=akpm@linux-foundation.org \
--cc=almasrymina@google.com \
--cc=ckennelly@google.com \
--cc=kenchen@google.com \
--cc=kirill@shutemov.name \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=mhocko@suse.com \
--cc=vbabka@suse.cz \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox