From: Song Shuai <hidden> Date: 2023-05-25 02:57:54
During hibernation or restoration, freeze_secondary_cpus
checks num_online_cpus via BUG_ON, and the subsequent
save_processor_state also does the checking with WARN_ON.
So remove the unnecessary checking in save_processor_state
for ARM,arm64,riscv,xtensa architechtures.
Song Shuai (4):
ARM: hibernate: remove WARN_ON in save_processor_state
arm64: hibernate: remove WARN_ON in save_processor_state
riscv: hibernate: remove WARN_ON in save_processor_state
xtensa: hibernate: remove WARN_ON in save_processor_state
arch/arm/kernel/hibernate.c | 1 -
arch/arm64/kernel/hibernate.c | 1 -
arch/riscv/kernel/hibernate.c | 1 -
arch/xtensa/kernel/hibernate.c | 1 -
4 files changed, 4 deletions(-)
--
2.20.1
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
From: Song Shuai <hidden> Date: 2023-05-25 02:57:53
During hibernation or restoration, freeze_secondary_cpus
checks num_online_cpus via BUG_ON, and the subsequent
save_processor_state also does the checking with WARN_ON.
So remove the unnecessary checking in save_processor_state.
Signed-off-by: Song Shuai <redacted>
---
arch/arm64/kernel/hibernate.c | 1 -
1 file changed, 1 deletion(-)
@@ -99,7 +99,6 @@ int pfn_is_nosave(unsigned long pfn)voidnotracesave_processor_state(void){-WARN_ON(num_online_cpus()!=1);}voidnotracerestore_processor_state(void)
--
2.20.1
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
From: Song Shuai <hidden> Date: 2023-05-25 02:58:01
During hibernation or restoration, freeze_secondary_cpus
checks num_online_cpus via BUG_ON, and the subsequent
save_processor_state also does the checking with WARN_ON.
So remove the unnecessary checking in save_processor_state.
Signed-off-by: Song Shuai <redacted>
---
arch/arm/kernel/hibernate.c | 1 -
1 file changed, 1 deletion(-)
From: Song Shuai <hidden> Date: 2023-05-25 02:58:01
During hibernation or restoration, freeze_secondary_cpus
checks num_online_cpus via BUG_ON, and the subsequent
save_processor_state also does the checking with WARN_ON.
So remove the unnecessary checking in save_processor_state.
Signed-off-by: Song Shuai <redacted>
---
arch/riscv/kernel/hibernate.c | 1 -
1 file changed, 1 deletion(-)
@@ -119,7 +119,6 @@ int pfn_is_nosave(unsigned long pfn)voidnotracesave_processor_state(void){-WARN_ON(num_online_cpus()!=1);}voidnotracerestore_processor_state(void)
--
2.20.1
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
From: Song Shuai <hidden> Date: 2023-05-25 02:58:04
During hibernation or restoration, freeze_secondary_cpus
checks num_online_cpus via BUG_ON, and the subsequent
save_processor_state also does the checking with WARN_ON.
So remove the unnecessary checking in save_processor_state.
Signed-off-by: Song Shuai <redacted>
---
arch/xtensa/kernel/hibernate.c | 1 -
1 file changed, 1 deletion(-)
@@ -14,7 +14,6 @@ int pfn_is_nosave(unsigned long pfn)voidnotracesave_processor_state(void){-WARN_ON(num_online_cpus()!=1);#if XTENSA_HAVE_COPROCESSORSlocal_coprocessors_flush_release_all();#endif
--
2.20.1
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
From: Will Deacon <will@kernel.org> Date: 2023-06-05 14:29:09
On Thu, May 25, 2023 at 10:55:53AM +0800, Song Shuai wrote:
During hibernation or restoration, freeze_secondary_cpus
checks num_online_cpus via BUG_ON, and the subsequent
save_processor_state also does the checking with WARN_ON.
So remove the unnecessary checking in save_processor_state.
This is a very terse summary of why this is safe.
Looking at the code, freeze_secondary_cpus() does indeed check
num_online_cpus(), or it returns an error which then causes the hibernation
to fail. However, this is all in the CONFIG_PM_SLEEP_SMP=y case and it's
far less clear whether your assertion is true if that option is disabled.
Please can you describe your reasoning in more detail, and cover the case
where CONFIG_PM_SLEEP_SMP=n as well, please?
Will
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
From: Song Shuai <hidden> Date: 2023-06-07 03:00:58
在 2023/6/5 22:28, Will Deacon 写道:
On Thu, May 25, 2023 at 10:55:53AM +0800, Song Shuai wrote:
quoted
During hibernation or restoration, freeze_secondary_cpus
checks num_online_cpus via BUG_ON, and the subsequent
save_processor_state also does the checking with WARN_ON.
So remove the unnecessary checking in save_processor_state.
This is a very terse summary of why this is safe.
Looking at the code, freeze_secondary_cpus() does indeed check
num_online_cpus(), or it returns an error which then causes the hibernation
to fail. However, this is all in the CONFIG_PM_SLEEP_SMP=y case and it's
far less clear whether your assertion is true if that option is disabled.
Please can you describe your reasoning in more detail, and cover the case
where CONFIG_PM_SLEEP_SMP=n as well, please?
With HIBERNATION enabled, the sole possible condition to disable CONFIG_PM_SLEEP_SMP
is !SMP where num_online_cpus is always 1. We also don't have to check it in save_processor_state.
From: Will Deacon <will@kernel.org> Date: 2023-06-08 17:27:20
On Wed, Jun 07, 2023 at 11:00:08AM +0800, Song Shuai wrote:
在 2023/6/5 22:28, Will Deacon 写道:
quoted
On Thu, May 25, 2023 at 10:55:53AM +0800, Song Shuai wrote:
quoted
During hibernation or restoration, freeze_secondary_cpus
checks num_online_cpus via BUG_ON, and the subsequent
save_processor_state also does the checking with WARN_ON.
So remove the unnecessary checking in save_processor_state.
This is a very terse summary of why this is safe.
Looking at the code, freeze_secondary_cpus() does indeed check
num_online_cpus(), or it returns an error which then causes the hibernation
to fail. However, this is all in the CONFIG_PM_SLEEP_SMP=y case and it's
far less clear whether your assertion is true if that option is disabled.
Please can you describe your reasoning in more detail, and cover the case
where CONFIG_PM_SLEEP_SMP=n as well, please?
With HIBERNATION enabled, the sole possible condition to disable
CONFIG_PM_SLEEP_SMP
is !SMP where num_online_cpus is always 1. We also don't have to check it in
save_processor_state.