diff options
Diffstat (limited to 'kernel/sched.c')
-rw-r--r-- | kernel/sched.c | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/kernel/sched.c b/kernel/sched.c index a9ecac398bb9..6e52e0adff80 100644 --- a/kernel/sched.c +++ b/kernel/sched.c | |||
@@ -1658,6 +1658,21 @@ unsigned long nr_iowait(void) | |||
1658 | return sum; | 1658 | return sum; |
1659 | } | 1659 | } |
1660 | 1660 | ||
1661 | unsigned long nr_active(void) | ||
1662 | { | ||
1663 | unsigned long i, running = 0, uninterruptible = 0; | ||
1664 | |||
1665 | for_each_online_cpu(i) { | ||
1666 | running += cpu_rq(i)->nr_running; | ||
1667 | uninterruptible += cpu_rq(i)->nr_uninterruptible; | ||
1668 | } | ||
1669 | |||
1670 | if (unlikely((long)uninterruptible < 0)) | ||
1671 | uninterruptible = 0; | ||
1672 | |||
1673 | return running + uninterruptible; | ||
1674 | } | ||
1675 | |||
1661 | #ifdef CONFIG_SMP | 1676 | #ifdef CONFIG_SMP |
1662 | 1677 | ||
1663 | /* | 1678 | /* |