Commit 63fd54e3 authored by Yu Jiahua's avatar Yu Jiahua Committed by Zheng Zengkai
Browse files

Revert "sysctl: Refactor IAS framework"

hulk inclusion
category: feature
bugzilla: https://gitee.com/openeuler/kernel/issues/I4QU5Z?from=project-issue


CVE: NA

--------------------------------

This patch revert ias feature from open-euler kernel.

This reverts commit 189fa7a4.

Signed-off-by: default avatarYu Jiahua <Yujiahua1@huawei.com>
Reviewed-by: default avatarChen Hui <judy.chenhui@huawei.com>
Signed-off-by: default avatarZheng Zengkai <zhengzengkai@huawei.com>
parent d9244bc3
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -557,7 +557,7 @@ extern int sysctl_panic_on_rcu_stall;
extern int sysctl_panic_on_stackoverflow;

extern bool crash_kexec_post_notifiers;
#ifdef CONFIG_IAS_SMART_IDLE
#ifdef CONFIG_IAS_SMART_HALT_POLL
extern unsigned long poll_threshold_ns;
#endif

+1 −1
Original line number Diff line number Diff line
@@ -103,7 +103,7 @@ int sched_energy_aware_handler(struct ctl_table *table, int write,
		void *buffer, size_t *lenp, loff_t *ppos);
#endif

#ifdef CONFIG_IAS_SMART_LOAD_TRACKING
#ifdef CONFIG_SCHED_OPTIMIZE_LOAD_TRACKING
extern int sysctl_blocked_averages(struct ctl_table *table, int write,
		  void __user *buffer, size_t *lenp, loff_t *ppos);
