lkml.org 
[lkml]   [1999]   [Dec]   [2]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
Subject[PATH] Implementation of process IO metrics (inblock/oublock) in 2.3.29
Date
Hi,

Attached I send a patch against 2.3.29 for implementing process IO metrics.
Having such metrics enhance the quality of any capacity planning and
performance study.

This patch just implemented two currently metrics provided by rusage.

From my first tests, the patch seems to work well.
The only sad thing is that for oublock's it is kflushd, kupdated and
syslogd who's getting billed.

Comments are extremely welcome,

Sincerely,

Serge

--
_______________
/ \
| Serge Robyns \_______________________________
| \
| RC&S (Robyns Consulting & Services) \
| 139, avenue De Fre |
| 1180 Uccle - Belgium |
| \|/ |
| phone: +32(477)29.66.97 -O- fax: +1(801)469-9358 |
| /|\ |
| |
| \|/ mailto:serge.robyns@advalvas.be \|/ |
\___/o\____ http://web.wanadoo.be/rc.s/ ____/o\____/

*** ./fs/proc/array.c Thu Dec 2 20:59:45 1999
--- ./fs/proc/array.c.orig Wed Dec 1 18:27:13 1999
***************
*** 324,330 ****

res = sprintf(buffer,"%d (%s) %c %d %d %d %d %d %lu %lu \
%lu %lu %lu %lu %lu %ld %ld %ld %ld %ld %ld %lu %lu %ld %lu %lu %lu %lu %lu \
! %lu %lu %lu %lu %lu %lu %lu %lu %d %d %lu %lu\n",
task->pid,
task->comm,
state,
--- 324,330 ----

res = sprintf(buffer,"%d (%s) %c %d %d %d %d %d %lu %lu \
%lu %lu %lu %lu %lu %ld %ld %ld %ld %ld %ld %lu %lu %ld %lu %lu %lu %lu %lu \
! %lu %lu %lu %lu %lu %lu %lu %lu %d %d\n",
task->pid,
task->comm,
state,
***************
*** 367,375 ****
task->nswap,
task->cnswap,
task->exit_signal,
! task->processor,
! task->inblock,
! task->oublock);
return res;
}

--- 367,373 ----
task->nswap,
task->cnswap,
task->exit_signal,
! task->processor);
return res;
}

*** ./kernel/fork.c Thu Dec 2 20:59:59 1999
--- ./kernel/fork.c.orig Wed Dec 1 16:35:17 1999
***************
*** 369,375 ****
tsk->min_flt = tsk->maj_flt = 0;
tsk->cmin_flt = tsk->cmaj_flt = 0;
tsk->nswap = tsk->cnswap = 0;
- tsk->inblock = tsk->oublock = 0;

tsk->mm = NULL;
tsk->active_mm = NULL;
--- 369,374 ----
*** ./kernel/sys.c Thu Dec 2 21:00:10 1999
--- ./kernel/sys.c.orig Wed Dec 1 16:38:20 1999
***************
*** 962,969 ****
r.ru_minflt = p->min_flt;
r.ru_majflt = p->maj_flt;
r.ru_nswap = p->nswap;
- r.ru_inblock = p->inblock;
- r.ru_oublock = p->oublock;
break;
case RUSAGE_CHILDREN:
r.ru_utime.tv_sec = CT_TO_SECS(p->times.tms_cutime);
--- 962,967 ----
*** ./kernel/acct.c Thu Dec 2 21:00:24 1999
--- ./kernel/acct.c.orig Wed Dec 1 16:48:45 1999
***************
*** 320,326 ****
vsize = vsize / 1024;
ac.ac_mem = encode_comp_t(vsize);
ac.ac_io = encode_comp_t(0 /* current->io_usage */); /* %% */
! ac.ac_rw = encode_comp_t(current->inblock + current->oublock);
ac.ac_minflt = encode_comp_t(current->min_flt);
ac.ac_majflt = encode_comp_t(current->maj_flt);
ac.ac_swaps = encode_comp_t(current->nswap);
--- 320,326 ----
vsize = vsize / 1024;
ac.ac_mem = encode_comp_t(vsize);
ac.ac_io = encode_comp_t(0 /* current->io_usage */); /* %% */
! ac.ac_rw = encode_comp_t(ac.ac_io / 1024);
ac.ac_minflt = encode_comp_t(current->min_flt);
ac.ac_majflt = encode_comp_t(current->maj_flt);
ac.ac_swaps = encode_comp_t(current->nswap);
*** ./include/linux/sched.h Thu Dec 2 21:00:37 1999
--- ./include/linux/sched.h.orig Wed Dec 1 16:34:19 1999
***************
*** 322,328 ****
long per_cpu_utime[NR_CPUS], per_cpu_stime[NR_CPUS];
/* mm fault and swap info: this can arguably be seen as either mm-specific or thread-specific */
unsigned long min_flt, maj_flt, nswap, cmin_flt, cmaj_flt, cnswap;
- unsigned long inblock, oublock;
int swappable:1;
/* process credentials */
uid_t uid,euid,suid,fsuid;
--- 322,327 ----
***************
*** 413,419 ****
/* utime */ {0,0,0,0},0, \
/* per CPU times */ {0, }, {0, }, \
/* flt */ 0,0,0,0,0,0, \
- /* io blk */ 0,0, \
/* swp */ 0, \
/* process credentials */ \
/* uid etc */ 0,0,0,0,0,0,0,0, \
--- 412,417 ----
*** ./drivers/block/ll_rw_blk.c Thu Dec 2 21:01:03 1999
--- ./drivers/block/ll_rw_blk.c.orig Wed Dec 1 16:50:13 1999
***************
*** 461,467 ****
if (buffer_uptodate(bh)) /* Hmmph! Already have it */
goto end_io;
kstat.pgpgin++;
- current->inblock++;
max_req = NR_REQUEST; /* reads take precedence */
break;
case WRITERAW:
--- 461,466 ----
***************
*** 479,485 ****
* requests are only for reads.
*/
kstat.pgpgout++;
- current->oublock++;
max_req = (NR_REQUEST * 2) / 3;
break;
default:
--- 478,483 ----
\
 
 \ /
  Last update: 2005-03-22 13:55    [W:0.030 / U:0.132 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site