Unverified Commit e829bca6 authored by openeuler-ci-bot's avatar openeuler-ci-bot Committed by Gitee
Browse files

!8057 v8 arm64: Allow CPU0 to be nohz_full

Merge Pull Request from: @ci-robot 
 
PR sync from: Xiongfeng Wang <wangxiongfeng2@huawei.com>
https://mailweb.openeuler.org/hyperkitty/list/kernel@openeuler.org/message/OXLP76DAUJNREZQGCJUAS3DOJ5SCSRSW/ 
Changelog:
	v1->v2: change __setup() to early_param()
	v2->v3: fix kabi because #include <linux/sched/isolation.h>
					modify defconfig
	v3->v4: fix riscv compile error: move support_cpu0_nohz_full to tick.h
	v4->v5: fix kabi change
	v5->v6: Only check whether there exists only one online housekeeping CPU
	v6->v7: modify comments and commit message
	v7->v8: change BUG_ON(1) to BUG()

Xiongfeng Wang (4):
  isolation: Do not check whether housekeeping CPUs are present
  isolation: Check whether there exists a housekeeping CPU online
  arm64: Kconfig: select ARCH_SUSPEND_NONZERO_CPU by default
  arm64: defconfig: Enable CONFIG_ARCH_SUSPEND_NONZERO_CPU and
    CONFIG_ARCH_SUSPEND_NONZERO_CPU


-- 
2.30.0
 
https://gitee.com/openeuler/kernel/issues/I9NR7Q 
 
Link:https://gitee.com/openeuler/kernel/pulls/8057

 

Reviewed-by: default avatarXie XiuQi <xiexiuqi@huawei.com>
Reviewed-by: default avatarZucheng Zheng <zhengzucheng@huawei.com>
Signed-off-by: default avatarJialin Zhang <zhangjialin11@huawei.com>
parents a4e60eb1 fd9ea6a9
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -2306,6 +2306,9 @@ config ARCH_HIBERNATION_HEADER
config ARCH_SUSPEND_POSSIBLE
	def_bool y

config ARCH_SUSPEND_NONZERO_CPU
	def_bool y

endmenu

menu "CPU Power Management"
+2 −0
Original line number Diff line number Diff line
@@ -586,6 +586,7 @@ CONFIG_HIBERNATION_SNAPSHOT_DEV=y
CONFIG_PM_STD_PARTITION=""
CONFIG_PM_SLEEP=y
CONFIG_PM_SLEEP_SMP=y
CONFIG_PM_SLEEP_SMP_NONZERO_CPU=y
# CONFIG_PM_AUTOSLEEP is not set
# CONFIG_PM_WAKELOCKS is not set
CONFIG_PM=y
@@ -604,6 +605,7 @@ CONFIG_CPU_PM=y
CONFIG_ARCH_HIBERNATION_POSSIBLE=y
CONFIG_ARCH_HIBERNATION_HEADER=y
CONFIG_ARCH_SUSPEND_POSSIBLE=y
CONFIG_ARCH_SUSPEND_NONZERO_CPU=y
# end of Power management options

#
+4 −1
Original line number Diff line number Diff line
@@ -18,6 +18,9 @@
#include <linux/compiler.h>
#include <linux/cpumask.h>
#include <linux/cpuhotplug.h>
#ifndef __GENKSYMS__
#include <linux/tick.h>
#endif

struct device;
struct device_node;
@@ -163,7 +166,7 @@ static inline int suspend_disable_secondary_cpus(void)
{
	int cpu = 0;

	if (IS_ENABLED(CONFIG_PM_SLEEP_SMP_NONZERO_CPU))
	if (support_cpu0_nohz_full && IS_ENABLED(CONFIG_PM_SLEEP_SMP_NONZERO_CPU))
		cpu = -1;

	return freeze_secondary_cpus(cpu);
+2 −0
Original line number Diff line number Diff line
@@ -26,6 +26,7 @@ extern bool housekeeping_enabled(enum hk_flags flags);
extern void housekeeping_affine(struct task_struct *t, enum hk_flags flags);
extern bool housekeeping_test_cpu(int cpu, enum hk_flags flags);
extern void __init housekeeping_init(void);
extern void check_housekeeping_cpu_online(void);

#else

@@ -48,6 +49,7 @@ static inline bool housekeeping_enabled(enum hk_flags flags)
static inline void housekeeping_affine(struct task_struct *t,
				       enum hk_flags flags) { }
static inline void housekeeping_init(void) { }
static inline void check_housekeeping_cpu_online(void) { }
#endif /* CONFIG_CPU_ISOLATION */

static inline bool housekeeping_cpu(int cpu, enum hk_flags flags)
+2 −0
Original line number Diff line number Diff line
@@ -41,8 +41,10 @@ extern void tick_irq_enter(void);
#  ifndef arch_needs_cpu
#   define arch_needs_cpu() (0)
#  endif
extern bool support_cpu0_nohz_full;
# else
static inline void tick_irq_enter(void) { }
#define support_cpu0_nohz_full 0
#endif

#if defined(CONFIG_GENERIC_CLOCKEVENTS_BROADCAST) && defined(CONFIG_TICK_ONESHOT)
Loading