diff options
Diffstat (limited to 'include')
-rw-r--r-- | include/linux/delayacct.h | 25 | ||||
-rw-r--r-- | include/linux/sched.h | 13 |
2 files changed, 38 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 |
diff --git a/include/linux/sched.h b/include/linux/sched.h index 7a54e62763c5..2f43f1fb7de7 100644 --- a/include/linux/sched.h +++ b/include/linux/sched.h | |||
@@ -566,6 +566,19 @@ struct task_delay_info { | |||
566 | * Atomicity of updates to XXX_delay, XXX_count protected by | 566 | * Atomicity of updates to XXX_delay, XXX_count protected by |
567 | * single lock above (split into XXX_lock if contention is an issue). | 567 | * single lock above (split into XXX_lock if contention is an issue). |
568 | */ | 568 | */ |
569 | |||
570 | /* | ||
571 | * XXX_count is incremented on every XXX operation, the delay | ||
572 | * associated with the operation is added to XXX_delay. | ||
573 | * XXX_delay contains the accumulated delay time in nanoseconds. | ||
574 | */ | ||
575 | struct timespec blkio_start, blkio_end; /* Shared by blkio, swapin */ | ||
576 | u64 blkio_delay; /* wait for sync block io completion */ | ||
577 | u64 swapin_delay; /* wait for swapin block io completion */ | ||
578 | u32 blkio_count; /* total count of the number of sync block */ | ||
579 | /* io operations performed */ | ||
580 | u32 swapin_count; /* total count of the number of swapin block */ | ||
581 | /* io operations performed */ | ||
569 | }; | 582 | }; |
570 | #endif | 583 | #endif |
571 | 584 | ||