task_io_accounting.h 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. /*
  2. * task_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 Andrew Morton for all this.
  9. */
  10. struct task_io_accounting {
  11. #ifdef CONFIG_TASK_XACCT
  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. #endif /* CONFIG_TASK_XACCT */
  21. #ifdef CONFIG_TASK_IO_ACCOUNTING
  22. /*
  23. * The number of bytes which this task has caused to be read from
  24. * storage.
  25. */
  26. u64 read_bytes;
  27. /*
  28. * The number of bytes which this task has caused, or shall cause to be
  29. * written to disk.
  30. */
  31. u64 write_bytes;
  32. /*
  33. * A task can cause "negative" IO too. If this task truncates some
  34. * dirty pagecache, some IO which another task has been accounted for
  35. * (in its write_bytes) will not be happening. We _could_ just
  36. * subtract that from the truncating task's write_bytes, but there is
  37. * information loss in doing that.
  38. */
  39. u64 cancelled_write_bytes;
  40. #endif /* CONFIG_TASK_IO_ACCOUNTING */
  41. };