diff options
author | Alexey Dobriyan <adobriyan@gmail.com> | 2007-02-10 04:46:45 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@woody.linux-foundation.org> | 2007-02-11 14:18:07 -0500 |
commit | 4b98d11b40f03382918796f3c5c936d5495d20a4 (patch) | |
tree | 616b7260196c9bd0eaf208ef8fab91fcf9efcece /include/linux | |
parent | 18f705f49a5b19206233f7cef8f869ce7291f8c8 (diff) |
[PATCH] ifdef ->rchar, ->wchar, ->syscr, ->syscw from task_struct
They are fat: 4x8 bytes in task_struct.
They are uncoditionally updated in every fork, read, write and sendfile.
They are used only if you have some "extended acct fields feature".
And please, please, please, read(2) knows about bytes, not characters,
why it is called "rchar"?
Signed-off-by: Alexey Dobriyan <adobriyan@gmail.com>
Cc: Jay Lan <jlan@engr.sgi.com>
Cc: Balbir Singh <balbir@in.ibm.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'include/linux')
-rw-r--r-- | include/linux/sched.h | 40 |
1 files changed, 40 insertions, 0 deletions
diff --git a/include/linux/sched.h b/include/linux/sched.h index 446373535190..76c8e2dc48dd 100644 --- a/include/linux/sched.h +++ b/include/linux/sched.h | |||
@@ -1013,8 +1013,10 @@ struct task_struct { | |||
1013 | * to a stack based synchronous wait) if its doing sync IO. | 1013 | * to a stack based synchronous wait) if its doing sync IO. |
1014 | */ | 1014 | */ |
1015 | wait_queue_t *io_wait; | 1015 | wait_queue_t *io_wait; |
1016 | #ifdef CONFIG_TASK_XACCT | ||
1016 | /* i/o counters(bytes read/written, #syscalls */ | 1017 | /* i/o counters(bytes read/written, #syscalls */ |
1017 | u64 rchar, wchar, syscr, syscw; | 1018 | u64 rchar, wchar, syscr, syscw; |
1019 | #endif | ||
1018 | struct task_io_accounting ioac; | 1020 | struct task_io_accounting ioac; |
1019 | #if defined(CONFIG_TASK_XACCT) | 1021 | #if defined(CONFIG_TASK_XACCT) |
1020 | u64 acct_rss_mem1; /* accumulated rss usage */ | 1022 | u64 acct_rss_mem1; /* accumulated rss usage */ |
@@ -1649,6 +1651,44 @@ extern int sched_create_sysfs_power_savings_entries(struct sysdev_class *cls); | |||
1649 | 1651 | ||
1650 | extern void normalize_rt_tasks(void); | 1652 | extern void normalize_rt_tasks(void); |
1651 | 1653 | ||
1654 | #ifdef CONFIG_TASK_XACCT | ||
1655 | static inline void add_rchar(struct task_struct *tsk, ssize_t amt) | ||
1656 | { | ||
1657 | tsk->rchar += amt; | ||
1658 | } | ||
1659 | |||
1660 | static inline void add_wchar(struct task_struct *tsk, ssize_t amt) | ||
1661 | { | ||
1662 | tsk->wchar += amt; | ||
1663 | } | ||
1664 | |||
1665 | static inline void inc_syscr(struct task_struct *tsk) | ||
1666 | { | ||
1667 | tsk->syscr++; | ||
1668 | } | ||
1669 | |||
1670 | static inline void inc_syscw(struct task_struct *tsk) | ||
1671 | { | ||
1672 | tsk->syscw++; | ||
1673 | } | ||
1674 | #else | ||
1675 | static inline void add_rchar(struct task_struct *tsk, ssize_t amt) | ||
1676 | { | ||
1677 | } | ||
1678 | |||
1679 | static inline void add_wchar(struct task_struct *tsk, ssize_t amt) | ||
1680 | { | ||
1681 | } | ||
1682 | |||
1683 | static inline void inc_syscr(struct task_struct *tsk) | ||
1684 | { | ||
1685 | } | ||
1686 | |||
1687 | static inline void inc_syscw(struct task_struct *tsk) | ||
1688 | { | ||
1689 | } | ||
1690 | #endif | ||
1691 | |||
1652 | #endif /* __KERNEL__ */ | 1692 | #endif /* __KERNEL__ */ |
1653 | 1693 | ||
1654 | #endif | 1694 | #endif |