From: "David Hildenbrand (Arm)" <david@kernel.org>
To: Anthony Yznaga <anthony.yznaga@oracle.com>,
linux-mm@kvack.org, linux-kernel@vger.kernel.org,
linux-kselftest@vger.kernel.org
Cc: akpm@linux-foundation.org, ljs@kernel.org,
Liam.Howlett@oracle.com, vbabka@kernel.org, rppt@kernel.org,
surenb@google.com, mhocko@suse.com, jannh@google.com,
pfalcato@suse.de, Jason@zx2c4.com, shuah@kernel.org
Subject: Re: [PATCH v4 3/3] selftests/mm: run the MAP_DROPPABLE selftest
Date: Thu, 16 Apr 2026 10:39:52 +0200 [thread overview]
Message-ID: <a88aaf79-ad64-4529-a86e-b94fc8fa9b27@kernel.org> (raw)
In-Reply-To: <20260416033939.49981-4-anthony.yznaga@oracle.com>
On 4/16/26 05:39, Anthony Yznaga wrote:
> The test was not being run by the selftest framework so it was never
> noticed that it would fail with an assertion failure on configs without
> support for MAP_DROPPABLE. Update the test so that it is skipped instead
> when MAP_DROPPABLE is not supported, and add it to the mmap category so
> that the test is run by the framework.
>
> Signed-off-by: Anthony Yznaga <anthony.yznaga@oracle.com>
> ---
> tools/testing/selftests/mm/droppable.c | 9 ++++++++-
> tools/testing/selftests/mm/run_vmtests.sh | 1 +
> 2 files changed, 9 insertions(+), 1 deletion(-)
>
> diff --git a/tools/testing/selftests/mm/droppable.c b/tools/testing/selftests/mm/droppable.c
> index 44940f75c461..30c8be37fcb9 100644
> --- a/tools/testing/selftests/mm/droppable.c
> +++ b/tools/testing/selftests/mm/droppable.c
> @@ -26,7 +26,14 @@ int main(int argc, char *argv[])
> ksft_set_plan(1);
>
> alloc = mmap(0, alloc_size, PROT_READ | PROT_WRITE, MAP_ANONYMOUS | MAP_DROPPABLE, -1, 0);
> - assert(alloc != MAP_FAILED);
> + if (alloc == MAP_FAILED) {
> + if ((errno == EOPNOTSUPP) || (errno == EINVAL)) {
> + ksft_test_result_skip("MAP_DROPPABLE not supported\n");
> + exit(KSFT_SKIP);
> + }
> + ksft_test_result_fail("mmap error: %s\n", strerror(errno));
> + exit(KSFT_FAIL);
> + }
> memset(alloc, 'A', alloc_size);
> for (size_t i = 0; i < alloc_size; i += page_size)
> assert(*(uint8_t *)(alloc + i));
> diff --git a/tools/testing/selftests/mm/run_vmtests.sh b/tools/testing/selftests/mm/run_vmtests.sh
> index d8468451b3a3..e1e355d50e65 100755
> --- a/tools/testing/selftests/mm/run_vmtests.sh
> +++ b/tools/testing/selftests/mm/run_vmtests.sh
> @@ -382,6 +382,7 @@ else
> fi
>
> CATEGORY="mmap" run_test ./map_populate
> +CATEGORY="mmap" run_test ./droppable
>
> CATEGORY="mlock" run_test ./mlock-random-test
>
On my older kernel:
$ ./droppable
TAP version 13
1..1
ok 1 # SKIP MAP_DROPPABLE not supported
Acked-by: David Hildenbrand (Arm) <david@kernel.org>
--
Cheers,
David
prev parent reply other threads:[~2026-04-16 8:40 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-04-16 3:39 [PATCH v4 0/3] fix MAP_DROPPABLE not supported errno Anthony Yznaga
2026-04-16 3:39 ` [PATCH v4 1/3] mm: fix mmap errno value when MAP_DROPPABLE is not supported Anthony Yznaga
2026-04-16 3:39 ` [PATCH v4 2/3] selftests/mm: verify droppable mappings cannot be locked Anthony Yznaga
2026-04-16 8:41 ` David Hildenbrand (Arm)
2026-04-16 3:39 ` [PATCH v4 3/3] selftests/mm: run the MAP_DROPPABLE selftest Anthony Yznaga
2026-04-16 8:39 ` David Hildenbrand (Arm) [this message]
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=a88aaf79-ad64-4529-a86e-b94fc8fa9b27@kernel.org \
--to=david@kernel.org \
--cc=Jason@zx2c4.com \
--cc=Liam.Howlett@oracle.com \
--cc=akpm@linux-foundation.org \
--cc=anthony.yznaga@oracle.com \
--cc=jannh@google.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-kselftest@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=ljs@kernel.org \
--cc=mhocko@suse.com \
--cc=pfalcato@suse.de \
--cc=rppt@kernel.org \
--cc=shuah@kernel.org \
--cc=surenb@google.com \
--cc=vbabka@kernel.org \
/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