kernel-ark/include
Andrew Morton 7c3ab7381e [PATCH] io-accounting: core statistics
The present per-task IO accounting isn't very useful.  It simply counts the
number of bytes passed into read() and write().  So if a process reads 1MB
from an already-cached file, it is accused of having performed 1MB of I/O,
which is wrong.

(David Wright had some comments on the applicability of the present logical IO accounting:

  For billing purposes it is useless but for workload analysis it is very
  useful

  read_bytes/read_calls  average read request size
  write_bytes/write_calls average write request size

  read_bytes/read_blocks ie logical/physical can indicate hit rate or thrashing
  write_bytes/write_blocks  ie logical/physical  guess since pdflush writes can
                                                be missed

  I often look for logical larger than physical to see filesystem cache
  problems.  And the bytes/cpusec can help find applications that are
  dominating the cache and causing slow interactive response from page cache
  contention.

  I want to find the IO intensive applications and make sure they are doing
  efficient IO.  Thus the acctcms(sysV) or csacms command would give the high
  IO commands).

This patchset adds new accounting which tries to be more accurate.  We account
for three things:

reads:

  attempt to count the number of bytes which this process really did cause
  to be fetched from the storage layer.  Done at the submit_bio() level, so it
  is accurate for block-backed filesystems.  I also attempt to wire up NFS and
  CIFS.

writes:

  attempt to count the number of bytes which this process caused to be sent
  to the storage layer.  This is done at page-dirtying time.

  The big inaccuracy here is truncate.  If a process writes 1MB to a file
  and then deletes the file, it will in fact perform no writeout.  But it will
  have been accounted as having caused 1MB of write.

  So...

cancelled_writes:

  account the number of bytes which this process caused to not happen, by
  truncating pagecache.

  We _could_ just subtract this from the process's `write' accounting.  But
  that means that some processes would be reported to have done negative
  amounts of write IO, which is silly.

  So we just report the raw number and punt this decision up to userspace.

Now, we _could_ account for writes at the physical I/O level.  But

- This would require that we track memory-dirtying tasks at the per-page
  level (would require a new pointer in struct page).

- It would mean that IO statistics for a process are usually only available
  long after that process has exitted.  Which means that we probably cannot
  communicate this info via taskstats.

This patch:

Wire up the kernel-private data structures and the accessor functions to
manipulate them.

Cc: Jay Lan <jlan@sgi.com>
Cc: Shailabh Nagar <nagar@watson.ibm.com>
Cc: Balbir Singh <balbir@in.ibm.com>
Cc: Chris Sturtivant <csturtiv@sgi.com>
Cc: Tony Ernst <tee@sgi.com>
Cc: Guillaume Thouvenin <guillaume.thouvenin@bull.net>
Cc: David Wright <daw@sgi.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2006-12-10 09:55:41 -08:00
..
acpi [PATCH] slab: remove kmem_cache_t 2006-12-07 08:39:25 -08:00
asm-alpha [PATCH] tty: preparatory structures for termios revamp 2006-12-08 08:28:56 -08:00
asm-arm [PATCH] spi: stabilize PIO mode transfers on PXA2xx systems 2006-12-10 09:55:40 -08:00
asm-arm26 [PATCH] tty: preparatory structures for termios revamp 2006-12-08 08:28:56 -08:00
asm-avr32 [PATCH] tty: preparatory structures for termios revamp 2006-12-08 08:28:56 -08:00
asm-cris [PATCH] tty: preparatory structures for termios revamp 2006-12-08 08:28:56 -08:00
asm-frv [PATCH] tty: preparatory structures for termios revamp 2006-12-08 08:28:56 -08:00
asm-generic [PATCH] tty: switch to ktermios 2006-12-08 08:28:57 -08:00
asm-h8300 [PATCH] tty: preparatory structures for termios revamp 2006-12-08 08:28:56 -08:00
asm-i386 [PATCH] ide: more conversion to pci_get APIs 2006-12-08 08:29:03 -08:00
asm-ia64 [PATCH] tty: preparatory structures for termios revamp 2006-12-08 08:28:56 -08:00
asm-m32r [PATCH] tty: preparatory structures for termios revamp 2006-12-08 08:28:56 -08:00
asm-m68k [PATCH] Sun3: General updates 2006-12-09 09:41:18 -08:00
asm-m68knommu [PATCH] cleanup asm/setup.h userspace visibility 2006-12-07 08:39:46 -08:00
asm-mips [PATCH] add STB810 support (Philips PNX8550-based) 2006-12-09 01:04:00 +00:00
asm-parisc [PATCH] tty: preparatory structures for termios revamp 2006-12-08 08:28:56 -08:00
asm-powerpc [PATCH] tty: switch to ktermios 2006-12-08 08:28:57 -08:00
asm-ppc
asm-s390 Merge branch 'for-linus' of git://git390.osdl.marist.edu/pub/scm/linux-2.6 2006-12-08 11:21:55 -08:00
asm-sh [PATCH] tty: preparatory structures for termios revamp 2006-12-08 08:28:56 -08:00
asm-sh64 [PATCH] cleanup asm/setup.h userspace visibility 2006-12-07 08:39:46 -08:00
asm-sparc [PATCH] tty: preparatory structures for termios revamp 2006-12-08 08:28:56 -08:00
asm-sparc64 [PATCH] tty: preparatory structures for termios revamp 2006-12-08 08:28:56 -08:00
asm-um [PATCH] UML: add generic BUG support 2006-12-08 08:28:39 -08:00
asm-v850 [PATCH] tty: preparatory structures for termios revamp 2006-12-08 08:28:56 -08:00
asm-x86_64 [PATCH] termios: Enable new style termios ioctls on x86-64 2006-12-08 08:28:57 -08:00
asm-xtensa [PATCH] xtensa: fix system call interface 2006-12-10 09:55:39 -08:00
crypto
keys
linux [PATCH] io-accounting: core statistics 2006-12-10 09:55:41 -08:00
math-emu
media
mtd
net [PATCH] sysctl: remove unused "context" param 2006-12-10 09:55:41 -08:00
pcmcia
rdma
rxrpc
scsi [PATCH] slab: remove kmem_cache_t 2006-12-07 08:39:25 -08:00
sound
video [PATCH] video: pm3fb macros fix 2006-12-08 08:29:08 -08:00
Kbuild