diff options
author | Trond Myklebust <Trond.Myklebust@netapp.com> | 2007-07-14 15:40:00 -0400 |
---|---|---|
committer | Trond Myklebust <Trond.Myklebust@netapp.com> | 2008-01-30 02:05:30 -0500 |
commit | 3ff7576ddac06c3d07089e241b40826d24bbf1ac (patch) | |
tree | 7f5998434b7d0dd1f08ff7ee65c93fab4861a6d3 /include/linux | |
parent | c970aa85e71bd581726c42df843f6f129db275ac (diff) |
SUNRPC: Clean up the initialisation of priority queue scheduling info.
We want the default scheduling priority (priority == 0) to remain
RPC_PRIORITY_NORMAL.
Also ensure that the priority wait queue scheduling is per process id
instead of sometimes being per thread, and sometimes being per inode.
Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
Diffstat (limited to 'include/linux')
-rw-r--r-- | include/linux/sunrpc/sched.h | 17 |
1 files changed, 9 insertions, 8 deletions
diff --git a/include/linux/sunrpc/sched.h b/include/linux/sunrpc/sched.h index d974421d7647..c9444fdc23ac 100644 --- a/include/linux/sunrpc/sched.h +++ b/include/linux/sunrpc/sched.h | |||
@@ -56,8 +56,6 @@ struct rpc_task { | |||
56 | __u8 tk_garb_retry; | 56 | __u8 tk_garb_retry; |
57 | __u8 tk_cred_retry; | 57 | __u8 tk_cred_retry; |
58 | 58 | ||
59 | unsigned long tk_cookie; /* Cookie for batching tasks */ | ||
60 | |||
61 | /* | 59 | /* |
62 | * timeout_fn to be executed by timer bottom half | 60 | * timeout_fn to be executed by timer bottom half |
63 | * callback to be executed after waking up | 61 | * callback to be executed after waking up |
@@ -78,7 +76,6 @@ struct rpc_task { | |||
78 | struct timer_list tk_timer; /* kernel timer */ | 76 | struct timer_list tk_timer; /* kernel timer */ |
79 | unsigned long tk_timeout; /* timeout for rpc_sleep() */ | 77 | unsigned long tk_timeout; /* timeout for rpc_sleep() */ |
80 | unsigned short tk_flags; /* misc flags */ | 78 | unsigned short tk_flags; /* misc flags */ |
81 | unsigned char tk_priority : 2;/* Task priority */ | ||
82 | unsigned long tk_runstate; /* Task run status */ | 79 | unsigned long tk_runstate; /* Task run status */ |
83 | struct workqueue_struct *tk_workqueue; /* Normally rpciod, but could | 80 | struct workqueue_struct *tk_workqueue; /* Normally rpciod, but could |
84 | * be any workqueue | 81 | * be any workqueue |
@@ -94,6 +91,9 @@ struct rpc_task { | |||
94 | unsigned long tk_start; /* RPC task init timestamp */ | 91 | unsigned long tk_start; /* RPC task init timestamp */ |
95 | long tk_rtt; /* round-trip time (jiffies) */ | 92 | long tk_rtt; /* round-trip time (jiffies) */ |
96 | 93 | ||
94 | pid_t tk_owner; /* Process id for batching tasks */ | ||
95 | unsigned char tk_priority : 2;/* Task priority */ | ||
96 | |||
97 | #ifdef RPC_DEBUG | 97 | #ifdef RPC_DEBUG |
98 | unsigned short tk_pid; /* debugging aid */ | 98 | unsigned short tk_pid; /* debugging aid */ |
99 | #endif | 99 | #endif |
@@ -123,6 +123,7 @@ struct rpc_task_setup { | |||
123 | const struct rpc_call_ops *callback_ops; | 123 | const struct rpc_call_ops *callback_ops; |
124 | void *callback_data; | 124 | void *callback_data; |
125 | unsigned short flags; | 125 | unsigned short flags; |
126 | signed char priority; | ||
126 | }; | 127 | }; |
127 | 128 | ||
128 | /* | 129 | /* |
@@ -187,10 +188,10 @@ struct rpc_task_setup { | |||
187 | * Note: if you change these, you must also change | 188 | * Note: if you change these, you must also change |
188 | * the task initialization definitions below. | 189 | * the task initialization definitions below. |
189 | */ | 190 | */ |
190 | #define RPC_PRIORITY_LOW 0 | 191 | #define RPC_PRIORITY_LOW (-1) |
191 | #define RPC_PRIORITY_NORMAL 1 | 192 | #define RPC_PRIORITY_NORMAL (0) |
192 | #define RPC_PRIORITY_HIGH 2 | 193 | #define RPC_PRIORITY_HIGH (1) |
193 | #define RPC_NR_PRIORITY (RPC_PRIORITY_HIGH+1) | 194 | #define RPC_NR_PRIORITY (1 + RPC_PRIORITY_HIGH - RPC_PRIORITY_LOW) |
194 | 195 | ||
195 | /* | 196 | /* |
196 | * RPC synchronization objects | 197 | * RPC synchronization objects |
@@ -198,7 +199,7 @@ struct rpc_task_setup { | |||
198 | struct rpc_wait_queue { | 199 | struct rpc_wait_queue { |
199 | spinlock_t lock; | 200 | spinlock_t lock; |
200 | struct list_head tasks[RPC_NR_PRIORITY]; /* task queue for each priority level */ | 201 | struct list_head tasks[RPC_NR_PRIORITY]; /* task queue for each priority level */ |
201 | unsigned long cookie; /* cookie of last task serviced */ | 202 | pid_t owner; /* process id of last task serviced */ |
202 | unsigned char maxpriority; /* maximum priority (0 if queue is not a priority queue) */ | 203 | unsigned char maxpriority; /* maximum priority (0 if queue is not a priority queue) */ |
203 | unsigned char priority; /* current priority */ | 204 | unsigned char priority; /* current priority */ |
204 | unsigned char count; /* # task groups remaining serviced so far */ | 205 | unsigned char count; /* # task groups remaining serviced so far */ |