)]}'
{
  "commit": "7c3ab7381e79dfc7db14a67c6f4f3285664e1ec2",
  "tree": "de5d63d17e400eb06b26c88adfd2ef2cf290898e",
  "parents": [
    "47694bb86af3648d4ec34c7afd46653cefc9b359"
  ],
  "author": {
    "name": "Andrew Morton",
    "email": "akpm@osdl.org",
    "time": "Sun Dec 10 02:19:19 2006 -0800"
  },
  "committer": {
    "name": "Linus Torvalds",
    "email": "torvalds@woody.osdl.org",
    "time": "Sun Dec 10 09:55:41 2006 -0800"
  },
  "message": "[PATCH] io-accounting: core statistics\n\nThe present per-task IO accounting isn\u0027t very useful.  It simply counts the\nnumber of bytes passed into read() and write().  So if a process reads 1MB\nfrom an already-cached file, it is accused of having performed 1MB of I/O,\nwhich is wrong.\n\n(David Wright had some comments on the applicability of the present logical IO accounting:\n\n  For billing purposes it is useless but for workload analysis it is very\n  useful\n\n  read_bytes/read_calls  average read request size\n  write_bytes/write_calls average write request size\n\n  read_bytes/read_blocks ie logical/physical can indicate hit rate or thrashing\n  write_bytes/write_blocks  ie logical/physical  guess since pdflush writes can\n                                                be missed\n\n  I often look for logical larger than physical to see filesystem cache\n  problems.  And the bytes/cpusec can help find applications that are\n  dominating the cache and causing slow interactive response from page cache\n  contention.\n\n  I want to find the IO intensive applications and make sure they are doing\n  efficient IO.  Thus the acctcms(sysV) or csacms command would give the high\n  IO commands).\n\nThis patchset adds new accounting which tries to be more accurate.  We account\nfor three things:\n\nreads:\n\n  attempt to count the number of bytes which this process really did cause\n  to be fetched from the storage layer.  Done at the submit_bio() level, so it\n  is accurate for block-backed filesystems.  I also attempt to wire up NFS and\n  CIFS.\n\nwrites:\n\n  attempt to count the number of bytes which this process caused to be sent\n  to the storage layer.  This is done at page-dirtying time.\n\n  The big inaccuracy here is truncate.  If a process writes 1MB to a file\n  and then deletes the file, it will in fact perform no writeout.  But it will\n  have been accounted as having caused 1MB of write.\n\n  So...\n\ncancelled_writes:\n\n  account the number of bytes which this process caused to not happen, by\n  truncating pagecache.\n\n  We _could_ just subtract this from the process\u0027s `write\u0027 accounting.  But\n  that means that some processes would be reported to have done negative\n  amounts of write IO, which is silly.\n\n  So we just report the raw number and punt this decision up to userspace.\n\nNow, we _could_ account for writes at the physical I/O level.  But\n\n- This would require that we track memory-dirtying tasks at the per-page\n  level (would require a new pointer in struct page).\n\n- It would mean that IO statistics for a process are usually only available\n  long after that process has exitted.  Which means that we probably cannot\n  communicate this info via taskstats.\n\nThis patch:\n\nWire up the kernel-private data structures and the accessor functions to\nmanipulate them.\n\nCc: Jay Lan \u003cjlan@sgi.com\u003e\nCc: Shailabh Nagar \u003cnagar@watson.ibm.com\u003e\nCc: Balbir Singh \u003cbalbir@in.ibm.com\u003e\nCc: Chris Sturtivant \u003ccsturtiv@sgi.com\u003e\nCc: Tony Ernst \u003ctee@sgi.com\u003e\nCc: Guillaume Thouvenin \u003cguillaume.thouvenin@bull.net\u003e\nCc: David Wright \u003cdaw@sgi.com\u003e\nSigned-off-by: Andrew Morton \u003cakpm@osdl.org\u003e\nSigned-off-by: Linus Torvalds \u003ctorvalds@osdl.org\u003e\n",
  "tree_diff": [
    {
      "type": "modify",
      "old_id": "ad9c46071ff8bf43195f104ab842b27698f8f5e7",
      "old_mode": 33188,
      "old_path": "include/linux/sched.h",
      "new_id": "1208feab46e0549f0d941a3255dc4fdff65a6eaf",
      "new_mode": 33188,
      "new_path": "include/linux/sched.h"
    },
    {
      "type": "add",
      "old_id": "0000000000000000000000000000000000000000",
      "old_mode": 0,
      "old_path": "/dev/null",
      "new_id": "44d00e9cceea551256df7428be8856e719d04ef1",
      "new_mode": 33188,
      "new_path": "include/linux/task_io_accounting.h"
    },
    {
      "type": "add",
      "old_id": "0000000000000000000000000000000000000000",
      "old_mode": 0,
      "old_path": "/dev/null",
      "new_id": "df2a319106b2bd82e1518fdbf307d97bb96c8ed5",
      "new_mode": 33188,
      "new_path": "include/linux/task_io_accounting_ops.h"
    },
    {
      "type": "modify",
      "old_id": "14d484606fab9b0bbdff72b318d664fc5d7b73b3",
      "old_mode": 33188,
      "old_path": "init/Kconfig",
      "new_id": "9edf103b3ec39f06ad64c7e57cde219239865313",
      "new_mode": 33188,
      "new_path": "init/Kconfig"
    },
    {
      "type": "modify",
      "old_id": "8c859eef8e6a5b825612b750608f452459626643",
      "old_mode": 33188,
      "old_path": "kernel/fork.c",
      "new_id": "086e172d0d3d041f87d24d4b91d5b478ff1768dd",
      "new_mode": 33188,
      "new_path": "kernel/fork.c"
    }
  ]
}
