diff options
Diffstat (limited to 'include/linux')
| -rw-r--r-- | include/linux/pci_ids.h | 1 | ||||
| -rw-r--r-- | include/linux/sched.h | 15 | ||||
| -rw-r--r-- | include/linux/task_io_accounting.h | 18 | ||||
| -rw-r--r-- | include/linux/task_io_accounting_ops.h | 46 |
4 files changed, 59 insertions, 21 deletions
diff --git a/include/linux/pci_ids.h b/include/linux/pci_ids.h index ffe479ba0779..35a78415accc 100644 --- a/include/linux/pci_ids.h +++ b/include/linux/pci_ids.h | |||
| @@ -748,6 +748,7 @@ | |||
| 748 | #define PCI_VENDOR_ID_TI 0x104c | 748 | #define PCI_VENDOR_ID_TI 0x104c |
| 749 | #define PCI_DEVICE_ID_TI_TVP4020 0x3d07 | 749 | #define PCI_DEVICE_ID_TI_TVP4020 0x3d07 |
| 750 | #define PCI_DEVICE_ID_TI_4450 0x8011 | 750 | #define PCI_DEVICE_ID_TI_4450 0x8011 |
| 751 | #define PCI_DEVICE_ID_TI_TSB43AB22 0x8023 | ||
| 751 | #define PCI_DEVICE_ID_TI_XX21_XX11 0x8031 | 752 | #define PCI_DEVICE_ID_TI_XX21_XX11 0x8031 |
| 752 | #define PCI_DEVICE_ID_TI_XX21_XX11_FM 0x8033 | 753 | #define PCI_DEVICE_ID_TI_XX21_XX11_FM 0x8033 |
| 753 | #define PCI_DEVICE_ID_TI_XX21_XX11_SD 0x8034 | 754 | #define PCI_DEVICE_ID_TI_XX21_XX11_SD 0x8034 |
diff --git a/include/linux/sched.h b/include/linux/sched.h index f59318a0099b..5270d449ff9d 100644 --- a/include/linux/sched.h +++ b/include/linux/sched.h | |||
| @@ -505,9 +505,6 @@ struct signal_struct { | |||
| 505 | unsigned long nvcsw, nivcsw, cnvcsw, cnivcsw; | 505 | unsigned long nvcsw, nivcsw, cnvcsw, cnivcsw; |
| 506 | unsigned long min_flt, maj_flt, cmin_flt, cmaj_flt; | 506 | unsigned long min_flt, maj_flt, cmin_flt, cmaj_flt; |
| 507 | unsigned long inblock, oublock, cinblock, coublock; | 507 | unsigned long inblock, oublock, cinblock, coublock; |
| 508 | #ifdef CONFIG_TASK_XACCT | ||
| 509 | u64 rchar, wchar, syscr, syscw; | ||
| 510 | #endif | ||
| 511 | struct task_io_accounting ioac; | 508 | struct task_io_accounting ioac; |
| 512 | 509 | ||
| 513 | /* | 510 | /* |
| @@ -1256,10 +1253,6 @@ struct task_struct { | |||
| 1256 | 1253 | ||
| 1257 | unsigned long ptrace_message; | 1254 | unsigned long ptrace_message; |
| 1258 | siginfo_t *last_siginfo; /* For ptrace use. */ | 1255 | siginfo_t *last_siginfo; /* For ptrace use. */ |
| 1259 | #ifdef CONFIG_TASK_XACCT | ||
| 1260 | /* i/o counters(bytes read/written, #syscalls */ | ||
| 1261 | u64 rchar, wchar, syscr, syscw; | ||
| 1262 | #endif | ||
| 1263 | struct task_io_accounting ioac; | 1256 | struct task_io_accounting ioac; |
| 1264 | #if defined(CONFIG_TASK_XACCT) | 1257 | #if defined(CONFIG_TASK_XACCT) |
| 1265 | u64 acct_rss_mem1; /* accumulated rss usage */ | 1258 | u64 acct_rss_mem1; /* accumulated rss usage */ |
| @@ -2190,22 +2183,22 @@ extern long sched_group_rt_period(struct task_group *tg); | |||
| 2190 | #ifdef CONFIG_TASK_XACCT | 2183 | #ifdef CONFIG_TASK_XACCT |
| 2191 | static inline void add_rchar(struct task_struct *tsk, ssize_t amt) | 2184 | static inline void add_rchar(struct task_struct *tsk, ssize_t amt) |
| 2192 | { | 2185 | { |
| 2193 | tsk->rchar += amt; | 2186 | tsk->ioac.rchar += amt; |
| 2194 | } | 2187 | } |
| 2195 | 2188 | ||
| 2196 | static inline void add_wchar(struct task_struct *tsk, ssize_t amt) | 2189 | static inline void add_wchar(struct task_struct *tsk, ssize_t amt) |
| 2197 | { | 2190 | { |
| 2198 | tsk->wchar += amt; | 2191 | tsk->ioac.wchar += amt; |
| 2199 | } | 2192 | } |
| 2200 | 2193 | ||
| 2201 | static inline void inc_syscr(struct task_struct *tsk) | 2194 | static inline void inc_syscr(struct task_struct *tsk) |
| 2202 | { | 2195 | { |
| 2203 | tsk->syscr++; | 2196 | tsk->ioac.syscr++; |
| 2204 | } | 2197 | } |
| 2205 | 2198 | ||
| 2206 | static inline void inc_syscw(struct task_struct *tsk) | 2199 | static inline void inc_syscw(struct task_struct *tsk) |
| 2207 | { | 2200 | { |
| 2208 | tsk->syscw++; | 2201 | tsk->ioac.syscw++; |
| 2209 | } | 2202 | } |
| 2210 | #else | 2203 | #else |
| 2211 | static inline void add_rchar(struct task_struct *tsk, ssize_t amt) | 2204 | static inline void add_rchar(struct task_struct *tsk, ssize_t amt) |
diff --git a/include/linux/task_io_accounting.h b/include/linux/task_io_accounting.h index 44d00e9cceea..5e88afc9a2fb 100644 --- a/include/linux/task_io_accounting.h +++ b/include/linux/task_io_accounting.h | |||
| @@ -8,8 +8,19 @@ | |||
| 8 | * Blame akpm@osdl.org for all this. | 8 | * Blame akpm@osdl.org for all this. |
| 9 | */ | 9 | */ |
| 10 | 10 | ||
| 11 | #ifdef CONFIG_TASK_IO_ACCOUNTING | ||
| 12 | struct task_io_accounting { | 11 | struct task_io_accounting { |
| 12 | #ifdef CONFIG_TASK_XACCT | ||
| 13 | /* bytes read */ | ||
| 14 | u64 rchar; | ||
| 15 | /* bytes written */ | ||
| 16 | u64 wchar; | ||
| 17 | /* # of read syscalls */ | ||
| 18 | u64 syscr; | ||
| 19 | /* # of write syscalls */ | ||
| 20 | u64 syscw; | ||
| 21 | #endif /* CONFIG_TASK_XACCT */ | ||
| 22 | |||
| 23 | #ifdef CONFIG_TASK_IO_ACCOUNTING | ||
| 13 | /* | 24 | /* |
| 14 | * The number of bytes which this task has caused to be read from | 25 | * The number of bytes which this task has caused to be read from |
| 15 | * storage. | 26 | * storage. |
| @@ -30,8 +41,5 @@ struct task_io_accounting { | |||
| 30 | * information loss in doing that. | 41 | * information loss in doing that. |
| 31 | */ | 42 | */ |
| 32 | u64 cancelled_write_bytes; | 43 | u64 cancelled_write_bytes; |
| 44 | #endif /* CONFIG_TASK_IO_ACCOUNTING */ | ||
| 33 | }; | 45 | }; |
| 34 | #else | ||
| 35 | struct task_io_accounting { | ||
| 36 | }; | ||
| 37 | #endif | ||
diff --git a/include/linux/task_io_accounting_ops.h b/include/linux/task_io_accounting_ops.h index ff46c6fad79d..4d090f9ee608 100644 --- a/include/linux/task_io_accounting_ops.h +++ b/include/linux/task_io_accounting_ops.h | |||
| @@ -40,9 +40,17 @@ static inline void task_io_account_cancelled_write(size_t bytes) | |||
| 40 | current->ioac.cancelled_write_bytes += bytes; | 40 | current->ioac.cancelled_write_bytes += bytes; |
| 41 | } | 41 | } |
| 42 | 42 | ||
| 43 | static inline void task_io_accounting_init(struct task_struct *tsk) | 43 | static inline void task_io_accounting_init(struct task_io_accounting *ioac) |
| 44 | { | 44 | { |
| 45 | memset(&tsk->ioac, 0, sizeof(tsk->ioac)); | 45 | memset(ioac, 0, sizeof(*ioac)); |
| 46 | } | ||
| 47 | |||
| 48 | static inline void task_blk_io_accounting_add(struct task_io_accounting *dst, | ||
| 49 | struct task_io_accounting *src) | ||
| 50 | { | ||
| 51 | dst->read_bytes += src->read_bytes; | ||
| 52 | dst->write_bytes += src->write_bytes; | ||
| 53 | dst->cancelled_write_bytes += src->cancelled_write_bytes; | ||
| 46 | } | 54 | } |
| 47 | 55 | ||
| 48 | #else | 56 | #else |
| @@ -69,9 +77,37 @@ static inline void task_io_account_cancelled_write(size_t bytes) | |||
| 69 | { | 77 | { |
| 70 | } | 78 | } |
| 71 | 79 | ||
| 72 | static inline void task_io_accounting_init(struct task_struct *tsk) | 80 | static inline void task_io_accounting_init(struct task_io_accounting *ioac) |
| 81 | { | ||
| 82 | } | ||
| 83 | |||
| 84 | static inline void task_blk_io_accounting_add(struct task_io_accounting *dst, | ||
| 85 | struct task_io_accounting *src) | ||
| 73 | { | 86 | { |
| 74 | } | 87 | } |
| 75 | 88 | ||
| 76 | #endif /* CONFIG_TASK_IO_ACCOUNTING */ | 89 | #endif /* CONFIG_TASK_IO_ACCOUNTING */ |
| 77 | #endif /* __TASK_IO_ACCOUNTING_OPS_INCLUDED */ | 90 | |
| 91 | #ifdef CONFIG_TASK_XACCT | ||
| 92 | static inline void task_chr_io_accounting_add(struct task_io_accounting *dst, | ||
| 93 | struct task_io_accounting *src) | ||
| 94 | { | ||
| 95 | dst->rchar += src->rchar; | ||
| 96 | dst->wchar += src->wchar; | ||
| 97 | dst->syscr += src->syscr; | ||
| 98 | dst->syscw += src->syscw; | ||
| 99 | } | ||
| 100 | #else | ||
| 101 | static inline void task_chr_io_accounting_add(struct task_io_accounting *dst, | ||
| 102 | struct task_io_accounting *src) | ||
| 103 | { | ||
| 104 | } | ||
| 105 | #endif /* CONFIG_TASK_XACCT */ | ||
| 106 | |||
| 107 | static inline void task_io_accounting_add(struct task_io_accounting *dst, | ||
| 108 | struct task_io_accounting *src) | ||
| 109 | { | ||
| 110 | task_chr_io_accounting_add(dst, src); | ||
| 111 | task_blk_io_accounting_add(dst, src); | ||
| 112 | } | ||
| 113 | #endif /* __TASK_IO_ACCOUNTING_OPS_INCLUDED */ | ||
