Skip to contentSkip to conversation

rcu: rcu_qs -- Use raise_softirq_irqoff to not save irqs twice

PATCH Superseded Cyrill Gorcunov 2 participants 3 messages Jan 24, 2019 RCU

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 rcu: rcu_qs -- Use raise_softirq_irqoff to not save irqs twice

The rcu_qs is disabling IRQs by self so no need to do the same in raise_softirq, instead we can save some cycles using raise_softirq_irqoff directly.

CC Paul E. McKenney <[email protected]>
---
 kernel/rcu/tiny.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
kernel/rcu/tiny.c +1 -1
Index: linux-next.git/kernel/rcu/tiny.c
===================================================================
@@ -65,7 +65,7 @@ void rcu_qs(void)
 	local_irq_save(flags);
 	if (rcu_ctrlblk.donetail != rcu_ctrlblk.curtail) {
 		rcu_ctrlblk.donetail = rcu_ctrlblk.curtail;
-		raise_softirq(RCU_SOFTIRQ);
+		raise_softirq_irqoff(RCU_SOFTIRQ);
 	}
 	local_irq_restore(flags);
 }

Subject: [PATCH]

#1 lore raw

PATCH v2 1/1 rcu: rcu_qs -- Use raise_softirq_irqoff to not save irqs twice

The rcu_qs is disabling IRQs by self so no need to do the same in raise_softirq but instead we can save some cycles using raise_softirq_irqoff directly.

CC Paul E. McKenney <[email protected]>

---
The prev patch body has been screwed, sorry.

 kernel/rcu/tiny.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
kernel/rcu/tiny.c +1 -1
Index: linux-next.git/kernel/rcu/tiny.c
===================================================================
@@ -65,7 +65,7 @@ void rcu_qs(void)
 	local_irq_save(flags);
 	if (rcu_ctrlblk.donetail != rcu_ctrlblk.curtail) {
 		rcu_ctrlblk.donetail = rcu_ctrlblk.curtail;
-		raise_softirq(RCU_SOFTIRQ);
+		raise_softirq_irqoff(RCU_SOFTIRQ);
 	}
 	local_irq_restore(flags);
 }
#2 lore raw
Quoted 5 lines · Cyrill Gorcunov

The rcu_qs is disabling IRQs by self so no need to do the same in raise_softirq but instead we can save some cycles using raise_softirq_irqoff directly.

CC Paul E. McKenney <[email protected]>

Good eyes, good combo optimization of both space and time, thank you!!!

Queued, most likely for v5.2.

Thanx, Paul

Quoted 20 lines

---
The prev patch body has been screwed, sorry.

 kernel/rcu/tiny.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Index: linux-next.git/kernel/rcu/tiny.c
===================================================================

kernel/rcu/tiny.c +1 -1
@@ -65,7 +65,7 @@ void rcu_qs(void)
 	local_irq_save(flags);
 	if (rcu_ctrlblk.donetail != rcu_ctrlblk.curtail) {
 		rcu_ctrlblk.donetail = rcu_ctrlblk.curtail;
-		raise_softirq(RCU_SOFTIRQ);
+		raise_softirq_irqoff(RCU_SOFTIRQ);
 	}
 	local_irq_restore(flags);
 }