mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "tip-bot2 for Uros Bizjak" <tip-bot2@linutronix.de>
To: linux-tip-commits@vger.kernel.org
Cc: Uros Bizjak <ubizjak@gmail.com>,
	Thomas Gleixner <tglx@linutronix.de>,
	andrealmeid@igalia.com, x86@kernel.org,
	linux-kernel@vger.kernel.org
Subject: [tip: locking/core] futex: Use atomic64_inc_return() in get_inode_sequence_number()
Date: Thu, 17 Oct 2024 20:10:51 -0000	[thread overview]
Message-ID: <172919585166.1442.17461368757454570969.tip-bot2@tip-bot2> (raw)
In-Reply-To: <20241010071023.21913-1-ubizjak@gmail.com>

The following commit has been merged into the locking/core branch of tip:

Commit-ID:     19298f48694987fac843261c84e24834c255b451
Gitweb:        https://git.kernel.org/tip/19298f48694987fac843261c84e24834c255b451
Author:        Uros Bizjak <ubizjak@gmail.com>
AuthorDate:    Thu, 10 Oct 2024 09:10:04 +02:00
Committer:     Thomas Gleixner <tglx@linutronix.de>
CommitterDate: Thu, 17 Oct 2024 22:02:27 +02:00

futex: Use atomic64_inc_return() in get_inode_sequence_number()

Use atomic64_inc_return(&ref) instead of atomic64_add_return(1, &ref)
to use optimized implementation and ease register pressure around
the primitive for targets that implement optimized variant.

Signed-off-by: Uros Bizjak <ubizjak@gmail.com>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Reviewed-by: André Almeida <andrealmeid@igalia.com>
Link: https://lore.kernel.org/all/20241010071023.21913-1-ubizjak@gmail.com

---
 kernel/futex/core.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/kernel/futex/core.c b/kernel/futex/core.c
index 136768a..3146730 100644
--- a/kernel/futex/core.c
+++ b/kernel/futex/core.c
@@ -181,7 +181,7 @@ static u64 get_inode_sequence_number(struct inode *inode)
 		return old;
 
 	for (;;) {
-		u64 new = atomic64_add_return(1, &i_seq);
+		u64 new = atomic64_inc_return(&i_seq);
 		if (WARN_ON_ONCE(!new))
 			continue;
 

      parent reply	other threads:[~2024-10-17 20:10 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-10-10  7:10 [PATCH 1/2] " Uros Bizjak
2024-10-10  7:10 ` [PATCH 2/2] futex: Use atomic64_try_cmpxchg_relaxed() " Uros Bizjak
2024-10-10 18:06   ` André Almeida
2024-10-17 20:10   ` [tip: locking/core] " tip-bot2 for Uros Bizjak
2024-10-10 18:05 ` [PATCH 1/2] futex: Use atomic64_inc_return() " André Almeida
2024-10-17 20:10 ` tip-bot2 for Uros Bizjak [this message]

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=172919585166.1442.17461368757454570969.tip-bot2@tip-bot2 \
    --to=tip-bot2@linutronix.de \
    --cc=andrealmeid@igalia.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-tip-commits@vger.kernel.org \
    --cc=tglx@linutronix.de \
    --cc=ubizjak@gmail.com \
    --cc=x86@kernel.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

all inboxes | Powered by JetHome®