From: Masahiro Yamada <masahiroy@kernel.org>
To: "Paul E . McKenney" <paulmck@kernel.org>,
Frederic Weisbecker <frederic@kernel.org>,
Neeraj Upadhyay <neeraj.upadhyay@kernel.org>,
Joel Fernandes <joel@joelfernandes.org>,
Josh Triplett <josh@joshtriplett.org>,
Boqun Feng <boqun.feng@gmail.com>,
Uladzislau Rezki <urezki@gmail.com>,
rcu@vger.kernel.org
Cc: linux-kernel@vger.kernel.org,
Masahiro Yamada <masahiroy@kernel.org>,
Lai Jiangshan <jiangshanlai@gmail.com>,
Mathieu Desnoyers <mathieu.desnoyers@efficios.com>,
Steven Rostedt <rostedt@goodmis.org>
Subject: [PATCH] srcu: refactor __srcu_read_(un)lock_lite() declarations
Date: Tue, 14 Jan 2025 19:52:13 +0900 [thread overview]
Message-ID: <20250114105215.4007622-1-masahiroy@kernel.org> (raw)
For CONFIG_TREE_SRCU, __srcu_read_(un)lock_lite() are defined as static
inline functions in <linux/srcutree.h>. The later function declarations
are redundant.
Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
---
include/linux/srcu.h | 9 ++-------
include/linux/srcutree.h | 4 ++--
2 files changed, 4 insertions(+), 9 deletions(-)
diff --git a/include/linux/srcu.h b/include/linux/srcu.h
index 08339eb8a01c..314f0bca6eb7 100644
--- a/include/linux/srcu.h
+++ b/include/linux/srcu.h
@@ -45,6 +45,8 @@ int init_srcu_struct(struct srcu_struct *ssp);
#ifdef CONFIG_TINY_SRCU
#include <linux/srcutiny.h>
+#define __srcu_read_lock_lite __srcu_read_lock
+#define __srcu_read_unlock_lite __srcu_read_unlock
#elif defined(CONFIG_TREE_SRCU)
#include <linux/srcutree.h>
#else
@@ -56,13 +58,6 @@ void call_srcu(struct srcu_struct *ssp, struct rcu_head *head,
void cleanup_srcu_struct(struct srcu_struct *ssp);
int __srcu_read_lock(struct srcu_struct *ssp) __acquires(ssp);
void __srcu_read_unlock(struct srcu_struct *ssp, int idx) __releases(ssp);
-#ifdef CONFIG_TINY_SRCU
-#define __srcu_read_lock_lite __srcu_read_lock
-#define __srcu_read_unlock_lite __srcu_read_unlock
-#else // #ifdef CONFIG_TINY_SRCU
-int __srcu_read_lock_lite(struct srcu_struct *ssp) __acquires(ssp);
-void __srcu_read_unlock_lite(struct srcu_struct *ssp, int idx) __releases(ssp);
-#endif // #else // #ifdef CONFIG_TINY_SRCU
void synchronize_srcu(struct srcu_struct *ssp);
#define SRCU_GET_STATE_COMPLETED 0x1
diff --git a/include/linux/srcutree.h b/include/linux/srcutree.h
index 490aeecc6bb4..16a7d631c185 100644
--- a/include/linux/srcutree.h
+++ b/include/linux/srcutree.h
@@ -219,7 +219,7 @@ void srcu_torture_stats_print(struct srcu_struct *ssp, char *tt, char *tf);
* or because it is a read-modify-write atomic operation, depending on
* the whims of the architecture.
*/
-static inline int __srcu_read_lock_lite(struct srcu_struct *ssp)
+static inline int __srcu_read_lock_lite(struct srcu_struct *ssp) __acquires(ssp)
{
int idx;
@@ -241,7 +241,7 @@ static inline int __srcu_read_lock_lite(struct srcu_struct *ssp)
* or because it is a read-modify-write atomic operation, depending on
* the whims of the architecture.
*/
-static inline void __srcu_read_unlock_lite(struct srcu_struct *ssp, int idx)
+static inline void __srcu_read_unlock_lite(struct srcu_struct *ssp, int idx) __releases(ssp)
{
barrier(); /* Avoid leaking the critical section. */
this_cpu_inc(ssp->sda->srcu_unlock_count[idx].counter); /* Z */
--
2.43.0
next reply other threads:[~2025-01-14 10:52 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-01-14 10:52 Masahiro Yamada [this message]
2025-01-16 16:03 ` [PATCH] srcu: refactor __srcu_read_(un)lock_lite() declarations Paul E. McKenney
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=20250114105215.4007622-1-masahiroy@kernel.org \
--to=masahiroy@kernel.org \
--cc=boqun.feng@gmail.com \
--cc=frederic@kernel.org \
--cc=jiangshanlai@gmail.com \
--cc=joel@joelfernandes.org \
--cc=josh@joshtriplett.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mathieu.desnoyers@efficios.com \
--cc=neeraj.upadhyay@kernel.org \
--cc=paulmck@kernel.org \
--cc=rcu@vger.kernel.org \
--cc=rostedt@goodmis.org \
--cc=urezki@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.