From: Sean Christopherson <seanjc@google.com>
To: Lai Jiangshan <jiangshanlai@gmail.com>,
"Paul E. McKenney" <paulmck@kernel.org>,
Josh Triplett <josh@joshtriplett.org>,
Paolo Bonzini <pbonzini@redhat.com>
Cc: rcu@vger.kernel.org, kvm@vger.kernel.org,
linux-kernel@vger.kernel.org,
Sean Christopherson <seanjc@google.com>,
Nikita Kalyazin <kalyazin@amazon.com>,
Keir Fraser <keirf@google.com>
Subject: [RFC PATCH 1/3] srcu: Declare exported symbols before including srcu{tiny,tree}.h
Date: Mon, 9 Mar 2026 12:30:57 -0700 [thread overview]
Message-ID: <20260309193059.2244645-2-seanjc@google.com> (raw)
In-Reply-To: <20260309193059.2244645-1-seanjc@google.com>
Move the declarations of call_srcu(), cleanup_srcu_struct(), and
synchronize_srcu() above the inclusion of the implementation specific SRCU
header so that tiny SRCU can provide inline wrappers, e.g. for expedited
versions, without needing to re-declare synchronize_srcu() and call_srcu().
Opportunsitically use rcu_callback_t in the call_srcu() declaration instead
of an open coded equivalent (all implementations already use
rcu_callback_t).
No functional change intended.
Signed-off-by: Sean Christopherson <seanjc@google.com>
---
include/linux/srcu.h | 10 +++++-----
include/linux/srcutiny.h | 2 --
2 files changed, 5 insertions(+), 7 deletions(-)
diff --git a/include/linux/srcu.h b/include/linux/srcu.h
index bb44a0bd7696..1cbc37e3b59c 100644
--- a/include/linux/srcu.h
+++ b/include/linux/srcu.h
@@ -79,6 +79,11 @@ int init_srcu_struct_fast_updown(struct srcu_struct *ssp);
// instead of smp_mb().
void __srcu_read_unlock(struct srcu_struct *ssp, int idx) __releases_shared(ssp);
+void call_srcu(struct srcu_struct *ssp, struct rcu_head *head,
+ rcu_callback_t func);
+void cleanup_srcu_struct(struct srcu_struct *ssp);
+void synchronize_srcu(struct srcu_struct *ssp);
+
#ifdef CONFIG_TINY_SRCU
#include <linux/srcutiny.h>
#elif defined(CONFIG_TREE_SRCU)
@@ -87,11 +92,6 @@ void __srcu_read_unlock(struct srcu_struct *ssp, int idx) __releases_shared(ssp)
#error "Unknown SRCU implementation specified to kernel configuration"
#endif
-void call_srcu(struct srcu_struct *ssp, struct rcu_head *head,
- void (*func)(struct rcu_head *head));
-void cleanup_srcu_struct(struct srcu_struct *ssp);
-void synchronize_srcu(struct srcu_struct *ssp);
-
#define SRCU_GET_STATE_COMPLETED 0x1
/**
diff --git a/include/linux/srcutiny.h b/include/linux/srcutiny.h
index dec7cbe015aa..4976536e8b28 100644
--- a/include/linux/srcutiny.h
+++ b/include/linux/srcutiny.h
@@ -64,8 +64,6 @@ struct srcu_usage { };
#define init_srcu_struct_fast_updown init_srcu_struct
#endif // #ifndef CONFIG_DEBUG_LOCK_ALLOC
-void synchronize_srcu(struct srcu_struct *ssp);
-
/*
* Counts the new reader in the appropriate per-CPU element of the
* srcu_struct. Can be invoked from irq/bh handlers, but the matching
--
2.53.0.473.g4a7958ca14-goog
next prev parent reply other threads:[~2026-03-09 19:31 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-03-09 19:30 [RFC PATCH 0/3] srcu: KVM: Add, export and use call_srcu_expedited() Sean Christopherson
2026-03-09 19:30 ` Sean Christopherson [this message]
2026-03-09 19:30 ` [RFC PATCH 2/3] srcu: Add and export call_srcu_expedited() to avoid transferring grace periods Sean Christopherson
2026-03-09 19:30 ` [RFC PATCH 3/3] KVM: Expedite SRCU callbacks when freeing objects during I/O bus registration Sean Christopherson
2026-03-13 8:51 ` [RFC PATCH 0/3] srcu: KVM: Add, export and use call_srcu_expedited() Kunwu Chan
2026-03-13 23:12 ` Sean Christopherson
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=20260309193059.2244645-2-seanjc@google.com \
--to=seanjc@google.com \
--cc=jiangshanlai@gmail.com \
--cc=josh@joshtriplett.org \
--cc=kalyazin@amazon.com \
--cc=keirf@google.com \
--cc=kvm@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=paulmck@kernel.org \
--cc=pbonzini@redhat.com \
--cc=rcu@vger.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