Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

sched: Make nr_iowait_cpu() return 32-bit value

Runqueue ->nr_iowait counters are 32-bit anyway.

Propagate 32-bitness into other code, but don't try too hard.

Signed-off-by: Alexey Dobriyan <adobriyan@gmail.com>
Signed-off-by: Ingo Molnar <mingo@kernel.org>
Link: https://lore.kernel.org/r/20210422200228.1423391-3-adobriyan@gmail.com

authored by

Alexey Dobriyan and committed by
Ingo Molnar
8fc2858e 97455168

+5 -5
+3 -3
drivers/cpuidle/governors/menu.c
··· 117 117 int interval_ptr; 118 118 }; 119 119 120 - static inline int which_bucket(u64 duration_ns, unsigned long nr_iowaiters) 120 + static inline int which_bucket(u64 duration_ns, unsigned int nr_iowaiters) 121 121 { 122 122 int bucket = 0; 123 123 ··· 150 150 * to be, the higher this multiplier, and thus the higher 151 151 * the barrier to go to an expensive C state. 152 152 */ 153 - static inline int performance_multiplier(unsigned long nr_iowaiters) 153 + static inline int performance_multiplier(unsigned int nr_iowaiters) 154 154 { 155 155 /* for IO wait tasks (per cpu!) we add 10x each */ 156 156 return 1 + 10 * nr_iowaiters; ··· 270 270 unsigned int predicted_us; 271 271 u64 predicted_ns; 272 272 u64 interactivity_req; 273 - unsigned long nr_iowaiters; 273 + unsigned int nr_iowaiters; 274 274 ktime_t delta, delta_tick; 275 275 int i, idx; 276 276
+1 -1
include/linux/sched/stat.h
··· 20 20 extern unsigned int nr_running(void); 21 21 extern bool single_task_running(void); 22 22 extern unsigned int nr_iowait(void); 23 - extern unsigned long nr_iowait_cpu(int cpu); 23 + extern unsigned int nr_iowait_cpu(int cpu); 24 24 25 25 static inline int sched_info_on(void) 26 26 {
+1 -1
kernel/sched/core.c
··· 4739 4739 * it does become runnable. 4740 4740 */ 4741 4741 4742 - unsigned long nr_iowait_cpu(int cpu) 4742 + unsigned int nr_iowait_cpu(int cpu) 4743 4743 { 4744 4744 return atomic_read(&cpu_rq(cpu)->nr_iowait); 4745 4745 }