mirror of
https://github.com/AuxXxilium/linux_dsm_epyc7002.git
synced 2024-12-28 11:18:45 +07:00
a7fe5190c0
The function get_loadavg() returns almost always zero. To be more precise, statistically speaking for a total of 1023379 times passing in the function, the load is equal to zero 1020728 times, greater than 100, 610 times, the remaining is between 0 and 5. In 2011, the get_loadavg() was removed from the Android tree because of the above [1]. At this time, the load was: unsigned long this_cpu_load(void) { struct rq *this = this_rq(); return this->cpu_load[0]; } In 2014, the code was changed by commit372ba8cb46
(cpuidle: menu: Lookup CPU runqueues less) and the load is: void get_iowait_load(unsigned long *nr_waiters, unsigned long *load) { struct rq *rq = this_rq(); *nr_waiters = atomic_read(&rq->nr_iowait); *load = rq->load.weight; } with the same result. Both measurements show using the load in this code path does no matter anymore. Removing it. [1]4dedd9f124
Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org> Acked-by: Mel Gorman <mgorman@suse.de> Acked-by: Peter Zijlstra (Intel) <peterz@infradead.org> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
41 lines
969 B
C
41 lines
969 B
C
/* SPDX-License-Identifier: GPL-2.0 */
|
|
#ifndef _LINUX_SCHED_STAT_H
|
|
#define _LINUX_SCHED_STAT_H
|
|
|
|
#include <linux/percpu.h>
|
|
|
|
/*
|
|
* Various counters maintained by the scheduler and fork(),
|
|
* exposed via /proc, sys.c or used by drivers via these APIs.
|
|
*
|
|
* ( Note that all these values are aquired without locking,
|
|
* so they can only be relied on in narrow circumstances. )
|
|
*/
|
|
|
|
extern unsigned long total_forks;
|
|
extern int nr_threads;
|
|
DECLARE_PER_CPU(unsigned long, process_counts);
|
|
extern int nr_processes(void);
|
|
extern unsigned long nr_running(void);
|
|
extern bool single_task_running(void);
|
|
extern unsigned long nr_iowait(void);
|
|
extern unsigned long nr_iowait_cpu(int cpu);
|
|
|
|
static inline int sched_info_on(void)
|
|
{
|
|
#ifdef CONFIG_SCHEDSTATS
|
|
return 1;
|
|
#elif defined(CONFIG_TASK_DELAY_ACCT)
|
|
extern int delayacct_on;
|
|
return delayacct_on;
|
|
#else
|
|
return 0;
|
|
#endif
|
|
}
|
|
|
|
#ifdef CONFIG_SCHEDSTATS
|
|
void force_schedstat_enabled(void);
|
|
#endif
|
|
|
|
#endif /* _LINUX_SCHED_STAT_H */
|