]> git.ipfire.org Git - people/pmueller/ipfire-2.x.git/blame - src/patches/suse-2.6.27.25/patches.fixes/block-use-round_jiffies_up
Reenabled linux-xen and xen-image build
[people/pmueller/ipfire-2.x.git] / src / patches / suse-2.6.27.25 / patches.fixes / block-use-round_jiffies_up
CommitLineData
00e5a55c
BS
1Subject: Block: use round_jiffies_up()
2From: Alan Stern <stern@rowland.harvard.edu>
3Date: Thu Nov 6 08:42:49 2008 +0100:
4Git: 7838c15b8dd18e78a523513749e5b54bda07b0cb
5References: bnc#464155
6
7This patch (as1159b) changes the timeout routines in the block core to
8use round_jiffies_up(). There's no point in rounding the timer
9deadline down, since if it expires too early we will have to restart
10it.
11
12The patch also removes some unnecessary tests when a request is
13removed from the queue's timer list.
14
15Signed-off-by: Alan Stern <stern@rowland.harvard.edu>
16Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
17Signed-off-by: Hannes Reinecke <hare@suse.de>
18
19---
20 block/blk-timeout.c | 20 +++-----------------
21 1 file changed, 3 insertions(+), 17 deletions(-)
22
23--- a/block/blk-timeout.c
24+++ b/block/blk-timeout.c
25@@ -16,14 +16,7 @@ void blk_delete_timer(struct request *re
26 {
27 struct request_queue *q = req->q;
28
29- /*
30- * Nothing to detach
31- */
32- if (!q->rq_timed_out_fn || !req->deadline)
33- return;
34-
35 list_del_init(&req->timeout_list);
36-
37 if (list_empty(&q->timeout_list))
38 del_timer(&q->timeout);
39 }
40@@ -83,7 +76,7 @@ void blk_rq_timed_out_timer(unsigned lon
41 }
42
43 if (next_set && !list_empty(&q->timeout_list))
44- mod_timer(&q->timeout, round_jiffies(next));
45+ mod_timer(&q->timeout, round_jiffies_up(next));
46
47 spin_unlock_irqrestore(q->queue_lock, flags);
48 }
49@@ -139,17 +132,10 @@ void blk_add_timer(struct request *req)
50
51 /*
52 * If the timer isn't already pending or this timeout is earlier
53- * than an existing one, modify the timer. Round to next nearest
54+ * than an existing one, modify the timer. Round up to next nearest
55 * second.
56 */
57- expiry = round_jiffies(req->deadline);
58-
59- /*
60- * We use ->deadline == 0 to detect whether a timer was added or
61- * not, so just increase to next jiffy for that specific case
62- */
63- if (unlikely(!req->deadline))
64- req->deadline = 1;
65+ expiry = round_jiffies_up(req->deadline);
66
67 if (!timer_pending(&q->timeout) ||
68 time_before(expiry, q->timeout.expires))