Re: [PATCH v2 2/7] mm/selftests: add max_vma_count tests

From: David Hildenbrand
Date: Wed Sep 17 2025 - 06:58:56 EST


+ * test_suite_setup - Set up the VMA layout for VMA count testing.
+ *
+ * Sets up the following VMA layout:
+ *
+ * +----- base_addr
+ * |
+ * V
+ * +--------------+----------------------+--------------+----------------+--------------+----------------+--------------+-----+----------------+--------------+
+ * | Guard Page | | Guard Page | Extra Map 1 | Unmapped Gap | Extra Map 2 | Unmapped Gap | ... | Extra Map N | Unmapped Gap |
+ * | (unmapped) | TEST_AREA | (unmapped) | (mapped page) | (1 page) | (mapped page) | (1 page) | ... | (mapped page) | (1 page) |
+ * | (1 page) | (unmapped, 3 pages) | (1 page) | (1 page) | | (1 page) | | | (1 page) | |
+ * +--------------+----------------------+--------------+----------------+--------------+----------------+--------------+-----+----------------+--------------+
+ * ^ ^ ^ ^ ^
+ * | | | | |
+ * +--GUARD_SIZE--+ | +-- EXTRA_MAPS points here Sufficient EXTRA_MAPS to ---+
+ * (PAGE_SIZE) | | reach MAX_VMA_COUNT
+ * | |
+ * +--- TEST_AREA_SIZE ---+
+ * | (3 * PAGE_SIZE) |
+ * ^
+ * |
+ * +-- TEST_AREA starts here
+ *


Just wondering if we could find a different name than "guard page" here, to not confuse stuff with guard ptes

Will the current "guard page" we a valid vma or just a hole?

--
Cheers

David / dhildenb