task_io_accounting.h 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  1. /*
  2. * proc_io_accounting: a structure which is used for recording a single task's
  3. * IO statistics.
  4. *
  5. * Don't include this header file directly - it is designed to be dragged in via
  6. * sched.h.
  7. *
  8. * Blame akpm@osdl.org for all this.
  9. */
  10. #ifdef CONFIG_TASK_XACCT
  11. struct task_chr_io_accounting {
  12. /* bytes read */
  13. u64 rchar;
  14. /* bytes written */
  15. u64 wchar;
  16. /* # of read syscalls */
  17. u64 syscr;
  18. /* # of write syscalls */
  19. u64 syscw;
  20. };
  21. #else /* CONFIG_TASK_XACCT */
  22. struct task_chr_io_accounting {
  23. };
  24. #endif /* CONFIG_TASK_XACCT */
  25. #ifdef CONFIG_TASK_IO_ACCOUNTING
  26. struct task_io_accounting {
  27. /*
  28. * The number of bytes which this task has caused to be read from
  29. * storage.
  30. */
  31. u64 read_bytes;
  32. /*
  33. * The number of bytes which this task has caused, or shall cause to be
  34. * written to disk.
  35. */
  36. u64 write_bytes;
  37. /*
  38. * A task can cause "negative" IO too. If this task truncates some
  39. * dirty pagecache, some IO which another task has been accounted for
  40. * (in its write_bytes) will not be happening. We _could_ just
  41. * subtract that from the truncating task's write_bytes, but there is
  42. * information loss in doing that.
  43. */
  44. u64 cancelled_write_bytes;
  45. };
  46. #else /* CONFIG_TASK_IO_ACCOUNTING */
  47. struct task_io_accounting {
  48. };
  49. #endif /* CONFIG_TASK_IO_ACCOUNTING */
  50. struct proc_io_accounting {
  51. struct task_chr_io_accounting chr;
  52. struct task_io_accounting blk;
  53. };