On Mon, Aug 19, 2024 at 12:59:31PM -0400, Kent Overstreet wrote:
> this assertion appears to have been entirely unnecessary
> 
> Signed-off-by: Kent Overstreet <kent.overstr...@linux.dev>

Please also adjust the comments.  Or just take this from the -rcu tree's
"dev" branch, which is shown at the end of this email:

e0a917e08b9b ("rcu: Permit start_poll_synchronize_rcu*() with interrupts 
disabled")

> ---
>  kernel/rcu/tree.c | 1 -
>  1 file changed, 1 deletion(-)
> 
> diff --git a/kernel/rcu/tree.c b/kernel/rcu/tree.c
> index e641cc681901..52f9f0bf1b8e 100644
> --- a/kernel/rcu/tree.c
> +++ b/kernel/rcu/tree.c
> @@ -4119,7 +4119,6 @@ static void start_poll_synchronize_rcu_common(void)
>       struct rcu_data *rdp;
>       struct rcu_node *rnp;
>  
> -     lockdep_assert_irqs_enabled();
>       local_irq_save(flags);
>       rdp = this_cpu_ptr(&rcu_data);
>       rnp = rdp->mynode;
> -- 
> 2.45.2
> 

------------------------------------------------------------------------

commit e0a917e08b9b39eee5870738250d0b8b10272dbe
Author: Paul E. McKenney <paul...@kernel.org>
Date:   Fri Aug 16 14:22:48 2024 -0700

    rcu: Permit start_poll_synchronize_rcu*() with interrupts disabled
    
    The header comment for both start_poll_synchronize_rcu() and
    start_poll_synchronize_rcu_full() state that interrupts must be enabled
    when calling these two functions, and there is a lockdep assertion in
    start_poll_synchronize_rcu_common() enforcing this restriction.  However,
    there is no need for this restrictions, as can be seen in call_rcu(),
    which does wakeups when interrupts are disabled.
    
    This commit therefore removes the lockdep assertion and the comments.
    
    Reported-by: Kent Overstreet <kent.overstr...@linux.dev>
    Signed-off-by: Paul E. McKenney <paul...@kernel.org>

diff --git a/kernel/rcu/tree.c b/kernel/rcu/tree.c
index 36b207918158c..47c753ae9bbcd 100644
--- a/kernel/rcu/tree.c
+++ b/kernel/rcu/tree.c
@@ -4103,7 +4103,6 @@ static void start_poll_synchronize_rcu_common(void)
        struct rcu_data *rdp;
        struct rcu_node *rnp;
 
-       lockdep_assert_irqs_enabled();
        local_irq_save(flags);
        rdp = this_cpu_ptr(&rcu_data);
        rnp = rdp->mynode;
@@ -4128,9 +4127,6 @@ static void start_poll_synchronize_rcu_common(void)
  * grace period has elapsed in the meantime.  If the needed grace period
  * is not already slated to start, notifies RCU core of the need for that
  * grace period.
- *
- * Interrupts must be enabled for the case where it is necessary to awaken
- * the grace-period kthread.
  */
 unsigned long start_poll_synchronize_rcu(void)
 {
@@ -4151,9 +4147,6 @@ EXPORT_SYMBOL_GPL(start_poll_synchronize_rcu);
  * grace period (whether normal or expedited) has elapsed in the meantime.
  * If the needed grace period is not already slated to start, notifies
  * RCU core of the need for that grace period.
- *
- * Interrupts must be enabled for the case where it is necessary to awaken
- * the grace-period kthread.
  */
 void start_poll_synchronize_rcu_full(struct rcu_gp_oldstate *rgosp)
 {

Reply via email to