Skip to content

Commit

Permalink
sched: Make nr_iowait_cpu() return 32-bit value
Browse files Browse the repository at this point in the history
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
  • Loading branch information
Alexey Dobriyan authored and Ingo Molnar committed May 12, 2021
1 parent 9745516 commit 8fc2858
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
6 changes: 3 additions & 3 deletions drivers/cpuidle/governors/menu.c
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ struct menu_device {
int interval_ptr;
};

static inline int which_bucket(u64 duration_ns, unsigned long nr_iowaiters)
static inline int which_bucket(u64 duration_ns, unsigned int nr_iowaiters)
{
int bucket = 0;

Expand Down Expand Up @@ -150,7 +150,7 @@ static inline int which_bucket(u64 duration_ns, unsigned long nr_iowaiters)
* to be, the higher this multiplier, and thus the higher
* the barrier to go to an expensive C state.
*/
static inline int performance_multiplier(unsigned long nr_iowaiters)
static inline int performance_multiplier(unsigned int nr_iowaiters)
{
/* for IO wait tasks (per cpu!) we add 10x each */
return 1 + 10 * nr_iowaiters;
Expand Down Expand Up @@ -270,7 +270,7 @@ static int menu_select(struct cpuidle_driver *drv, struct cpuidle_device *dev,
unsigned int predicted_us;
u64 predicted_ns;
u64 interactivity_req;
unsigned long nr_iowaiters;
unsigned int nr_iowaiters;
ktime_t delta, delta_tick;
int i, idx;

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 @@ -20,7 +20,7 @@ extern int nr_processes(void);
extern unsigned int nr_running(void);
extern bool single_task_running(void);
extern unsigned int nr_iowait(void);
extern unsigned long nr_iowait_cpu(int cpu);
extern unsigned int nr_iowait_cpu(int cpu);

static inline int sched_info_on(void)
{
Expand Down
2 changes: 1 addition & 1 deletion kernel/sched/core.c
Original file line number Diff line number Diff line change
Expand Up @@ -4739,7 +4739,7 @@ unsigned long long nr_context_switches(void)
* it does become runnable.
*/

unsigned long nr_iowait_cpu(int cpu)
unsigned int nr_iowait_cpu(int cpu)
{
return atomic_read(&cpu_rq(cpu)->nr_iowait);
}
Expand Down

0 comments on commit 8fc2858

Please sign in to comment.