• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /* SPDX-License-Identifier: GPL-2.0 */
2 /*
3  * task_io_accounting: a structure which is used for recording a single task's
4  * IO statistics.
5  *
6  * Don't include this header file directly - it is designed to be dragged in via
7  * sched.h.
8  *
9  * Blame Andrew Morton for all this.
10  */
11 
12 struct task_io_accounting {
13 #ifdef CONFIG_TASK_XACCT
14 	/* bytes read */
15 	u64 rchar;
16 	/*  bytes written */
17 	u64 wchar;
18 	/* # of read syscalls */
19 	u64 syscr;
20 	/* # of write syscalls */
21 	u64 syscw;
22 	/* # of fsync syscalls */
23 	u64 syscfs;
24 #endif /* CONFIG_TASK_XACCT */
25 
26 #ifdef CONFIG_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 	/*
34 	 * The number of bytes which this task has caused, or shall cause to be
35 	 * written to disk.
36 	 */
37 	u64 write_bytes;
38 
39 	/*
40 	 * A task can cause "negative" IO too.  If this task truncates some
41 	 * dirty pagecache, some IO which another task has been accounted for
42 	 * (in its write_bytes) will not be happening.  We _could_ just
43 	 * subtract that from the truncating task's write_bytes, but there is
44 	 * information loss in doing that.
45 	 */
46 	u64 cancelled_write_bytes;
47 #endif /* CONFIG_TASK_IO_ACCOUNTING */
48 };
49