diff options
Diffstat (limited to 'include/linux/iocontext.h')
-rw-r--r-- | include/linux/iocontext.h | 43 |
1 files changed, 8 insertions, 35 deletions
diff --git a/include/linux/iocontext.h b/include/linux/iocontext.h index 4da4a75c3f1e..a0bb301afac0 100644 --- a/include/linux/iocontext.h +++ b/include/linux/iocontext.h | |||
@@ -4,32 +4,6 @@ | |||
4 | #include <linux/radix-tree.h> | 4 | #include <linux/radix-tree.h> |
5 | #include <linux/rcupdate.h> | 5 | #include <linux/rcupdate.h> |
6 | 6 | ||
7 | /* | ||
8 | * This is the per-process anticipatory I/O scheduler state. | ||
9 | */ | ||
10 | struct as_io_context { | ||
11 | spinlock_t lock; | ||
12 | |||
13 | void (*dtor)(struct as_io_context *aic); /* destructor */ | ||
14 | void (*exit)(struct as_io_context *aic); /* called on task exit */ | ||
15 | |||
16 | unsigned long state; | ||
17 | atomic_t nr_queued; /* queued reads & sync writes */ | ||
18 | atomic_t nr_dispatched; /* number of requests gone to the drivers */ | ||
19 | |||
20 | /* IO History tracking */ | ||
21 | /* Thinktime */ | ||
22 | unsigned long last_end_request; | ||
23 | unsigned long ttime_total; | ||
24 | unsigned long ttime_samples; | ||
25 | unsigned long ttime_mean; | ||
26 | /* Layout pattern */ | ||
27 | unsigned int seek_samples; | ||
28 | sector_t last_request_pos; | ||
29 | u64 seek_total; | ||
30 | sector_t seek_mean; | ||
31 | }; | ||
32 | |||
33 | struct cfq_queue; | 7 | struct cfq_queue; |
34 | struct cfq_io_context { | 8 | struct cfq_io_context { |
35 | void *key; | 9 | void *key; |
@@ -40,16 +14,11 @@ struct cfq_io_context { | |||
40 | struct io_context *ioc; | 14 | struct io_context *ioc; |
41 | 15 | ||
42 | unsigned long last_end_request; | 16 | unsigned long last_end_request; |
43 | sector_t last_request_pos; | ||
44 | 17 | ||
45 | unsigned long ttime_total; | 18 | unsigned long ttime_total; |
46 | unsigned long ttime_samples; | 19 | unsigned long ttime_samples; |
47 | unsigned long ttime_mean; | 20 | unsigned long ttime_mean; |
48 | 21 | ||
49 | unsigned int seek_samples; | ||
50 | u64 seek_total; | ||
51 | sector_t seek_mean; | ||
52 | |||
53 | struct list_head queue_list; | 22 | struct list_head queue_list; |
54 | struct hlist_node cic_list; | 23 | struct hlist_node cic_list; |
55 | 24 | ||
@@ -73,13 +42,16 @@ struct io_context { | |||
73 | unsigned short ioprio; | 42 | unsigned short ioprio; |
74 | unsigned short ioprio_changed; | 43 | unsigned short ioprio_changed; |
75 | 44 | ||
45 | #if defined(CONFIG_BLK_CGROUP) || defined(CONFIG_BLK_CGROUP_MODULE) | ||
46 | unsigned short cgroup_changed; | ||
47 | #endif | ||
48 | |||
76 | /* | 49 | /* |
77 | * For request batching | 50 | * For request batching |
78 | */ | 51 | */ |
79 | unsigned long last_waited; /* Time last woken after wait for request */ | ||
80 | int nr_batch_requests; /* Number of requests left in the batch */ | 52 | int nr_batch_requests; /* Number of requests left in the batch */ |
53 | unsigned long last_waited; /* Time last woken after wait for request */ | ||
81 | 54 | ||
82 | struct as_io_context *aic; | ||
83 | struct radix_tree_root radix_root; | 55 | struct radix_tree_root radix_root; |
84 | struct hlist_head cic_list; | 56 | struct hlist_head cic_list; |
85 | void *ioc_data; | 57 | void *ioc_data; |
@@ -99,14 +71,15 @@ static inline struct io_context *ioc_task_link(struct io_context *ioc) | |||
99 | return NULL; | 71 | return NULL; |
100 | } | 72 | } |
101 | 73 | ||
74 | struct task_struct; | ||
102 | #ifdef CONFIG_BLOCK | 75 | #ifdef CONFIG_BLOCK |
103 | int put_io_context(struct io_context *ioc); | 76 | int put_io_context(struct io_context *ioc); |
104 | void exit_io_context(void); | 77 | void exit_io_context(struct task_struct *task); |
105 | struct io_context *get_io_context(gfp_t gfp_flags, int node); | 78 | struct io_context *get_io_context(gfp_t gfp_flags, int node); |
106 | struct io_context *alloc_io_context(gfp_t gfp_flags, int node); | 79 | struct io_context *alloc_io_context(gfp_t gfp_flags, int node); |
107 | void copy_io_context(struct io_context **pdst, struct io_context **psrc); | 80 | void copy_io_context(struct io_context **pdst, struct io_context **psrc); |
108 | #else | 81 | #else |
109 | static inline void exit_io_context(void) | 82 | static inline void exit_io_context(struct task_struct *task) |
110 | { | 83 | { |
111 | } | 84 | } |
112 | 85 | ||