linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v4 0/3] fix MAP_DROPPABLE not supported errno
@ 2026-04-16  3:39 Anthony Yznaga
  2026-04-16  3:39 ` [PATCH v4 1/3] mm: fix mmap errno value when MAP_DROPPABLE is not supported Anthony Yznaga
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Anthony Yznaga @ 2026-04-16  3:39 UTC (permalink / raw)
  To: linux-mm, linux-kernel, linux-kselftest
  Cc: akpm, david, ljs, Liam.Howlett, vbabka, rppt, surenb, mhocko,
	jannh, pfalcato, Jason, shuah

Mark Brown reported seeing a regression in -next on 32 bit arm with the
mlock selftests. Before exiting and marking the tests failed, the following
message was logged after an attempt to create a MAP_DROPPABLE mapping:

Bail out! mmap error: Unknown error 524

It turns out error 524 is ENOTSUPP which is an error that userspace is not
supposed to see, but it indicates in this instance that MAP_DROPPABLE is
not supported.

The first patch changes the errno returned to EOPNOTSUPP. The second patch
is a second version of a prior patch to introduce selftests to verify
locking behavior with droppable mappings with the additional change to skip
the tests when MAP_DROPPABLE is not supported. The third patch fixes the
MAP_DROPPABLE selftest so that it is run by the framework and skips if
MAP_DROPPABLE is not supported.

v4:
- Removed unnecessary #ifdef MAP_DROPPABLE from patch 2 (DavidH)
- Changed the tests to also skip if mmap() returns EINVAL
- Added a third patch to fix the MAP_DROPPABLE selftest

v3:
- Added acked-by's and reviewed-by's to patch 1
- Addressed sashiko AI reviewbot questions:
  - Call munlockall() if test_mlockall_future_droppable() returns early
  - Skip the tests if they are compiled for an older kernel without
    MAP_DROPPABLE.

v2:
- Remove unnecessary mlock() call from selftest (DavidH)
- Change tests to not exit on failure (DavidH)

Anthony Yznaga (3):
  mm: fix mmap errno value when MAP_DROPPABLE is not supported
  selftests/mm: verify droppable mappings cannot be locked
  selftests/mm: run the MAP_DROPPABLE selftest

 mm/mmap.c                                 |  2 +-
 tools/testing/selftests/mm/droppable.c    |  9 ++-
 tools/testing/selftests/mm/mlock2-tests.c | 84 ++++++++++++++++++++---
 tools/testing/selftests/mm/run_vmtests.sh |  1 +
 4 files changed, 85 insertions(+), 11 deletions(-)

-- 
2.47.3



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

end of thread, other threads:[~2026-04-16  3:40 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
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  3:39 ` [PATCH v4 3/3] selftests/mm: run the MAP_DROPPABLE selftest Anthony Yznaga

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox