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
This commit is contained in:
committed by
Ingo Molnar
parent
cc00c19888
commit
01aee8fd7f
+2
-2
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user