File tree Expand file tree Collapse file tree 1 file changed +6
-2
lines changed Expand file tree Collapse file tree 1 file changed +6
-2
lines changed Original file line number Diff line number Diff line change @@ -78,23 +78,27 @@ struct pcpu_freelist_node *pcpu_freelist_pop(struct pcpu_freelist *s)
78
78
{
79
79
struct pcpu_freelist_head * head ;
80
80
struct pcpu_freelist_node * node ;
81
+ unsigned long flags ;
81
82
int orig_cpu , cpu ;
82
83
84
+ local_irq_save (flags );
83
85
orig_cpu = cpu = raw_smp_processor_id ();
84
86
while (1 ) {
85
87
head = per_cpu_ptr (s -> freelist , cpu );
86
88
raw_spin_lock (& head -> lock );
87
89
node = head -> first ;
88
90
if (node ) {
89
91
head -> first = node -> next ;
90
- raw_spin_unlock (& head -> lock );
92
+ raw_spin_unlock_irqrestore (& head -> lock , flags );
91
93
return node ;
92
94
}
93
95
raw_spin_unlock (& head -> lock );
94
96
cpu = cpumask_next (cpu , cpu_possible_mask );
95
97
if (cpu >= nr_cpu_ids )
96
98
cpu = 0 ;
97
- if (cpu == orig_cpu )
99
+ if (cpu == orig_cpu ) {
100
+ local_irq_restore (flags );
98
101
return NULL ;
102
+ }
99
103
}
100
104
}
You can’t perform that action at this time.
0 commit comments