From Rik.
"this trivial patch, against 2.5-current, exports nr_running and
nr_iowait_tasks in /proc/stat. With this patch in vmstat will no
longer need to walk all the processes in the system just to determine
the number of running and blocked processes."
#include <linux/seq_file.h>
#include <linux/times.h>
#include <linux/profile.h>
+#include <linux/blkdev.h>
#include <asm/uaccess.h>
#include <asm/pgtable.h>
len += sprintf(page + len,
"\nctxt %lu\n"
"btime %lu\n"
- "processes %lu\n",
+ "processes %lu\n"
+ "procs_running %lu\n"
+ "procs_blocked %u\n",
nr_context_switches(),
xtime.tv_sec - jif / HZ,
- total_forks);
+ total_forks,
+ nr_running(),
+ atomic_read(&nr_iowait_tasks));
return proc_calc_metrics(page, start, off, count, eof, len);
}