linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Vlastimil Babka <vbabka@suse.cz>
To: Lorenzo Stoakes <lorenzo.stoakes@oracle.com>,
	Andrew Morton <akpm@linux-foundation.org>
Cc: Suren Baghdasaryan <surenb@google.com>,
	"Liam R . Howlett" <Liam.Howlett@oracle.com>,
	Matthew Wilcox <willy@infradead.org>,
	"Paul E . McKenney" <paulmck@kernel.org>,
	Jann Horn <jannh@google.com>,
	David Hildenbrand <david@redhat.com>,
	linux-mm@kvack.org, linux-kernel@vger.kernel.org,
	Shuah Khan <shuah@kernel.org>,
	linux-kselftest@vger.kernel.org, linux-api@vger.kernel.org,
	John Hubbard <jhubbard@nvidia.com>,
	Juan Yescas <jyescas@google.com>,
	Kalesh Singh <kaleshsingh@google.com>
Subject: Re: [PATCH 2/4] selftests/mm: rename guard-pages to guard-regions
Date: Tue, 18 Feb 2025 15:15:54 +0100	[thread overview]
Message-ID: <a1a9b4e4-a590-4300-a882-88699267c83c@suse.cz> (raw)
In-Reply-To: <1c3cd04a3f69b5756b94bda701ac88325a9be18b.1739469950.git.lorenzo.stoakes@oracle.com>

On 2/13/25 19:17, Lorenzo Stoakes wrote:
> The feature formerly referred to as guard pages is more correctly referred
> to as 'guard regions', as in fact no pages are ever allocated in the
> process of installing the regions.
> 
> To avoid confusion, rename the tests accordingly.
> 
> Signed-off-by: Lorenzo Stoakes <lorenzo.stoakes@oracle.com>

Acked-by: Vlastimil Babka <vbabka@suse.cz>