extern int sysctl_tick_update_load(struct ctl_table *table, int write,
+16 −20
Original line number Diff line number Diff line
@@ -774,6 +774,22 @@ config GENERIC_SCHED_CLOCK

menu "Scheduler features"

config SCHED_OPTIMIZE_LOAD_TRACKING
	bool "Optimize scheduler load tracking"
	default n
	help
	  Optimize scheduler load tracking, when load balance is not important
	  in system, we close some load tracking in tick and enqueue or dequeue
	  task, in this way, we can save some unnecessary cpu overhead.

config IAS_SMART_HALT_POLL
	bool "Enable smart halt poll"
	default n
	help
	  Before entering the real idle, polling for a while. if the current
	  task is set TIF_NEED_RESCHED during the polling process, it will
	  immediately break from the polling loop.

config UCLAMP_TASK
	bool "Enable utilization clamping for RT/FAIR tasks"
	depends on CPU_FREQ_GOV_SCHEDUTIL
@@ -823,26 +839,6 @@ config UCLAMP_BUCKETS_COUNT

	  If in doubt, use the default value.

menu "Intelligent aware scheduler"

config IAS_SMART_IDLE
	bool "Enable smart idle"
	default n
	help
	  Before entering the real idle, polling for a while. if the current
	  task is set TIF_NEED_RESCHED during the polling process, it will
	  immediately break from the polling loop.

config IAS_SMART_LOAD_TRACKING
	bool "Enable smart load tracking"
	default n
	help
	  Optimize scheduler load tracking, when load balance is not important
	  in system, we close some load tracking in tick and enqueue or dequeue
	  task, in this way, we can save some unnecessary cpu overhead.

endmenu

endmenu

#
+7 −7
Original line number Diff line number Diff line
@@ -44,7 +44,7 @@
unsigned int sysctl_sched_latency			= 6000000ULL;
static unsigned int normalized_sysctl_sched_latency	= 6000000ULL;

#ifdef CONFIG_IAS_SMART_LOAD_TRACKING
#ifdef CONFIG_SCHED_OPTIMIZE_LOAD_TRACKING
#define LANTENCY_MIN 10
#define LANTENCY_MAX 30
unsigned int sysctl_load_tracking_latency = LANTENCY_MIN;
@@ -3848,7 +3848,7 @@ static inline void update_load_avg(struct cfs_rq *cfs_rq, struct sched_entity *s
{
	u64 now = cfs_rq_clock_pelt(cfs_rq);
	int decayed;
#ifdef CONFIG_IAS_SMART_LOAD_TRACKING
#ifdef CONFIG_SCHED_OPTIMIZE_LOAD_TRACKING
	u64 delta;
#endif

@@ -3856,7 +3856,7 @@ static inline void update_load_avg(struct cfs_rq *cfs_rq, struct sched_entity *s
	 * Track task load average for carrying it to new CPU after migrated, and
	 * track group sched_entity load average for task_h_load calc in migration
	 */
#ifdef CONFIG_IAS_SMART_LOAD_TRACKING
#ifdef CONFIG_SCHED_OPTIMIZE_LOAD_TRACKING
	delta = now - se->avg.last_update_time;
	delta >>= sysctl_load_tracking_latency;

@@ -4681,7 +4681,7 @@ static void put_prev_entity(struct cfs_rq *cfs_rq, struct sched_entity *prev)
	cfs_rq->curr = NULL;
}

#ifdef CONFIG_IAS_SMART_LOAD_TRACKING
#ifdef CONFIG_SCHED_OPTIMIZE_LOAD_TRACKING
DEFINE_STATIC_KEY_TRUE(sched_tick_update_load);
static void set_tick_update_load(bool enabled)
{
@@ -4724,7 +4724,7 @@ entity_tick(struct cfs_rq *cfs_rq, struct sched_entity *curr, int queued)
	/*
	 * Ensure that runnable average is periodically updated.
	 */
#ifdef CONFIG_IAS_SMART_LOAD_TRACKING
#ifdef CONFIG_SCHED_OPTIMIZE_LOAD_TRACKING
	if (static_branch_likely(&sched_tick_update_load)) {
		update_load_avg(cfs_rq, curr, UPDATE_TG);
		update_cfs_group(curr);
@@ -8339,7 +8339,7 @@ static void attach_tasks(struct lb_env *env)
	rq_unlock(env->dst_rq, &rf);
}

#ifdef CONFIG_IAS_SMART_LOAD_TRACKING
#ifdef CONFIG_SCHED_OPTIMIZE_LOAD_TRACKING
DEFINE_STATIC_KEY_TRUE(sched_blocked_averages);

static void set_blocked_averages(bool enabled)
@@ -8575,7 +8575,7 @@ static void update_blocked_averages(int cpu)
	rq_lock_irqsave(rq, &rf);
	update_rq_clock(rq);

#ifdef CONFIG_IAS_SMART_LOAD_TRACKING
#ifdef CONFIG_SCHED_OPTIMIZE_LOAD_TRACKING
	if (!static_branch_likely(&sched_blocked_averages)) {
		rq_unlock_irqrestore(rq, &rf);
		return;
+6 −6
Original line number Diff line number Diff line
@@ -13,7 +13,7 @@
/* Linker adds these: start and end of __cpuidle functions */
extern char __cpuidle_text_start[], __cpuidle_text_end[];

#ifdef CONFIG_IAS_SMART_IDLE
#ifdef CONFIG_IAS_SMART_HALT_POLL
/*
 * Poll_threshold_ns indicates the maximum polling time before
 * entering real idle.
@@ -60,7 +60,7 @@ static int __init cpu_idle_nopoll_setup(char *__unused)
__setup("hlt", cpu_idle_nopoll_setup);
#endif

#ifdef CONFIG_IAS_SMART_IDLE
#ifdef CONFIG_IAS_SMART_HALT_POLL
static void smart_idle_poll(void)
{
	unsigned long poll_duration = poll_threshold_ns;
@@ -86,7 +86,7 @@ static noinline int __cpuidle cpu_idle_poll(void)
	stop_critical_timings();
	rcu_idle_enter();
	local_irq_enable();
#ifdef CONFIG_IAS_SMART_IDLE
#ifdef CONFIG_IAS_SMART_HALT_POLL
	smart_idle_poll();
#endif

@@ -292,7 +292,7 @@ static void cpuidle_idle_call(void)
static void do_idle(void)
{
	int cpu = smp_processor_id();
#ifdef CONFIG_IAS_SMART_IDLE
#ifdef CONFIG_IAS_SMART_HALT_POLL
	unsigned long idle_poll_flag = poll_threshold_ns;
#endif
	/*
@@ -327,7 +327,7 @@ static void do_idle(void)
		 * broadcast device expired for us, we don't want to go deep
		 * idle as we know that the IPI is going to arrive right away.
		 */
#ifdef CONFIG_IAS_SMART_IDLE
#ifdef CONFIG_IAS_SMART_HALT_POLL
		if (cpu_idle_force_poll || tick_check_broadcast_expired() ||
			  idle_poll_flag) {
#else
@@ -335,7 +335,7 @@ static void do_idle(void)
#endif
			tick_nohz_idle_restart_tick();
			cpu_idle_poll();
#ifdef CONFIG_IAS_SMART_IDLE
#ifdef CONFIG_IAS_SMART_HALT_POLL
			idle_poll_flag = 0;
#endif
		} else {
Loading