History

kernel/cpu: Allow non-zero CPU to be primary for suspend / kexec freeze

This patch provides an arch option, ARCH_SUSPEND_NONZERO_CPU, to opt-in to allowing suspend to occur on one of the housekeeping CPUs rather than hardcoded CPU0. This will allow CPU0 to be a nohz_full CPU with a later change. It may be possible for platforms with hardware/firmware restrictions on suspend/wake effectively support this by handing off the final stage to CPU0 when kernel housekeeping is no longer required. Another option is to make housekeeping / nohz_full mask dynamic at runtime, but the complexity could not be justified at this time.

Nicholas Piggin committed 7 years ago

Commit 9ca12ac1 parent 2f1a6fb4 files · +28 −2Browse files

Showing the changes to include/linux (1 of 4 files). Show all

Unified · Split

include/linux/cpu.h+6−1
@@ -140,7 +140,12 @@ extern void enable_nonboot_cpus(void); · 139 unmodified lines
140140
141141 static inline int suspend_disable_secondary_cpus(void)
142142 {
143− return freeze_secondary_cpus(0);
143+ int cpu = 0;
144+
145+ if (IS_ENABLED(CONFIG_PM_SLEEP_SMP_NONZERO_CPU))
146+ cpu = -1;
147+
148+ return freeze_secondary_cpus(cpu);
144149 }
145150 static inline void suspend_enable_secondary_cpus(void)
146151 {

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t