> ---
>  tools/testing/selftests/mm/.gitignore         |  2 +-
>  tools/testing/selftests/mm/Makefile           |  2 +-
>  .../mm/{guard-pages.c => guard-regions.c}     | 42 +++++++++----------
>  3 files changed, 23 insertions(+), 23 deletions(-)
>  rename tools/testing/selftests/mm/{guard-pages.c => guard-regions.c} (98%)
> 
> diff --git a/tools/testing/selftests/mm/.gitignore b/tools/testing/selftests/mm/.gitignore
> index 121000c28c10..c5241b193db8 100644
> --- a/tools/testing/selftests/mm/.gitignore
> +++ b/tools/testing/selftests/mm/.gitignore
> @@ -57,4 +57,4 @@ droppable
>  hugetlb_dio
>  pkey_sighandler_tests_32
>  pkey_sighandler_tests_64
> -guard-pages
> +guard-regions
> diff --git a/tools/testing/selftests/mm/Makefile b/tools/testing/selftests/mm/Makefile
> index 63ce39d024bb..8270895039d1 100644
> --- a/tools/testing/selftests/mm/Makefile
> +++ b/tools/testing/selftests/mm/Makefile
> @@ -97,7 +97,7 @@ TEST_GEN_FILES += hugetlb_fault_after_madv
>  TEST_GEN_FILES += hugetlb_madv_vs_map
>  TEST_GEN_FILES += hugetlb_dio
>  TEST_GEN_FILES += droppable
> -TEST_GEN_FILES += guard-pages
> +TEST_GEN_FILES += guard-regions
>  
>  ifneq ($(ARCH),arm64)
>  TEST_GEN_FILES += soft-dirty
> diff --git a/tools/testing/selftests/mm/guard-pages.c b/tools/testing/selftests/mm/guard-regions.c
> similarity index 98%
> rename from tools/testing/selftests/mm/guard-pages.c
> rename to tools/testing/selftests/mm/guard-regions.c
> index ece37212a8a2..7a41cf9ffbdf 100644
> --- a/tools/testing/selftests/mm/guard-pages.c
> +++ b/tools/testing/selftests/mm/guard-regions.c
> @@ -107,12 +107,12 @@ static bool try_read_write_buf(char *ptr)
>  	return try_read_buf(ptr) && try_write_buf(ptr);
>  }
>  
> -FIXTURE(guard_pages)
> +FIXTURE(guard_regions)
>  {
>  	unsigned long page_size;
>  };
>  
> -FIXTURE_SETUP(guard_pages)
> +FIXTURE_SETUP(guard_regions)
>  {
>  	struct sigaction act = {
>  		.sa_handler = &handle_fatal,
> @@ -126,7 +126,7 @@ FIXTURE_SETUP(guard_pages)
>  	self->page_size = (unsigned long)sysconf(_SC_PAGESIZE);
>  };
>  
> -FIXTURE_TEARDOWN(guard_pages)
> +FIXTURE_TEARDOWN(guard_regions)
>  {
>  	struct sigaction act = {
>  		.sa_handler = SIG_DFL,
> @@ -137,7 +137,7 @@ FIXTURE_TEARDOWN(guard_pages)
>  	sigaction(SIGSEGV, &act, NULL);
>  }
>  
> -TEST_F(guard_pages, basic)
> +TEST_F(guard_regions, basic)
>  {
>  	const unsigned long NUM_PAGES = 10;
>  	const unsigned long page_size = self->page_size;
> @@ -231,7 +231,7 @@ TEST_F(guard_pages, basic)
>  }
>  
>  /* Assert that operations applied across multiple VMAs work as expected. */
> -TEST_F(guard_pages, multi_vma)
> +TEST_F(guard_regions, multi_vma)
>  {
>  	const unsigned long page_size = self->page_size;
>  	char *ptr_region, *ptr, *ptr1, *ptr2, *ptr3;
> @@ -367,7 +367,7 @@ TEST_F(guard_pages, multi_vma)
>   * Assert that batched operations performed using process_madvise() work as
>   * expected.
>   */
> -TEST_F(guard_pages, process_madvise)
> +TEST_F(guard_regions, process_madvise)
>  {
>  	const unsigned long page_size = self->page_size;
>  	pid_t pid = getpid();
> @@ -467,7 +467,7 @@ TEST_F(guard_pages, process_madvise)
>  }
>  
>  /* Assert that unmapping ranges does not leave guard markers behind. */
> -TEST_F(guard_pages, munmap)
> +TEST_F(guard_regions, munmap)
>  {
>  	const unsigned long page_size = self->page_size;
>  	char *ptr, *ptr_new1, *ptr_new2;
> @@ -505,7 +505,7 @@ TEST_F(guard_pages, munmap)
>  }
>  
>  /* Assert that mprotect() operations have no bearing on guard markers. */
> -TEST_F(guard_pages, mprotect)
> +TEST_F(guard_regions, mprotect)
>  {
>  	const unsigned long page_size = self->page_size;
>  	char *ptr;
> @@ -553,7 +553,7 @@ TEST_F(guard_pages, mprotect)
>  }
>  
>  /* Split and merge VMAs and make sure guard pages still behave. */
> -TEST_F(guard_pages, split_merge)
> +TEST_F(guard_regions, split_merge)
>  {
>  	const unsigned long page_size = self->page_size;
>  	char *ptr, *ptr_new;
> @@ -684,7 +684,7 @@ TEST_F(guard_pages, split_merge)
>  }
>  
>  /* Assert that MADV_DONTNEED does not remove guard markers. */
> -TEST_F(guard_pages, dontneed)
> +TEST_F(guard_regions, dontneed)
>  {
>  	const unsigned long page_size = self->page_size;
>  	char *ptr;
> @@ -737,7 +737,7 @@ TEST_F(guard_pages, dontneed)
>  }
>  
>  /* Assert that mlock()'ed pages work correctly with guard markers. */
> -TEST_F(guard_pages, mlock)
> +TEST_F(guard_regions, mlock)
>  {
>  	const unsigned long page_size = self->page_size;
>  	char *ptr;
> @@ -810,7 +810,7 @@ TEST_F(guard_pages, mlock)
>   *
>   * - Moving a mapping alone should retain markers as they are.
>   */
> -TEST_F(guard_pages, mremap_move)
> +TEST_F(guard_regions, mremap_move)
>  {
>  	const unsigned long page_size = self->page_size;
>  	char *ptr, *ptr_new;
> @@ -857,7 +857,7 @@ TEST_F(guard_pages, mremap_move)
>   * will have to remove guard pages manually to fix up (they'd have to do the
>   * same if it were a PROT_NONE mapping).
>   */
> -TEST_F(guard_pages, mremap_expand)
> +TEST_F(guard_regions, mremap_expand)
>  {
>  	const unsigned long page_size = self->page_size;
>  	char *ptr, *ptr_new;
> @@ -920,7 +920,7 @@ TEST_F(guard_pages, mremap_expand)
>   * if the user were using a PROT_NONE mapping they'd have to manually fix this
>   * up also so this is OK.
>   */
> -TEST_F(guard_pages, mremap_shrink)
> +TEST_F(guard_regions, mremap_shrink)
>  {
>  	const unsigned long page_size = self->page_size;
>  	char *ptr;
> @@ -984,7 +984,7 @@ TEST_F(guard_pages, mremap_shrink)
>   * Assert that forking a process with VMAs that do not have VM_WIPEONFORK set
>   * retain guard pages.
>   */
> -TEST_F(guard_pages, fork)
> +TEST_F(guard_regions, fork)
>  {
>  	const unsigned long page_size = self->page_size;
>  	char *ptr;
> @@ -1039,7 +1039,7 @@ TEST_F(guard_pages, fork)
>   * Assert expected behaviour after we fork populated ranges of anonymous memory
>   * and then guard and unguard the range.
>   */
> -TEST_F(guard_pages, fork_cow)
> +TEST_F(guard_regions, fork_cow)
>  {
>  	const unsigned long page_size = self->page_size;
>  	char *ptr;
> @@ -1110,7 +1110,7 @@ TEST_F(guard_pages, fork_cow)
>   * Assert that forking a process with VMAs that do have VM_WIPEONFORK set
>   * behave as expected.
>   */
> -TEST_F(guard_pages, fork_wipeonfork)
> +TEST_F(guard_regions, fork_wipeonfork)
>  {
>  	const unsigned long page_size = self->page_size;
>  	char *ptr;
> @@ -1160,7 +1160,7 @@ TEST_F(guard_pages, fork_wipeonfork)
>  }
>  
>  /* Ensure that MADV_FREE retains guard entries as expected. */
> -TEST_F(guard_pages, lazyfree)
> +TEST_F(guard_regions, lazyfree)
>  {
>  	const unsigned long page_size = self->page_size;
>  	char *ptr;
> @@ -1196,7 +1196,7 @@ TEST_F(guard_pages, lazyfree)
>  }
>  
>  /* Ensure that MADV_POPULATE_READ, MADV_POPULATE_WRITE behave as expected. */
> -TEST_F(guard_pages, populate)
> +TEST_F(guard_regions, populate)
>  {
>  	const unsigned long page_size = self->page_size;
>  	char *ptr;
> @@ -1222,7 +1222,7 @@ TEST_F(guard_pages, populate)
>  }
>  
>  /* Ensure that MADV_COLD, MADV_PAGEOUT do not remove guard markers. */
> -TEST_F(guard_pages, cold_pageout)
> +TEST_F(guard_regions, cold_pageout)
>  {
>  	const unsigned long page_size = self->page_size;
>  	char *ptr;
> @@ -1268,7 +1268,7 @@ TEST_F(guard_pages, cold_pageout)
>  }
>  
>  /* Ensure that guard pages do not break userfaultd. */
> -TEST_F(guard_pages, uffd)
> +TEST_F(guard_regions, uffd)
>  {
>  	const unsigned long page_size = self->page_size;
>  	int uffd;



  reply	other threads:[~2025-02-18 14:16 UTC|newest]

Thread overview: 64+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-02-13 18:16 [PATCH 0/4] mm: permit guard regions for file-backed/shmem mappings Lorenzo Stoakes
2025-02-13 18:17 ` [PATCH 1/4] mm: allow guard regions in file-backed and read-only mappings Lorenzo Stoakes
2025-02-18 14:15   ` Vlastimil Babka
2025-02-18 16:01   ` David Hildenbrand
2025-02-18 16:12     ` Lorenzo Stoakes
2025-02-18 16:17       ` David Hildenbrand
2025-02-18 16:21         ` Lorenzo Stoakes
2025-02-18 16:27           ` David Hildenbrand
2025-02-18 16:49             ` Lorenzo Stoakes
2025-02-18 17:00               ` David Hildenbrand
2025-02-18 17:04                 ` Lorenzo Stoakes
2025-02-24 14:02   ` Lorenzo Stoakes
2025-02-13 18:17 ` [PATCH 2/4] selftests/mm: rename guard-pages to guard-regions Lorenzo Stoakes
2025-02-18 14:15   ` Vlastimil Babka [this message]
2025-03-02  8:35   ` Lorenzo Stoakes
2025-02-13 18:17 ` [PATCH 3/4] tools/selftests: expand all guard region tests to file-backed Lorenzo Stoakes
2025-02-18 14:17   ` Vlastimil Babka
2025-04-22 10:37   ` Ryan Roberts
2025-04-22 10:47     ` Lorenzo Stoakes
2025-04-22 11:03       ` Ryan Roberts
2025-04-22 11:07         ` Lorenzo Stoakes
2025-04-22 11:11           ` Ryan Roberts
2025-02-13 18:17 ` [PATCH 4/4] tools/selftests: add file/shmem-backed mapping guard region tests Lorenzo Stoakes
2025-02-18 14:18   ` Vlastimil Babka
2025-02-18 12:12 ` [PATCH 0/4] mm: permit guard regions for file-backed/shmem mappings Vlastimil Babka
2025-02-18 13:05   ` Lorenzo Stoakes
2025-02-18 14:35     ` David Hildenbrand
2025-02-18 14:53       ` Lorenzo Stoakes
2025-02-18 15:20         ` David Hildenbrand
2025-02-18 16:43           ` Lorenzo Stoakes
2025-02-18 17:14             ` David Hildenbrand
2025-02-18 17:20               ` Lorenzo Stoakes
2025-02-18 17:25                 ` David Hildenbrand
2025-02-18 17:28                   ` Lorenzo Stoakes
2025-02-18 17:31                     ` David Hildenbrand
2025-02-25 15:54                     ` Vlastimil Babka
2025-02-25 16:31                       ` David Hildenbrand
2025-02-25 16:37                       ` Lorenzo Stoakes
2025-02-25 16:48                         ` David Hildenbrand
2025-02-19  8:25 ` Kalesh Singh
2025-02-19  8:35   ` Kalesh Singh
2025-02-19  9:15     ` Lorenzo Stoakes
2025-02-19 17:32     ` Liam R. Howlett
2025-02-19  9:03   ` Lorenzo Stoakes
2025-02-19  9:15     ` David Hildenbrand
2025-02-19  9:17       ` Lorenzo Stoakes
2025-02-19 18:52         ` Kalesh Singh
2025-02-19 19:20           ` Lorenzo Stoakes
2025-02-19 20:56             ` Kalesh Singh
2025-02-20  8:51               ` Lorenzo Stoakes
2025-02-20  8:57                 ` David Hildenbrand
2025-02-20  9:04                   ` Lorenzo Stoakes
2025-02-20  9:23                     ` David Hildenbrand
2025-02-20  9:47                       ` Lorenzo Stoakes
2025-02-20 10:03                         ` David Hildenbrand
2025-02-20 10:15                           ` Lorenzo Stoakes
2025-02-20 12:44                             ` David Hildenbrand
2025-02-20 13:18                               ` Lorenzo Stoakes
2025-02-20 16:21                                 ` Suren Baghdasaryan
2025-02-20 18:08                                   ` Kalesh Singh
2025-02-21 11:04                                     ` Lorenzo Stoakes
2025-02-21 17:24                                       ` Kalesh Singh
2025-02-20  9:22                 ` Vlastimil Babka
2025-02-20  9:53                   ` Lorenzo Stoakes

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=a1a9b4e4-a590-4300-a882-88699267c83c@suse.cz \
    --to=vbabka@suse.cz \
    --cc=Liam.Howlett@oracle.com \
    --cc=akpm@linux-foundation.org \
    --cc=david@redhat.com \
    --cc=jannh@google.com \
    --cc=jhubbard@nvidia.com \
    --cc=jyescas@google.com \
    --cc=kaleshsingh@google.com \
    --cc=linux-api@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-kselftest@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=lorenzo.stoakes@oracle.com \
    --cc=paulmck@kernel.org \
    --cc=shuah@kernel.org \
    --cc=surenb@google.com \
    --cc=willy@infradead.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