From: Andrew Morton <akpm@linux-foundation.org>
To: mm-commits@vger.kernel.org,richard120310@gmail.com,mingo@kernel.org,visitorckw@gmail.com,akpm@linux-foundation.org
Subject: [merged mm-nonmm-stable] revert-lib-plistc-enforce-memory-ordering-in-plist_check_list.patch removed from -mm tree
Date: Thu, 20 Nov 2025 14:04:41 -0800 [thread overview]
Message-ID: <20251120220441.CED69C4CEF1@smtp.kernel.org> (raw)
The quilt patch titled
Subject: Revert "lib/plist.c: enforce memory ordering in plist_check_list"
has been removed from the -mm tree. Its filename was
revert-lib-plistc-enforce-memory-ordering-in-plist_check_list.patch
This patch was dropped because it was merged into the mm-nonmm-stable branch
of git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm
------------------------------------------------------
From: Kuan-Wei Chiu <visitorckw@gmail.com>
Subject: Revert "lib/plist.c: enforce memory ordering in plist_check_list"
Date: Thu, 13 Nov 2025 19:34:13 +0000
This reverts commit 7abcb84f953df037d40fad66f2109db318dd155b.
The introduction of WRITE_ONCE() calls for the 'prev' and 'next' variables
inside plist_check_list() was a misapplication. WRITE_ONCE() is
fundamentally a compiler barrier designed to prevent compiler
optimizations (like caching or reordering) on shared memory locations.
However, the variables 'prev' and 'next' are local, stack-allocated
pointers accessed only by the current thread's invocation of the function.
Since these pointers are thread-local and are never accessed concurrently,
applying WRITE_ONCE() to them is semantically incorrect and unnecessary.
Furthermore, the use of WRITE_ONCE() on local variables prevents the
compiler from performing standard optimizations, such as keeping these
variables cached solely in CPU registers throughout the loop, potentially
introducing performance overhead. Restore the conventional C assignment
for local loop variables, allowing the compiler to generate optimal code.
Link: https://lkml.kernel.org/r/20251113193413.499309-1-visitorckw@gmail.com
Signed-off-by: Kuan-Wei Chiu <visitorckw@gmail.com>
Cc: I Hsin Cheng <richard120310@gmail.com>
Cc: Ingo Molnar <mingo@kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
---
lib/plist.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
--- a/lib/plist.c~revert-lib-plistc-enforce-memory-ordering-in-plist_check_list
+++ a/lib/plist.c
@@ -47,8 +47,8 @@ static void plist_check_list(struct list
plist_check_prev_next(top, prev, next);
while (next != top) {
- WRITE_ONCE(prev, next);
- WRITE_ONCE(next, prev->next);
+ prev = next;
+ next = prev->next;
plist_check_prev_next(top, prev, next);
}
}
_
Patches currently in -mm which might be from visitorckw@gmail.com are
reply other threads:[~2025-11-20 22:04 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=20251120220441.CED69C4CEF1@smtp.kernel.org \
--to=akpm@linux-foundation.org \
--cc=mingo@kernel.org \
--cc=mm-commits@vger.kernel.org \
--cc=richard120310@gmail.com \
--cc=visitorckw@gmail.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.