Skip to contentSkip to conversation

Add irqsave to spinlocks in call function single interrupt

PATCH In review Alan D. Brunelle 2 participants 2 messages Mar 17, 2008

lore
Share & tools
lore
#0 lore raw

PATCH 1/2 Add irqsave to spinlocks in call function single interrupt

---
 kernel/smp.c |    5 +++--
 1 files changed, 3 insertions(+), 2 deletions(-)
kernel/smp.c +3 -2
index 852abd3..7232e1c 100644
@@ -24,12 +24,13 @@ void __cpuinit generic_init_call_single_data(void)
 void generic_smp_call_function_single_interrupt(void)
 {
 	struct call_single_queue *q;
+	unsigned long flags;
 	LIST_HEAD(list);
 
 	q = &__get_cpu_var(call_single_queue);
-	spin_lock(&q->lock);
+	spin_lock_irqsave(&q->lock, flags);
 	list_replace_init(&q->list, &list);
-	spin_unlock(&q->lock);
+	spin_unlock_irqrestore(&q->lock, flags);
 
 	while (!list_empty(&list)) {
 		struct call_single_data *data;
Signature · 1 line
1.5.2.5
#1 lore raw
Quoted 16 lines · Alan D. Brunelle
---
 kernel/smp.c |    5 +++--
 1 files changed, 3 insertions(+), 2 deletions(-)
kernel/smp.c +1 -0
index 852abd3..7232e1c 100644
@@ -24,12 +24,13 @@ void __cpuinit generic_init_call_single_data(void)
 void generic_smp_call_function_single_interrupt(void)
 {
 	struct call_single_queue *q;
+	unsigned long flags;
 	LIST_HEAD(list);

kernel/smp.c void __cpuinit generic_init_call_single_data(void) · line 36

Quoted 10 lines
kernel/smp.c +2 -2
 
 	q = &__get_cpu_var(call_single_queue);
-	spin_lock(&q->lock);
+	spin_lock_irqsave(&q->lock, flags);
 	list_replace_init(&q->list, &list);
-	spin_unlock(&q->lock);
+	spin_unlock_irqrestore(&q->lock, flags);
 
 	while (!list_empty(&list)) {
 		struct call_single_data *data;

This is included in the later series.

Signature · 1 line
Jens Axboe