Commit 97455168 authored by Alexey Dobriyan's avatar Alexey Dobriyan Committed by Ingo Molnar

sched: Make nr_iowait() return 32-bit value

Creating 2**32 tasks to wait in D-state is impossible and wasteful.

Return "unsigned int" and save on REX prefixes.
Signed-off-by: default avatarAlexey Dobriyan <adobriyan@gmail.com>
Signed-off-by: default avatarIngo Molnar <mingo@kernel.org>
Link: https://lore.kernel.org/r/20210422200228.1423391-2-adobriyan@gmail.com
parent 01aee8fd
...@@ -201,7 +201,7 @@ static int show_stat(struct seq_file *p, void *v) ...@@ -201,7 +201,7 @@ static int show_stat(struct seq_file *p, void *v)
"btime %llu\n" "btime %llu\n"
"processes %lu\n" "processes %lu\n"
"procs_running %u\n" "procs_running %u\n"
"procs_blocked %lu\n", "procs_blocked %u\n",
nr_context_switches(), nr_context_switches(),
(unsigned long long)boottime.tv_sec, (unsigned long long)boottime.tv_sec,
total_forks, total_forks,
......
...@@ -19,7 +19,7 @@ DECLARE_PER_CPU(unsigned long, process_counts); ...@@ -19,7 +19,7 @@ DECLARE_PER_CPU(unsigned long, process_counts);
extern int nr_processes(void); extern int nr_processes(void);
extern unsigned int nr_running(void); extern unsigned int nr_running(void);
extern bool single_task_running(void); extern bool single_task_running(void);
extern unsigned long nr_iowait(void); extern unsigned int nr_iowait(void);
extern unsigned long nr_iowait_cpu(int cpu); extern unsigned long nr_iowait_cpu(int cpu);
static inline int sched_info_on(void) static inline int sched_info_on(void)
......
...@@ -4774,9 +4774,9 @@ unsigned long nr_iowait_cpu(int cpu) ...@@ -4774,9 +4774,9 @@ unsigned long nr_iowait_cpu(int cpu)
* Task CPU affinities can make all that even more 'interesting'. * Task CPU affinities can make all that even more 'interesting'.
*/ */
unsigned long nr_iowait(void) unsigned int nr_iowait(void)
{ {
unsigned long i, sum = 0; unsigned int i, sum = 0;
for_each_possible_cpu(i) for_each_possible_cpu(i)
sum += nr_iowait_cpu(i); sum += nr_iowait_cpu(i);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment