[PATCH] show nr_running and nr_iowait_tasks

Rik van Riel (riel@conectiva.com.br)
Wed, 16 Oct 2002 18:19:30 -0200 (BRST)


Hi,

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.

please apply,

Rik

-- 
Bravely reimplemented by the knights who say "NIH".
http://www.surriel.com/		http://distro.conectiva.com/
Current spamtrap:  <a href=mailto:"october@surriel.com">october@surriel.com</a>

===== fs/proc/proc_misc.c 1.49 vs edited ===== --- 1.49/fs/proc/proc_misc.c Tue Oct 15 20:32:38 2002 +++ edited/fs/proc/proc_misc.c Wed Oct 16 18:17:24 2002 @@ -39,6 +39,7 @@ #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> @@ -404,10 +405,14 @@ 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); }

- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/