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.
Showing the changes to include/linux (1 of 4 files). Show all
Unified · Split
| @@ -140,7 +140,12 @@ extern void enable_nonboot_cpus(void); · 139 unmodified lines | |||
| 140 | 140 | ||
| 141 | static inline int suspend_disable_secondary_cpus(void) | 141 | static inline int suspend_disable_secondary_cpus(void) |
| 142 | { | 142 | { |
| 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); | ||
| 144 | } | 149 | } |
| 145 | static inline void suspend_enable_secondary_cpus(void) | 150 | static inline void suspend_enable_secondary_cpus(void) |
| 146 | { | 151 | { |