Re: [PATCH v8 2/4] srcu: expose srcu_readers_active()
From: Gary Guo
Date: Fri May 29 2026 - 07:58:54 EST
On Fri May 29, 2026 at 12:43 PM BST, Onur Özkan wrote:
> This is needed by rust/helpers/srcu.c which now adds
> rust_helper_srcu_readers_active() as a wrapper around the SRCU helper
> for Rust callers.
>
> To achive this:
>
> 1- Move the srcu_readers_active() implementation from
> "kernel/rcu/srcutree.c" to "include/linux/srcutree.h".
>
> 2- Implement a matching srcu_readers_active() in
> "include/linux/srcutiny.h" and use it on the existing open-coded
> WARN_ON() check in cleanup_srcu_struct().
>
> Reviewed-by: Paul E. McKenney <paulmck@xxxxxxxxxx>
> Signed-off-by: Onur Özkan <work@xxxxxxxxxxxxx>
Reviewed-by: Gary Guo <gary@xxxxxxxxxxx>
> ---
> include/linux/srcutiny.h | 13 +++++++++++++
> include/linux/srcutree.h | 24 ++++++++++++++++++++++++
> kernel/rcu/srcutiny.c | 2 +-
> kernel/rcu/srcutree.c | 25 -------------------------
> rust/helpers/srcu.c | 5 +++++
> 5 files changed, 43 insertions(+), 26 deletions(-)