]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
sched: Change nr_uninterruptible type to unsigned long
authorAruna Ramakrishna <aruna.ramakrishna@oracle.com>
Wed, 9 Jul 2025 17:33:28 +0000 (17:33 +0000)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 24 Jul 2025 06:58:41 +0000 (08:58 +0200)
commit9a744cf92d38753530dc4c7f62acb74a1059c0b7
tree53d4a7839d2ce633b47d1d1af9bbdfb374288044
parente9fabe7036bb8be6071f39dc38605508f5f57b20
sched: Change nr_uninterruptible type to unsigned long

commit 36569780b0d64de283f9d6c2195fd1a43e221ee8 upstream.

The commit e6fe3f422be1 ("sched: Make multiple runqueue task counters
32-bit") changed nr_uninterruptible to an unsigned int. But the
nr_uninterruptible values for each of the CPU runqueues can grow to
large numbers, sometimes exceeding INT_MAX. This is valid, if, over
time, a large number of tasks are migrated off of one CPU after going
into an uninterruptible state. Only the sum of all nr_interruptible
values across all CPUs yields the correct result, as explained in a
comment in kernel/sched/loadavg.c.

Change the type of nr_uninterruptible back to unsigned long to prevent
overflows, and thus the miscalculation of load average.

Fixes: e6fe3f422be1 ("sched: Make multiple runqueue task counters 32-bit")
Signed-off-by: Aruna Ramakrishna <aruna.ramakrishna@oracle.com>
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Link: https://lkml.kernel.org/r/20250709173328.606794-1-aruna.ramakrishna@oracle.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
kernel/sched/loadavg.c
kernel/sched/sched.h