diff options
Diffstat (limited to 'include/linux/delayacct.h')
-rw-r--r-- | include/linux/delayacct.h | 25 |
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 | ||
24 | extern int delayacct_on; /* Delay accounting turned on/off */ | 31 | extern int delayacct_on; /* Delay accounting turned on/off */ |
@@ -26,6 +33,8 @@ extern kmem_cache_t *delayacct_cache; | |||
26 | extern void delayacct_init(void); | 33 | extern void delayacct_init(void); |
27 | extern void __delayacct_tsk_init(struct task_struct *); | 34 | extern void __delayacct_tsk_init(struct task_struct *); |
28 | extern void __delayacct_tsk_exit(struct task_struct *); | 35 | extern void __delayacct_tsk_exit(struct task_struct *); |
36 | extern void __delayacct_blkio_start(void); | ||
37 | extern void __delayacct_blkio_end(void); | ||
29 | 38 | ||
30 | static inline void delayacct_set_flag(int flag) | 39 | static 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 | ||
65 | static inline void delayacct_blkio_start(void) | ||
66 | { | ||
67 | if (current->delays) | ||
68 | __delayacct_blkio_start(); | ||
69 | } | ||
70 | |||
71 | static inline void delayacct_blkio_end(void) | ||
72 | { | ||
73 | if (current->delays) | ||
74 | __delayacct_blkio_end(); | ||
75 | } | ||
76 | |||
56 | #else | 77 | #else |
57 | static inline void delayacct_set_flag(int flag) | 78 | static 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 | {} |
65 | static inline void delayacct_tsk_exit(struct task_struct *tsk) | 86 | static inline void delayacct_tsk_exit(struct task_struct *tsk) |
66 | {} | 87 | {} |
88 | static inline void delayacct_blkio_start(void) | ||
89 | {} | ||
90 | static 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 |