mirror of
https://github.com/tbsdtv/linux_media.git
synced 2025-07-23 12:43:29 +02:00
[PATCH] per-task-delay-accounting: /proc export of aggregated block I/O delays
Export I/O delays seen by a task through /proc/<tgid>/stats for use in top etc. Note that delays for I/O done for swapping in pages (swapin I/O) is clubbed together with all other I/O here (this is not the case in the netlink interface where the swapin I/O is kept distinct) [akpm@osdl.org: printk warning fix] Signed-off-by: Shailabh Nagar <nagar@watson.ibm.com> Signed-off-by: Balbir Singh <balbir@in.ibm.com> Cc: Jes Sorensen <jes@sgi.com> Cc: Peter Chubb <peterc@gelato.unsw.edu.au> Cc: Erich Focht <efocht@ess.nec.de> Cc: Levent Serinol <lserinol@gmail.com> Cc: Jay Lan <jlan@engr.sgi.com> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
This commit is contained in:
committed by
Linus Torvalds
parent
a3baf649ca
commit
2589045466
@@ -37,6 +37,7 @@ extern void __delayacct_tsk_exit(struct task_struct *);
|
||||
extern void __delayacct_blkio_start(void);
|
||||
extern void __delayacct_blkio_end(void);
|
||||
extern int __delayacct_add_tsk(struct taskstats *, struct task_struct *);
|
||||
extern __u64 __delayacct_blkio_ticks(struct task_struct *);
|
||||
|
||||
static inline void delayacct_set_flag(int flag)
|
||||
{
|
||||
@@ -86,6 +87,13 @@ static inline int delayacct_add_tsk(struct taskstats *d,
|
||||
return __delayacct_add_tsk(d, tsk);
|
||||
}
|
||||
|
||||
static inline __u64 delayacct_blkio_ticks(struct task_struct *tsk)
|
||||
{
|
||||
if (tsk->delays)
|
||||
return __delayacct_blkio_ticks(tsk);
|
||||
return 0;
|
||||
}
|
||||
|
||||
#else
|
||||
static inline void delayacct_set_flag(int flag)
|
||||
{}
|
||||
@@ -104,6 +112,8 @@ static inline void delayacct_blkio_end(void)
|
||||
static inline int delayacct_add_tsk(struct taskstats *d,
|
||||
struct task_struct *tsk)
|
||||
{ return 0; }
|
||||
static inline __u64 delayacct_blkio_ticks(struct task_struct *tsk)
|
||||
{ return 0; }
|
||||
#endif /* CONFIG_TASK_DELAY_ACCT */
|
||||
|
||||
#endif
|
||||
|
Reference in New Issue
Block a user