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.h25
1 files changed, 25 insertions, 0 deletions
diff --git a/include/linux/delayacct.h b/include/linux/delayacct.h
index 9572cfa1f129..0ecbf9aad8e1 100644
--- a/include/linux/delayacct.h
+++ b/include/linux/delayacct.h
@@ -19,6 +19,13 @@
19 19
20#include <linux/sched.h> 20#include <linux/sched.h>
21 21
22/*
23 * Per-task flags relevant to delay accounting
24 * maintained privately to avoid exhausting similar flags in sched.h:PF_*
25 * Used to set current->delays->flags
26 */
27#define DELAYACCT_PF_SWAPIN 0x00000001 /* I am doing a swapin */
28
22#ifdef CONFIG_TASK_DELAY_ACCT 29#ifdef CONFIG_TASK_DELAY_ACCT
23 30
24extern int delayacct_on; /* Delay accounting turned on/off */ 31extern int delayacct_on; /* Delay accounting turned on/off */
@@ -26,6 +33,8 @@ extern kmem_cache_t *delayacct_cache;
26extern void delayacct_init(void); 33extern void delayacct_init(void);
27extern void __delayacct_tsk_init(struct task_struct *); 34extern void __delayacct_tsk_init(struct task_struct *);
28extern void __delayacct_tsk_exit(struct task_struct *); 35extern void __delayacct_tsk_exit(struct task_struct *);
36extern void __delayacct_blkio_start(void);
37extern void __delayacct_blkio_end(void);
29 38
30static inline void delayacct_set_flag(int flag) 39static inline void delayacct_set_flag(int flag)
31{ 40{
@@ -53,6 +62,18 @@ static inline void delayacct_tsk_exit(struct task_struct *tsk)
53 __delayacct_tsk_exit(tsk); 62 __delayacct_tsk_exit(tsk);
54} 63}
55 64
65static inline void delayacct_blkio_start(void)
66{
67 if (current->delays)
68 __delayacct_blkio_start();
69}
70
71static inline void delayacct_blkio_end(void)
72{
73 if (current->delays)
74 __delayacct_blkio_end();
75}
76
56#else 77#else
57static inline void delayacct_set_flag(int flag) 78static inline void delayacct_set_flag(int flag)
58{} 79{}
@@ -64,6 +85,10 @@ static inline void delayacct_tsk_init(struct task_struct *tsk)
64{} 85{}
65static inline void delayacct_tsk_exit(struct task_struct *tsk) 86static inline void delayacct_tsk_exit(struct task_struct *tsk)
66{} 87{}
88static inline void delayacct_blkio_start(void)
89{}
90static inline void delayacct_blkio_end(void)
91{}
67#endif /* CONFIG_TASK_DELAY_ACCT */ 92#endif /* CONFIG_TASK_DELAY_ACCT */
68 93
69#endif 94#endif