All of lore.kernel.org
 help / color / mirror / Atom feed
From: Alexey Dobriyan <adobriyan@gmail.com>
To: mingo@redhat.com, peterz@infradead.org
Cc: linux-kernel@vger.kernel.org, Alexey Dobriyan <adobriyan@gmail.com>
Subject: [PATCH 3/4] sched: make nr_iowait_cpu() return 32-bit
Date: Thu, 22 Apr 2021 23:02:27 +0300	[thread overview]
Message-ID: <20210422200228.1423391-3-adobriyan@gmail.com> (raw)
In-Reply-To: <20210422200228.1423391-1-adobriyan@gmail.com>

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>
---
 drivers/cpuidle/governors/menu.c | 6 +++---
 include/linux/sched/stat.h       | 2 +-
 kernel/sched/core.c              | 2 +-
 3 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/drivers/cpuidle/governors/menu.c b/drivers/cpuidle/governors/menu.c
index b0a7ad566081..ddaaa36af290 100644
--- a/drivers/cpuidle/governors/menu.c
+++ b/drivers/cpuidle/governors/menu.c
@@ -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;
 
@@ -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;
@@ -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_next;
 	int i, idx;
 
diff --git a/include/linux/sched/stat.h b/include/linux/sched/stat.h
index 8a5b27ae7937..0319bc227c4d 100644
--- a/include/linux/sched/stat.h
+++ b/include/linux/sched/stat.h
@@ -19,7 +19,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)
 {
diff --git a/kernel/sched/core.c b/kernel/sched/core.c
index 2cc8d81cdc75..c2012f0ea7a0 100644
--- a/kernel/sched/core.c
+++ b/kernel/sched/core.c
@@ -4378,7 +4378,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);
 }
-- 
2.30.2


  parent reply	other threads:[~2021-04-22 20:03 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-04-22 20:02 [PATCH 1/4] sched: make nr_running() return 32-bit Alexey Dobriyan
2021-04-22 20:02 ` [PATCH 2/4] sched: make nr_iowait() return 32-bit value Alexey Dobriyan
2021-05-12 20:01   ` [tip: sched/core] sched: Make " tip-bot2 for Alexey Dobriyan
2021-04-22 20:02 ` Alexey Dobriyan [this message]
2021-05-12 20:01   ` [tip: sched/core] sched: Make nr_iowait_cpu() " tip-bot2 for Alexey Dobriyan
2021-04-22 20:02 ` [PATCH 4/4] sched: make multiple runqueue task counters 32-bit Alexey Dobriyan
2021-05-12 19:36   ` Ingo Molnar
2021-05-12 20:01   ` [tip: sched/core] sched: Make " tip-bot2 for Alexey Dobriyan
2021-05-12 20:01 ` [tip: sched/core] sched: Make nr_running() return 32-bit value tip-bot2 for Alexey Dobriyan
2021-05-12 23:58 ` [PATCH 1/4] sched: make nr_running() return 32-bit Thomas Gleixner
2021-05-13  7:23   ` Alexey Dobriyan
2021-05-13  9:58   ` Ingo Molnar
2021-05-13 21:22     ` Alexey Dobriyan
2021-05-14 12:52     ` Thomas Gleixner
2021-05-14 18:18     ` Thomas Gleixner

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20210422200228.1423391-3-adobriyan@gmail.com \
    --to=adobriyan@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@redhat.com \
    --cc=peterz@infradead.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.