aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/delayacct.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/linux/delayacct.h')
-rw-r--r--include/linux/delayacct.h13
1 files changed, 13 insertions, 0 deletions
diff --git a/include/linux/delayacct.h b/include/linux/delayacct.h
index 55d1ca5e60f5..ab94bc083558 100644
--- a/include/linux/delayacct.h
+++ b/include/linux/delayacct.h
@@ -26,6 +26,7 @@
26 * Used to set current->delays->flags 26 * Used to set current->delays->flags
27 */ 27 */
28#define DELAYACCT_PF_SWAPIN 0x00000001 /* I am doing a swapin */ 28#define DELAYACCT_PF_SWAPIN 0x00000001 /* I am doing a swapin */
29#define DELAYACCT_PF_BLKIO 0x00000002 /* I am waiting on IO */
29 30
30#ifdef CONFIG_TASK_DELAY_ACCT 31#ifdef CONFIG_TASK_DELAY_ACCT
31 32
@@ -39,6 +40,14 @@ extern void __delayacct_blkio_end(void);
39extern int __delayacct_add_tsk(struct taskstats *, struct task_struct *); 40extern int __delayacct_add_tsk(struct taskstats *, struct task_struct *);
40extern __u64 __delayacct_blkio_ticks(struct task_struct *); 41extern __u64 __delayacct_blkio_ticks(struct task_struct *);
41 42
43static inline int delayacct_is_task_waiting_on_io(struct task_struct *p)
44{
45 if (p->delays)
46 return (p->delays->flags & DELAYACCT_PF_BLKIO);
47 else
48 return 0;
49}
50
42static inline void delayacct_set_flag(int flag) 51static inline void delayacct_set_flag(int flag)
43{ 52{
44 if (current->delays) 53 if (current->delays)
@@ -71,6 +80,7 @@ static inline void delayacct_tsk_free(struct task_struct *tsk)
71 80
72static inline void delayacct_blkio_start(void) 81static inline void delayacct_blkio_start(void)
73{ 82{
83 delayacct_set_flag(DELAYACCT_PF_BLKIO);
74 if (current->delays) 84 if (current->delays)
75 __delayacct_blkio_start(); 85 __delayacct_blkio_start();
76} 86}
@@ -79,6 +89,7 @@ static inline void delayacct_blkio_end(void)
79{ 89{
80 if (current->delays) 90 if (current->delays)
81 __delayacct_blkio_end(); 91 __delayacct_blkio_end();
92 delayacct_clear_flag(DELAYACCT_PF_BLKIO);
82} 93}
83 94
84static inline int delayacct_add_tsk(struct taskstats *d, 95static inline int delayacct_add_tsk(struct taskstats *d,
@@ -116,6 +127,8 @@ static inline int delayacct_add_tsk(struct taskstats *d,
116{ return 0; } 127{ return 0; }
117static inline __u64 delayacct_blkio_ticks(struct task_struct *tsk) 128static inline __u64 delayacct_blkio_ticks(struct task_struct *tsk)
118{ return 0; } 129{ return 0; }
130static inline int delayacct_is_task_waiting_on_io(struct task_struct *p)
131{ return 0; }
119#endif /* CONFIG_TASK_DELAY_ACCT */ 132#endif /* CONFIG_TASK_DELAY_ACCT */
120 133
121#endif 134#endif