selftests-nommu-add-nommu-mmap-and-mremap-behavior-tests.patch removed from -mm tree
The quilt patch titled
Subject: selftests/nommu: add nommu mmap and mremap behavior tests
has been removed from the -mm tree. Its filename was
selftests-nommu-add-nommu-mmap-and-mremap-behavior-tests.patch
This patch was dropped because it was merged into the mm-stable branch of git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm
------------------------------------------------------
From: Hajime Tazaki <[email protected]>
Subject: selftests/nommu: add nommu mmap and mremap behavior tests
Date: Tue, 6 Oct 2026 17:56:42 +0900
Introduce a kselftest utility to validate memory mapping capabilities under nommu kernels, aligned with Documentation/admin-guide/mm/nommu-mmap.rst.
The test implements basic checks into a generic architecture-agnostic test matrix applicable across nommu targets. It evaluates:
1. MAP_FIXED allocation rejections.
2. Standard MAP_PRIVATE and MAP_ANONYMOUS allocation resilience.
3. Regular file mappings via standard filesystem storage.
4. Block device subsystem mappings (gracefully skipping if node is missing).
5. Shared vs Private backing discrepancies under nommu conditions.
6. mremap limits, ensuring non-expandable restrictions behave properly.
---
tools/testing/selftests/nommu/Makefile | 7 tools/testing/selftests/nommu/nommu.h | 33 + tools/testing/selftests/nommu/nommu_mmap_test.c | 264 ++++++++ tools/testing/selftests/nommu/nommu_mremap_test.c | 356 ++++++++++++ 4 files changed, 660 insertions(+)
tools/testing/selftests/nommu/Makefile new file +7 -0
@@ -0,0 +1,7 @@ +# SPDX-License-Identifier: GPL-2.0 +# Makefile for nommu selftests + +TEST_GEN_PROGS += nommu_mmap_test +TEST_GEN_PROGS += nommu_mremap_test + +include ../lib.mk
tools/testing/selftests/nommu/nommu.h new file +33 -0
@@ -0,0 +1,33 @@ +/* SPDX-License-Identifier: GPL-2.0 */ +#ifndef NOMMU_H +#define NOMMU_H + +#include <stdio.h> +#include <string.h> + +/* Returns 1 for NOMMU, 0 for MMU, and -1 if /proc/meminfo is unavailable. */ +static inline int ksft_is_nommu (void ) +{ +FILE *fp; +char line[256 ]; +int nommu =0 ; + + fp =fopen ("/proc/meminfo" ,"r" ); +if (!fp) +return -1 ; + +while (fgets (line,sizeof (line), fp)) { +if (strncmp (line,"MmapCopy:" ,sizeof ("MmapCopy:" ) -1 ) ==0 ) { + nommu =1 ; +break ; + } + } + +if (ferror (fp)) + nommu =-1 ; +fclose (fp); + +return nommu; +} + +#endif
tools/testing/selftests/nommu/nommu_mmap_test.c new file +264 -0
264 lines not on this page · raw message
tools/testing/selftests/nommu/nommu_mremap_test.c new file +356 -0
356 lines not on this page · raw message
_
Patches currently in -mm which might be from [email protected] are