All of lore.kernel.org
 help / color / mirror / Atom feed
* [merged mm-nonmm-stable] epoll-use-try_cmpxchg-in-list_add_tail_lockless.patch removed from -mm tree
@ 2022-09-12  4:56 Andrew Morton
  0 siblings, 0 replies; only message in thread
From: Andrew Morton @ 2022-09-12  4:56 UTC (permalink / raw)
  To: mm-commits, viro, ubizjak, akpm


The quilt patch titled
     Subject: epoll: use try_cmpxchg in list_add_tail_lockless
has been removed from the -mm tree.  Its filename was
     epoll-use-try_cmpxchg-in-list_add_tail_lockless.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: Uros Bizjak <ubizjak@gmail.com>
Subject: epoll: use try_cmpxchg in list_add_tail_lockless
Date: Thu, 14 Jul 2022 19:32:55 +0200

Use try_cmpxchg instead of cmpxchg (*ptr, old, new) == old in
list_add_tail_lockless.  x86 CMPXCHG instruction returns success in ZF
flag, so this change saves a compare after cmpxchg (and related move
instruction in front of cmpxchg).

No functional change intended.

Link: https://lkml.kernel.org/r/20220714173255.12987-1-ubizjak@gmail.com
Signed-off-by: Uros Bizjak <ubizjak@gmail.com>
Cc: Alexander Viro <viro@zeniv.linux.org.uk>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
---

 fs/eventpoll.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

--- a/fs/eventpoll.c~epoll-use-try_cmpxchg-in-list_add_tail_lockless
+++ a/fs/eventpoll.c
@@ -1065,7 +1065,7 @@ static inline bool list_add_tail_lockles
 	 * added to the list from another CPU: the winner observes
 	 * new->next == new.
 	 */
-	if (cmpxchg(&new->next, new, head) != new)
+	if (!try_cmpxchg(&new->next, &new, head))
 		return false;
 
 	/*
_

Patches currently in -mm which might be from ubizjak@gmail.com are



^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2022-09-12  4:57 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-09-12  4:56 [merged mm-nonmm-stable] epoll-use-try_cmpxchg-in-list_add_tail_lockless.patch removed from -mm tree Andrew Morton

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.