Skip to contentSkip to conversation

rt/threadirqs: don't need to save irqs in do_hardirq()

PATCH In review Frederic Weisbecker 3 participants 5 messages Feb 12, 2009 IRQ

lore
Share & tools
lore
#0 lore raw

PATCH 1/2 rt/threadirqs: don't need to save irqs in do_hardirq()

do_hardirq() has only one caller do_irqd() in a path where irq are already disabled. So we don't need to save irqs while holding desc->lock

Replace spin_lock_irqsave by spin_lock.

---
 kernel/irq/manage.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)
kernel/irq/manage.c +2 -2
index ed7c5e3..6e9baf8 100644
@@ -905,7 +905,7 @@ static void do_hardirq(struct irq_desc *desc)
 {
 	unsigned long flags;
 
-	spin_lock_irqsave(&desc->lock, flags);
+	spin_lock(&desc->lock);
 
 	if (!(desc->status & IRQ_INPROGRESS))
 		goto out;
@@ -921,7 +921,7 @@ static void do_hardirq(struct irq_desc *desc)
 	else
 		thread_do_irq(desc);
  out:
-	spin_unlock_irqrestore(&desc->lock, flags);
+	spin_unlock(&desc->lock);
 
 	if (waitqueue_active(&desc->wait_for_handler))
 		wake_up(&desc->wait_for_handler);
Signature · 1 line
1.6.1
#1 lore raw

Em Thu, Feb 12, 2009 at 07:27:08PM +0100, Frederic Weisbecker escreveu:

Quoted 15 lines

do_hardirq() has only one caller do_irqd() in a path where irq are already disabled. So we don't need to save irqs while holding desc->lock

Replace spin_lock_irqsave by spin_lock.

---
 kernel/irq/manage.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)
kernel/irq/manage.c +0 -0
index ed7c5e3..6e9baf8 100644

kernel/irq/manage.c static void do_hardirq(struct irq_desc *desc) · line 906

Quoted 2 lines
kernel/irq/manage.c +0 -0
@@ -905,7 +905,7 @@ static void do_hardirq(struct irq_desc *desc)
 {
 	unsigned long flags;

Can flags be removed too?

Quoted 14 lines
kernel/irq/manage.c +2 -2
-	spin_lock_irqsave(&desc->lock, flags);
+	spin_lock(&desc->lock);
 
 	if (!(desc->status & IRQ_INPROGRESS))
 		goto out;
@@ -921,7 +921,7 @@ static void do_hardirq(struct irq_desc *desc)
 	else
 		thread_do_irq(desc);
  out:
-	spin_unlock_irqrestore(&desc->lock, flags);
+	spin_unlock(&desc->lock);
 
 	if (waitqueue_active(&desc->wait_for_handler))
 		wake_up(&desc->wait_for_handler);
#2 lore raw
Quoted 11 lines · Arnaldo Carvalho de Melo

Em Thu, Feb 12, 2009 at 07:27:08PM +0100, Frederic Weisbecker escreveu:

Quoted 10 lines

do_hardirq() has only one caller do_irqd() in a path where irq are already disabled. So we don't need to save irqs while holding desc->lock

Replace spin_lock_irqsave by spin_lock.

---
 kernel/irq/manage.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)
Quoted 9 lines

kernel/irq/manage.c static void do_hardirq(struct irq_desc *desc) · line 906

Quoted 7 lines
kernel/irq/manage.c +0 -0
index ed7c5e3..6e9baf8 100644
@@ -905,7 +905,7 @@ static void do_hardirq(struct irq_desc *desc)
 {
 	unsigned long flags;

Can flags be removed too?

Actually... I cheated.
Once the two patches were done, I saw the unused variable warning. So I remade the second patch to remove flags but..yes it should be on the first patch, I must confess...

Quoted 14 lines
Quoted 14 lines
kernel/irq/manage.c +2 -2
-	spin_lock_irqsave(&desc->lock, flags);
+	spin_lock(&desc->lock);
 
 	if (!(desc->status & IRQ_INPROGRESS))
 		goto out;
@@ -921,7 +921,7 @@ static void do_hardirq(struct irq_desc *desc)
 	else
 		thread_do_irq(desc);
  out:
-	spin_unlock_irqrestore(&desc->lock, flags);
+	spin_unlock(&desc->lock);
 
 	if (waitqueue_active(&desc->wait_for_handler))
 		wake_up(&desc->wait_for_handler);
#3 lore raw
Quoted 23 lines · Frederic Weisbecker
Quoted 11 lines · Arnaldo Carvalho de Melo

Em Thu, Feb 12, 2009 at 07:27:08PM +0100, Frederic Weisbecker escreveu:

Quoted 10 lines

do_hardirq() has only one caller do_irqd() in a path where irq are already disabled. So we don't need to save irqs while holding desc->lock

Replace spin_lock_irqsave by spin_lock.

---
 kernel/irq/manage.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)
Quoted 9 lines

kernel/irq/manage.c static void do_hardirq(struct irq_desc *desc) · line 906

Quoted 7 lines
kernel/irq/manage.c +0 -0
index ed7c5e3..6e9baf8 100644
@@ -905,7 +905,7 @@ static void do_hardirq(struct irq_desc *desc)
 {
 	unsigned long flags;

Can flags be removed too?

Quoted 3 lines

Actually... I cheated.
Once the two patches were done, I saw the unused variable warning. So I remade the second patch to remove flags but..yes it should be on the first patch, I must confess...

That's fine, I'll pull both of them in.

Thanks Frederic!

-- Steve

#4 lore raw

Em Thu, Feb 12, 2009 at 06:37:16PM -0500, Steven Rostedt escreveu:

Quoted 26 lines · Frederic Weisbecker
Quoted 24 lines · Arnaldo Carvalho de Melo
Quoted 20 lines

Em Thu, Feb 12, 2009 at 07:27:08PM +0100, Frederic Weisbecker escreveu:

Quoted 15 lines

do_hardirq() has only one caller do_irqd() in a path where irq are already disabled. So we don't need to save irqs while holding desc->lock

Replace spin_lock_irqsave by spin_lock.

---
 kernel/irq/manage.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)
kernel/irq/manage.c +0 -0
index ed7c5e3..6e9baf8 100644

kernel/irq/manage.c static void do_hardirq(struct irq_desc *desc) · line 906

Quoted 2 lines
kernel/irq/manage.c +0 -0
@@ -905,7 +905,7 @@ static void do_hardirq(struct irq_desc *desc)
 {
 	unsigned long flags;

Can flags be removed too?

Quoted 7 lines
Quoted 3 lines

Actually... I cheated.
Once the two patches were done, I saw the unused variable warning. So I remade the second patch to remove flags but..yes it should be on the first patch, I must confess...

That's fine, I'll pull both of them in.

Thanks Frederic!

Ditto, that was just a follow up thingy, nothing against the change :-)

- Arnaldo