From: Andrew Morton <akpm@linux-foundation.org>
To: mm-commits@vger.kernel.org,willy@infradead.org,ryan.roberts@arm.com,npache@redhat.com,ljs@kernel.org,liam.howlett@oracle.com,lance.yang@linux.dev,hughd@google.com,dev.jain@arm.com,david@kernel.org,bas@dfinity.org,baolin.wang@linux.alibaba.com,baohua@kernel.org,adam.bratschikaye@dfinity.org,ziy@nvidia.com,akpm@linux-foundation.org
Subject: [folded-merged] selftests-mm-add-folio_split-and-filemap_get_entry-race-test-fix-2.patch removed from -mm tree
Date: Wed, 25 Mar 2026 18:42:57 -0700 [thread overview]
Message-ID: <20260326014257.C94F0C4CEF7@smtp.kernel.org> (raw)
The quilt patch titled
Subject: selftests/mm: fix sashiko complains on folio_split_race_test
has been removed from the -mm tree. Its filename was
selftests-mm-add-folio_split-and-filemap_get_entry-race-test-fix-2.patch
This patch was dropped because it was folded into selftests-mm-add-folio_split-and-filemap_get_entry-race-test.patch
------------------------------------------------------
From: Zi Yan <ziy@nvidia.com>
Subject: selftests/mm: fix sashiko complains on folio_split_race_test
Date: Sun, 22 Mar 2026 19:53:54 -0400
1. use PRIu64 for uint64_t
2. add pthread_barrier_t to ensure main thread starts to punch holes when
all reader threads are spawned.
Link: https://lkml.kernel.org/r/B0985749-939D-4256-B9B9-C54C0734CF72@nvidia.com
Signed-off-by: Zi Yan <ziy@nvidia.com>
Cc: Adam Bratschi-Kaye <adam.bratschikaye@dfinity.org>
Cc: Baolin Wang <baolin.wang@linux.alibaba.com>
Cc: Barry Song <baohua@kernel.org>
Cc: Bas van Dijk <bas@dfinity.org>
Cc: David Hildenbrand <david@kernel.org>
Cc: Dev Jain <dev.jain@arm.com>
Cc: Hugh Dickins <hughd@google.com>
Cc: Lance Yang <lance.yang@linux.dev>
Cc: Liam Howlett <liam.howlett@oracle.com>
Cc: Lorenzo Stoakes <lorenzo.stoakes@oracle.com>
Cc: Matthew Wilcox (Oracle) <willy@infradead.org>
Cc: Nico Pache <npache@redhat.com>
Cc: Ryan Roberts <ryan.roberts@arm.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
---
tools/testing/selftests/mm/folio_split_race_test.c | 17 +++++++++--
1 file changed, 14 insertions(+), 3 deletions(-)
--- a/tools/testing/selftests/mm/folio_split_race_test.c~selftests-mm-add-folio_split-and-filemap_get_entry-race-test-fix-2
+++ a/tools/testing/selftests/mm/folio_split_race_test.c
@@ -46,6 +46,7 @@ struct shared_ctl {
atomic_uint_fast32_t stop;
atomic_size_t reader_failures;
atomic_size_t reader_verified;
+ pthread_barrier_t barrier;
};
static void fill_page(unsigned char *base, size_t page_idx)
@@ -78,14 +79,14 @@ static bool check_page(unsigned char *ba
}
if (all_zero) {
ksft_print_msg(
- "CORRUPTED: page %zu (huge page %zu) is ALL ZEROS\n",
+ "CORRUPTED: page %zu (huge page %" PRIu64 ") is ALL ZEROS\n",
page_idx,
(page_idx * page_size) / pmd_pagesize);
} else {
ksft_print_msg(
- "CORRUPTED: page %zu (huge page %zu): expected idx %zu, got %lu\n",
+ "CORRUPTED: page %zu (huge page %" PRIu64 "): expected idx %zu, got %" PRIu64 "\n",
page_idx, (page_idx * page_size) / pmd_pagesize,
- page_idx, (unsigned long)got_idx);
+ page_idx, got_idx);
}
return false;
}
@@ -110,6 +111,8 @@ static void *reader_thread(void *arg)
atomic_size_t *verified = ra->verified;
size_t page_idx;
+ pthread_barrier_wait(&ctl->barrier);
+
while (atomic_load_explicit(&ctl->stop, memory_order_acquire) == 0) {
for (page_idx = (size_t)tid; page_idx < TOTAL_PAGES;
page_idx += NUM_READER_THREADS) {
@@ -178,8 +181,14 @@ static size_t run_iteration(void)
if (!check_huge_shmem(mmap_base, NR_PMD_PAGE, pmd_pagesize))
ksft_exit_fail_msg("No shmem THP is allocated\n");
+ if (pthread_barrier_init(&ctl.barrier, NULL, NUM_READER_THREADS + 1) != 0)
+ ksft_exit_fail_msg("pthread_barrier_init failed\n");
+
create_readers(threads, args, mmap_base, &ctl);
+ /* Wait for all reader threads to be ready before punching holes. */
+ pthread_barrier_wait(&ctl.barrier);
+
for (i = 0; i < TOTAL_PAGES; i++) {
if (i % PUNCH_INTERVAL != 0)
continue;
@@ -198,6 +207,8 @@ static size_t run_iteration(void)
for (i = 0; i < NUM_READER_THREADS; i++)
pthread_join(threads[i], NULL);
+ pthread_barrier_destroy(&ctl.barrier);
+
reader_failures = atomic_load_explicit(&ctl.reader_failures,
memory_order_acquire);
reader_verified = atomic_load_explicit(&ctl.reader_verified,
_
Patches currently in -mm which might be from ziy@nvidia.com are
selftests-mm-add-folio_split-and-filemap_get_entry-race-test.patch
reply other threads:[~2026-03-26 1:42 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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=20260326014257.C94F0C4CEF7@smtp.kernel.org \
--to=akpm@linux-foundation.org \
--cc=adam.bratschikaye@dfinity.org \
--cc=baohua@kernel.org \
--cc=baolin.wang@linux.alibaba.com \
--cc=bas@dfinity.org \
--cc=david@kernel.org \
--cc=dev.jain@arm.com \
--cc=hughd@google.com \
--cc=lance.yang@linux.dev \
--cc=liam.howlett@oracle.com \
--cc=ljs@kernel.org \
--cc=mm-commits@vger.kernel.org \
--cc=npache@redhat.com \
--cc=ryan.roberts@arm.com \
--cc=willy@infradead.org \
--cc=ziy@nvidia.com \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.