diff options
-rw-r--r-- | block/blk-softirq.c | 27 | ||||
-rw-r--r-- | include/linux/cpuhotplug.h | 1 |
2 files changed, 11 insertions, 17 deletions
diff --git a/block/blk-softirq.c b/block/blk-softirq.c index 53b1737e978d..96631e6a22b9 100644 --- a/block/blk-softirq.c +++ b/block/blk-softirq.c | |||
@@ -78,30 +78,21 @@ static int raise_blk_irq(int cpu, struct request *rq) | |||
78 | } | 78 | } |
79 | #endif | 79 | #endif |
80 | 80 | ||
81 | static int blk_cpu_notify(struct notifier_block *self, unsigned long action, | 81 | static int blk_softirq_cpu_dead(unsigned int cpu) |
82 | void *hcpu) | ||
83 | { | 82 | { |
84 | /* | 83 | /* |
85 | * If a CPU goes away, splice its entries to the current CPU | 84 | * If a CPU goes away, splice its entries to the current CPU |
86 | * and trigger a run of the softirq | 85 | * and trigger a run of the softirq |
87 | */ | 86 | */ |
88 | if (action == CPU_DEAD || action == CPU_DEAD_FROZEN) { | 87 | local_irq_disable(); |
89 | int cpu = (unsigned long) hcpu; | 88 | list_splice_init(&per_cpu(blk_cpu_done, cpu), |
90 | 89 | this_cpu_ptr(&blk_cpu_done)); | |
91 | local_irq_disable(); | 90 | raise_softirq_irqoff(BLOCK_SOFTIRQ); |
92 | list_splice_init(&per_cpu(blk_cpu_done, cpu), | 91 | local_irq_enable(); |
93 | this_cpu_ptr(&blk_cpu_done)); | ||
94 | raise_softirq_irqoff(BLOCK_SOFTIRQ); | ||
95 | local_irq_enable(); | ||
96 | } | ||
97 | 92 | ||
98 | return NOTIFY_OK; | 93 | return 0; |
99 | } | 94 | } |
100 | 95 | ||
101 | static struct notifier_block blk_cpu_notifier = { | ||
102 | .notifier_call = blk_cpu_notify, | ||
103 | }; | ||
104 | |||
105 | void __blk_complete_request(struct request *req) | 96 | void __blk_complete_request(struct request *req) |
106 | { | 97 | { |
107 | int ccpu, cpu; | 98 | int ccpu, cpu; |
@@ -180,7 +171,9 @@ static __init int blk_softirq_init(void) | |||
180 | INIT_LIST_HEAD(&per_cpu(blk_cpu_done, i)); | 171 | INIT_LIST_HEAD(&per_cpu(blk_cpu_done, i)); |
181 | 172 | ||
182 | open_softirq(BLOCK_SOFTIRQ, blk_done_softirq); | 173 | open_softirq(BLOCK_SOFTIRQ, blk_done_softirq); |
183 | register_hotcpu_notifier(&blk_cpu_notifier); | 174 | cpuhp_setup_state_nocalls(CPUHP_BLOCK_SOFTIRQ_DEAD, |
175 | "block/softirq:dead", NULL, | ||
176 | blk_softirq_cpu_dead); | ||
184 | return 0; | 177 | return 0; |
185 | } | 178 | } |
186 | subsys_initcall(blk_softirq_init); | 179 | subsys_initcall(blk_softirq_init); |
diff --git a/include/linux/cpuhotplug.h b/include/linux/cpuhotplug.h index 2ca7b34871e0..d4274d51fe27 100644 --- a/include/linux/cpuhotplug.h +++ b/include/linux/cpuhotplug.h | |||
@@ -23,6 +23,7 @@ enum cpuhp_state { | |||
23 | CPUHP_ARM64_FPSIMD_DEAD, | 23 | CPUHP_ARM64_FPSIMD_DEAD, |
24 | CPUHP_ARM_OMAP_WAKE_DEAD, | 24 | CPUHP_ARM_OMAP_WAKE_DEAD, |
25 | CPUHP_IRQ_POLL_DEAD, | 25 | CPUHP_IRQ_POLL_DEAD, |
26 | CPUHP_BLOCK_SOFTIRQ_DEAD, | ||
26 | CPUHP_WORKQUEUE_PREP, | 27 | CPUHP_WORKQUEUE_PREP, |
27 | CPUHP_POWER_NUMA_PREPARE, | 28 | CPUHP_POWER_NUMA_PREPARE, |
28 | CPUHP_HRTIMERS_PREPARE, | 29 | CPUHP_HRTIMERS_PREPARE, |