summaryrefslogtreecommitdiffstats
path: root/kernel/sched/core.c
diff options
context:
space:
mode:
authorAlexey Dobriyan <adobriyan@gmail.com>2021-04-22 23:02:25 +0300
committerIngo Molnar <mingo@kernel.org>2021-05-12 21:34:14 +0200
commit01aee8fd7fb23049e2b52abadbe1f7b5e94a52d2 (patch)
tree3724c38c4e041eea6037ff5fc206972457f6cc6b /kernel/sched/core.c
parentcc00c1988801dc71f63bb7bad019e85046865095 (diff)
downloadlinux-01aee8fd7fb23049e2b52abadbe1f7b5e94a52d2.tar.bz2
sched: Make nr_running() return 32-bit value
Creating 2**32 tasks is impossible due to futex pid limits and wasteful anyway. Nobody has done it. Bring nr_running() into 32-bit world to save on REX prefixes. Signed-off-by: Alexey Dobriyan <adobriyan@gmail.com> Signed-off-by: Ingo Molnar <mingo@kernel.org> Link: https://lore.kernel.org/r/20210422200228.1423391-1-adobriyan@gmail.com
Diffstat (limited to 'kernel/sched/core.c')
-rw-r--r--kernel/sched/core.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/kernel/sched/core.c b/kernel/sched/core.c
index ac8882da5daf..2c6cdb059c64 100644
--- a/kernel/sched/core.c
+++ b/kernel/sched/core.c
@@ -4692,9 +4692,9 @@ context_switch(struct rq *rq, struct task_struct *prev,
* externally visible scheduler statistics: current number of runnable
* threads, total number of context switches performed since bootup.
*/
-unsigned long nr_running(void)
+unsigned int nr_running(void)
{
- unsigned long i, sum = 0;
+ unsigned int i, sum = 0;
for_each_online_cpu(i)
sum += cpu_rq(i)->nr_running;