diff options
author | Dennis Zhou <dennis@kernel.org> | 2018-12-18 11:42:27 -0500 |
---|---|---|
committer | Dennis Zhou <dennis@kernel.org> | 2018-12-18 12:04:08 -0500 |
commit | 6ab7d47bcbf0144a8cb81536c2cead4cde18acfe (patch) | |
tree | 600747ab67a2dafdf9375bc1933ff2ba55dcb9be | |
parent | 7566ec393f4161572ba6f11ad5171fd5d59b0fbd (diff) |
percpu: convert spin_lock_irq to spin_lock_irqsave.
From Michael Cree:
"Bisection lead to commit b38d08f3181c ("percpu: restructure
locking") as being the cause of lockups at initial boot on
the kernel built for generic Alpha.
On a suggestion by Tejun Heo that:
So, the only thing I can think of is that it's calling
spin_unlock_irq() while irq handling isn't set up yet.
Can you please try the followings?
1. Convert all spin_[un]lock_irq() to
spin_lock_irqsave/unlock_irqrestore()."
Fixes: b38d08f3181c ("percpu: restructure locking")
Reported-and-tested-by: Michael Cree <mcree@orcon.net.nz>
Acked-by: Tejun Heo <tj@kernel.org>
Signed-off-by: Dennis Zhou <dennis@kernel.org>
-rw-r--r-- | mm/percpu-km.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/mm/percpu-km.c b/mm/percpu-km.c index 38de70ab1a0d..0f643dc2dc65 100644 --- a/mm/percpu-km.c +++ b/mm/percpu-km.c | |||
@@ -50,6 +50,7 @@ static struct pcpu_chunk *pcpu_create_chunk(gfp_t gfp) | |||
50 | const int nr_pages = pcpu_group_sizes[0] >> PAGE_SHIFT; | 50 | const int nr_pages = pcpu_group_sizes[0] >> PAGE_SHIFT; |
51 | struct pcpu_chunk *chunk; | 51 | struct pcpu_chunk *chunk; |
52 | struct page *pages; | 52 | struct page *pages; |
53 | unsigned long flags; | ||
53 | int i; | 54 | int i; |
54 | 55 | ||
55 | chunk = pcpu_alloc_chunk(gfp); | 56 | chunk = pcpu_alloc_chunk(gfp); |
@@ -68,9 +69,9 @@ static struct pcpu_chunk *pcpu_create_chunk(gfp_t gfp) | |||
68 | chunk->data = pages; | 69 | chunk->data = pages; |
69 | chunk->base_addr = page_address(pages) - pcpu_group_offsets[0]; | 70 | chunk->base_addr = page_address(pages) - pcpu_group_offsets[0]; |
70 | 71 | ||
71 | spin_lock_irq(&pcpu_lock); | 72 | spin_lock_irqsave(&pcpu_lock, flags); |
72 | pcpu_chunk_populated(chunk, 0, nr_pages, false); | 73 | pcpu_chunk_populated(chunk, 0, nr_pages, false); |
73 | spin_unlock_irq(&pcpu_lock); | 74 | spin_unlock_irqrestore(&pcpu_lock, flags); |
74 | 75 | ||
75 | pcpu_stats_chunk_alloc(); | 76 | pcpu_stats_chunk_alloc(); |
76 | trace_percpu_create_chunk(chunk->base_addr); | 77 | trace_percpu_create_chunk(chunk->base_addr); |