linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] rcu: in_irq() cleanup
@ 2021-09-28  0:21 Changbin Du
  2021-09-28 21:03 ` Paul E. McKenney
  0 siblings, 1 reply; 2+ messages in thread
From: Changbin Du @ 2021-09-28  0:21 UTC (permalink / raw)
  To: Paul E. McKenney, Josh Triplett; +Cc: rcu, linux-kernel, Changbin Du

Replace the obsolete and ambiguos macro in_irq() with new
macro in_hardirq().

Signed-off-by: Changbin Du <changbin.du@gmail.com>
---
 include/linux/rcutiny.h  | 2 +-
 kernel/rcu/tree.c        | 2 +-
 kernel/rcu/tree_plugin.h | 2 +-
 3 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/include/linux/rcutiny.h b/include/linux/rcutiny.h
index 9be015305f9f..858f4d429946 100644
--- a/include/linux/rcutiny.h
+++ b/include/linux/rcutiny.h
@@ -85,7 +85,7 @@ static inline void rcu_irq_enter_irqson(void) { }
 static inline void rcu_irq_exit(void) { }
 static inline void rcu_irq_exit_check_preempt(void) { }
 #define rcu_is_idle_cpu(cpu) \
-	(is_idle_task(current) && !in_nmi() && !in_irq() && !in_serving_softirq())
+	(is_idle_task(current) && !in_nmi() && !in_hardirq() && !in_serving_softirq())
 static inline void exit_rcu(void) { }
 static inline bool rcu_preempt_need_deferred_qs(struct task_struct *t)
 {
diff --git a/kernel/rcu/tree.c b/kernel/rcu/tree.c
index bce848e50512..b53dd00975ab 100644
--- a/kernel/rcu/tree.c
+++ b/kernel/rcu/tree.c
@@ -1471,7 +1471,7 @@ static void rcu_gp_kthread_wake(void)
 {
 	struct task_struct *t = READ_ONCE(rcu_state.gp_kthread);
 
-	if ((current == t && !in_irq() && !in_serving_softirq()) ||
+	if ((current == t && !in_hardirq() && !in_serving_softirq()) ||
 	    !READ_ONCE(rcu_state.gp_flags) || !t)
 		return;
 	WRITE_ONCE(rcu_state.gp_wake_time, jiffies);
diff --git a/kernel/rcu/tree_plugin.h b/kernel/rcu/tree_plugin.h
index d070059163d7..727bf14c9a63 100644
--- a/kernel/rcu/tree_plugin.h
+++ b/kernel/rcu/tree_plugin.h
@@ -642,7 +642,7 @@ static void rcu_read_unlock_special(struct task_struct *t)
 			   (IS_ENABLED(CONFIG_RCU_BOOST) && irqs_were_disabled &&
 			    t->rcu_blocked_node);
 		// Need to defer quiescent state until everything is enabled.
-		if (use_softirq && (in_irq() || (expboost && !irqs_were_disabled))) {
+		if (use_softirq && (in_hardirq() || (expboost && !irqs_were_disabled))) {
 			// Using softirq, safe to awaken, and either the
 			// wakeup is free or there is either an expedited
 			// GP in flight or a potential need to deboost.
-- 
2.32.0


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] rcu: in_irq() cleanup
  2021-09-28  0:21 [PATCH] rcu: in_irq() cleanup Changbin Du
@ 2021-09-28 21:03 ` Paul E. McKenney
  0 siblings, 0 replies; 2+ messages in thread
From: Paul E. McKenney @ 2021-09-28 21:03 UTC (permalink / raw)
  To: Changbin Du; +Cc: Josh Triplett, rcu, linux-kernel

On Tue, Sep 28, 2021 at 08:21:28AM +0800, Changbin Du wrote:
> Replace the obsolete and ambiguos macro in_irq() with new
> macro in_hardirq().
> 
> Signed-off-by: Changbin Du <changbin.du@gmail.com>

Queued for v5.17 (merge window after next), thank you!

							Thanx, Paul

> ---
>  include/linux/rcutiny.h  | 2 +-
>  kernel/rcu/tree.c        | 2 +-
>  kernel/rcu/tree_plugin.h | 2 +-
>  3 files changed, 3 insertions(+), 3 deletions(-)
> 
> diff --git a/include/linux/rcutiny.h b/include/linux/rcutiny.h
> index 9be015305f9f..858f4d429946 100644
> --- a/include/linux/rcutiny.h
> +++ b/include/linux/rcutiny.h
> @@ -85,7 +85,7 @@ static inline void rcu_irq_enter_irqson(void) { }
>  static inline void rcu_irq_exit(void) { }
>  static inline void rcu_irq_exit_check_preempt(void) { }
>  #define rcu_is_idle_cpu(cpu) \
> -	(is_idle_task(current) && !in_nmi() && !in_irq() && !in_serving_softirq())
> +	(is_idle_task(current) && !in_nmi() && !in_hardirq() && !in_serving_softirq())
>  static inline void exit_rcu(void) { }
>  static inline bool rcu_preempt_need_deferred_qs(struct task_struct *t)
>  {
> diff --git a/kernel/rcu/tree.c b/kernel/rcu/tree.c
> index bce848e50512..b53dd00975ab 100644
> --- a/kernel/rcu/tree.c
> +++ b/kernel/rcu/tree.c
> @@ -1471,7 +1471,7 @@ static void rcu_gp_kthread_wake(void)
>  {
>  	struct task_struct *t = READ_ONCE(rcu_state.gp_kthread);
>  
> -	if ((current == t && !in_irq() && !in_serving_softirq()) ||
> +	if ((current == t && !in_hardirq() && !in_serving_softirq()) ||
>  	    !READ_ONCE(rcu_state.gp_flags) || !t)
>  		return;
>  	WRITE_ONCE(rcu_state.gp_wake_time, jiffies);
> diff --git a/kernel/rcu/tree_plugin.h b/kernel/rcu/tree_plugin.h
> index d070059163d7..727bf14c9a63 100644
> --- a/kernel/rcu/tree_plugin.h
> +++ b/kernel/rcu/tree_plugin.h
> @@ -642,7 +642,7 @@ static void rcu_read_unlock_special(struct task_struct *t)
>  			   (IS_ENABLED(CONFIG_RCU_BOOST) && irqs_were_disabled &&
>  			    t->rcu_blocked_node);
>  		// Need to defer quiescent state until everything is enabled.
> -		if (use_softirq && (in_irq() || (expboost && !irqs_were_disabled))) {
> +		if (use_softirq && (in_hardirq() || (expboost && !irqs_were_disabled))) {
>  			// Using softirq, safe to awaken, and either the
>  			// wakeup is free or there is either an expedited
>  			// GP in flight or a potential need to deboost.
> -- 
> 2.32.0
> 

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2021-09-28 21:04 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-09-28  0:21 [PATCH] rcu: in_irq() cleanup Changbin Du
2021-09-28 21:03 ` Paul E. McKenney

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).