From: "Paul E. McKenney" <paulmck@kernel.org>
To: rcu@vger.kernel.org
Cc: linux-kernel@vger.kernel.org, kernel-team@meta.com,
rostedt@goodmis.org, "Paul E. McKenney" <paulmck@kernel.org>,
"Linus Torvalds" <torvalds@linux-foundation.org>,
"atthias Brugger" <matthias.bgg@gmail.com>,
"Rafael J. Wysocki" <rafael.j.wysocki@intel.com>,
"Michał Mirosław" <mirq-linux@rere.qmqm.pl>,
"Dmitry Osipenko" <dmitry.osipenko@collabora.com>,
"Sachin Sant" <sachinp@linux.ibm.com>,
"Joel Fernandes" <joel@joelfernandes.org>
Subject: [PATCH rcu 3/6] srcu,notifier: Remove #ifdefs in favor of SRCU Tiny srcu_usage
Date: Mon, 17 Jul 2023 11:03:14 -0700 [thread overview]
Message-ID: <20230717180317.1097590-3-paulmck@kernel.org> (raw)
In-Reply-To: <6127192c-da9b-4599-9738-6e8f92e6c75c@paulmck-laptop>
This commit removes two #ifdef directives from include/linux/notifier.h
by causing SRCU Tiny to provide a dummy srcu_usage structure and a dummy
__SRCU_USAGE_INIT() macro.
Suggested-by: Linus Torvalds <torvalds@linux-foundation.org>
Cc: atthias Brugger <matthias.bgg@gmail.com>
Cc: "Rafael J. Wysocki" <rafael.j.wysocki@intel.com>
Cc: "Michał Mirosław" <mirq-linux@rere.qmqm.pl>
Cc: Dmitry Osipenko <dmitry.osipenko@collabora.com>
Cc: Sachin Sant <sachinp@linux.ibm.com>
Cc: Joel Fernandes (Google) <joel@joelfernandes.org>
Signed-off-by: Paul E. McKenney <paulmck@kernel.org>
---
include/linux/notifier.h | 11 -----------
include/linux/srcutiny.h | 7 +++++++
2 files changed, 7 insertions(+), 11 deletions(-)
diff --git a/include/linux/notifier.h b/include/linux/notifier.h
index 86544707236a..45702bdcbceb 100644
--- a/include/linux/notifier.h
+++ b/include/linux/notifier.h
@@ -73,9 +73,7 @@ struct raw_notifier_head {
struct srcu_notifier_head {
struct mutex mutex;
-#ifdef CONFIG_TREE_SRCU
struct srcu_usage srcuu;
-#endif
struct srcu_struct srcu;
struct notifier_block __rcu *head;
};
@@ -106,7 +104,6 @@ extern void srcu_init_notifier_head(struct srcu_notifier_head *nh);
#define RAW_NOTIFIER_INIT(name) { \
.head = NULL }
-#ifdef CONFIG_TREE_SRCU
#define SRCU_NOTIFIER_INIT(name, pcpu) \
{ \
.mutex = __MUTEX_INITIALIZER(name.mutex), \
@@ -114,14 +111,6 @@ extern void srcu_init_notifier_head(struct srcu_notifier_head *nh);
.srcuu = __SRCU_USAGE_INIT(name.srcuu), \
.srcu = __SRCU_STRUCT_INIT(name.srcu, name.srcuu, pcpu), \
}
-#else
-#define SRCU_NOTIFIER_INIT(name, pcpu) \
- { \
- .mutex = __MUTEX_INITIALIZER(name.mutex), \
- .head = NULL, \
- .srcu = __SRCU_STRUCT_INIT(name.srcu, name.srcuu, pcpu), \
- }
-#endif
#define ATOMIC_NOTIFIER_HEAD(name) \
struct atomic_notifier_head name = \
diff --git a/include/linux/srcutiny.h b/include/linux/srcutiny.h
index ebd72491af99..06ce65518974 100644
--- a/include/linux/srcutiny.h
+++ b/include/linux/srcutiny.h
@@ -48,6 +48,13 @@ void srcu_drive_gp(struct work_struct *wp);
#define DEFINE_STATIC_SRCU(name) \
static struct srcu_struct name = __SRCU_STRUCT_INIT(name, name, name)
+// Dummy structure for srcu_notifier_head.
+struct srcu_usage {
+ char srcuu_dummy;
+};
+
+#define __SRCU_USAGE_INIT(name) { .srcuu_dummy = 0, }
+
void synchronize_srcu(struct srcu_struct *ssp);
/*
--
2.40.1
next prev parent reply other threads:[~2023-07-17 18:03 UTC|newest]
Thread overview: 23+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-07-17 18:03 [PATCH rcu 0/6] Miscellaneous fixes for v6.6 Paul E. McKenney
2023-07-17 18:03 ` [PATCH rcu 1/6] rcu: Update synchronize_rcu_mult() comment for call_rcu_hurry() Paul E. McKenney
2023-07-18 12:59 ` Joel Fernandes
2023-07-17 18:03 ` [PATCH rcu 2/6] rcu: Clarify rcu_is_watching() kernel-doc comment Paul E. McKenney
2023-07-18 12:52 ` Joel Fernandes
2023-07-18 18:12 ` Paul E. McKenney
2023-07-19 1:56 ` Joel Fernandes
2023-07-19 20:38 ` Paul E. McKenney
2023-07-17 18:03 ` Paul E. McKenney [this message]
2023-07-17 18:09 ` [PATCH rcu 3/6] srcu,notifier: Remove #ifdefs in favor of SRCU Tiny srcu_usage Linus Torvalds
2023-07-17 18:16 ` Paul E. McKenney
2023-07-17 18:03 ` [PATCH rcu 4/6] rcu: Mark __rcu_irq_enter_check_tick() ->rcu_urgent_qs load Paul E. McKenney
2023-07-18 12:58 ` Joel Fernandes
2023-07-17 18:03 ` [PATCH rcu 5/6] rcu: Make the rcu_nocb_poll boot parameter usable via boot config Paul E. McKenney
2023-07-18 13:46 ` Joel Fernandes
2023-07-17 18:03 ` [PATCH rcu 6/6] rcu: Use WRITE_ONCE() for assignments to ->next for rculist_nulls Paul E. McKenney
2023-07-18 13:49 ` Joel Fernandes
2023-07-18 14:48 ` Alan Huang
2023-07-18 18:32 ` Paul E. McKenney
2023-07-19 1:48 ` Joel Fernandes
2023-07-19 18:20 ` Paul E. McKenney
2023-07-19 19:17 ` Alan Huang
2023-07-19 20:02 ` 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=20230717180317.1097590-3-paulmck@kernel.org \
--to=paulmck@kernel.org \
--cc=dmitry.osipenko@collabora.com \
--cc=joel@joelfernandes.org \
--cc=kernel-team@meta.com \
--cc=linux-kernel@vger.kernel.org \
--cc=matthias.bgg@gmail.com \
--cc=mirq-linux@rere.qmqm.pl \
--cc=rafael.j.wysocki@intel.com \
--cc=rcu@vger.kernel.org \
--cc=rostedt@goodmis.org \
--cc=sachinp@linux.ibm.com \
--cc=torvalds@linux-foundation.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®