Skip to content

Commit

Permalink
sched: Make nr_iowait() return 32-bit value
Browse files Browse the repository at this point in the history
Creating 2**32 tasks to wait in D-state is impossible and wasteful.

Return "unsigned int" and save on REX prefixes.

Signed-off-by: Alexey Dobriyan <[email protected]>
Signed-off-by: Ingo Molnar <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
  • Loading branch information
Alexey Dobriyan authored and Ingo Molnar committed May 12, 2021
1 parent 01aee8f commit 9745516
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion fs/proc/stat.c
Original file line number Diff line number Diff line change
Expand Up @@ -201,7 +201,7 @@ static int show_stat(struct seq_file *p, void *v)
"btime %llu\n"
"processes %lu\n"
"procs_running %u\n"
"procs_blocked %lu\n",
"procs_blocked %u\n",
nr_context_switches(),
(unsigned long long)boottime.tv_sec,
total_forks,
Expand Down
2 changes: 1 addition & 1 deletion include/linux/sched/stat.h
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ DECLARE_PER_CPU(unsigned long, process_counts);
extern int nr_processes(void);
extern unsigned int nr_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);

static inline int sched_info_on(void)
Expand Down
4 changes: 2 additions & 2 deletions kernel/sched/core.c
Original file line number Diff line number Diff line change
Expand Up @@ -4774,9 +4774,9 @@ unsigned long nr_iowait_cpu(int cpu)
* 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)
sum += nr_iowait_cpu(i);
Expand Down

0 comments on commit 9745516

Please sign in to comment.