]>
Commit | Line | Data |
---|---|---|
00e5a55c BS |
1 | Subject: block: optimizations in blk_rq_timed_out_timer() |
2 | From: malahal@us.ibm.com <malahal@us.ibm.com> | |
3 | Date: Mon Dec 29 08:28:42 2008 +0100: | |
4 | Git: 565e411d764eeda006738dfadbccca79d48381e1 | |
5 | References: bnc#464155 | |
6 | ||
7 | Now the rq->deadline can't be zero if the request is in the | |
8 | timeout_list, so there is no need to have next_set. There is no need to | |
9 | access a request's deadline field if blk_rq_timed_out is called on it. | |
10 | ||
11 | Signed-off-by: Malahal Naineni <malahal@us.ibm.com> | |
12 | Signed-off-by: Jens Axboe <jens.axboe@oracle.com> | |
13 | Signed-off-by: Hannes Reinecke <hare@suse.de> | |
14 | ||
15 | --- | |
16 | block/blk-timeout.c | 10 ++++------ | |
17 | 1 file changed, 4 insertions(+), 6 deletions(-) | |
18 | ||
19 | --- a/block/blk-timeout.c | |
20 | +++ b/block/blk-timeout.c | |
21 | @@ -48,7 +48,7 @@ static void blk_rq_timed_out(struct requ | |
22 | void blk_rq_timed_out_timer(unsigned long data) | |
23 | { | |
24 | struct request_queue *q = (struct request_queue *) data; | |
25 | - unsigned long flags, uninitialized_var(next), next_set = 0; | |
26 | + unsigned long flags, next = 0; | |
27 | struct request *rq, *tmp; | |
28 | ||
29 | spin_lock_irqsave(q->queue_lock, flags); | |
30 | @@ -63,12 +63,10 @@ void blk_rq_timed_out_timer(unsigned lon | |
31 | if (blk_mark_rq_complete(rq)) | |
32 | continue; | |
33 | blk_rq_timed_out(rq); | |
34 | + } else { | |
35 | + if (!next || time_after(next, rq->deadline)) | |
36 | + next = rq->deadline; | |
37 | } | |
38 | - if (!next_set) { | |
39 | - next = rq->deadline; | |
40 | - next_set = 1; | |
41 | - } else if (time_after(next, rq->deadline)) | |
42 | - next = rq->deadline; | |
43 | } | |
44 | ||
45 | if (next_set && !list_empty(&q->timeout_list)) |