Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1298818 > unrolled thread

[PATCH] cfq-iosched: convert slice idle time to jiffies

Started byAlexandru Moise <00moses.alexander00@gmail.com>
First post2015-12-29 02:10 +0100
Last post2015-12-29 18:40 +0100
Articles 3 — 2 participants

Back to article view | Back to linux.kernel


Contents

  [PATCH] cfq-iosched: convert slice idle time to jiffies Alexandru Moise <00moses.alexander00@gmail.com> - 2015-12-29 02:10 +0100
    Re: [PATCH] cfq-iosched: convert slice idle time to jiffies Jens Axboe <axboe@kernel.dk> - 2015-12-29 18:20 +0100
      Re: [PATCH] cfq-iosched: convert slice idle time to jiffies Alexandru Moise <00moses.alexander00@gmail.com> - 2015-12-29 18:40 +0100

#1298818 — [PATCH] cfq-iosched: convert slice idle time to jiffies

FromAlexandru Moise <00moses.alexander00@gmail.com>
Date2015-12-29 02:10 +0100
Subject[PATCH] cfq-iosched: convert slice idle time to jiffies
Message-ID<qKQXw-1JA-9@gated-at.bofh.it>
This patch refers to Jens Axboe's change way back in 2006:
7b14e3b52 cfq-iosched: slice expiry fixups

In this patch he fixed a potential timer race condition by delaying
idle_slice_timer by the slice_idle time value.

Today this timer is delayed by either slice_idle or group_idle time
values, which on my system, and according to
Documentation/block/cfq-iosched.txt the default value for both is 8ms.

Since the time given by either variables is supposed to be in
milliseconds we should convert that value from milliseconds to jiffies
before adding it to jiffies variable and setting our timer.

In my obervations the area is really active as I've seen that function
get called a lot for each device on my btrfs raid setup during btrfs
check. I've also timed the btrfs check before and after applying the
patch and I might've noticed a very slight improvement in execution
time but the numbers vary too much for me to post any believable
numbers (10 milliseconds difference at most on average).

Signed-off-by: Alexandru Moise <00moses.alexader00@gmail.com>
---
 block/cfq-iosched.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/block/cfq-iosched.c b/block/cfq-iosched.c
index 1f9093e..eec65fb 100644
--- a/block/cfq-iosched.c
+++ b/block/cfq-iosched.c
@@ -2958,7 +2958,7 @@ static void cfq_arm_slice_timer(struct cfq_data *cfqd)
 	else
 		sl = cfqd->cfq_slice_idle;
 
-	mod_timer(&cfqd->idle_slice_timer, jiffies + sl);
+	mod_timer(&cfqd->idle_slice_timer, jiffies + msecs_to_jiffies(sl));
 	cfqg_stats_set_start_idle_time(cfqq->cfqg);
 	cfq_log_cfqq(cfqd, cfqq, "arm_idle: %lu group_idle: %d", sl,
 			group_idle ? 1 : 0);
-- 
1.9.1

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[toc] | [next] | [standalone]


#1299060

FromJens Axboe <axboe@kernel.dk>
Date2015-12-29 18:20 +0100
Message-ID<qL66f-3rU-21@gated-at.bofh.it>
In reply to#1298818
On 12/28/2015 06:08 PM, Alexandru Moise wrote:
> This patch refers to Jens Axboe's change way back in 2006:
> 7b14e3b52 cfq-iosched: slice expiry fixups
>
> In this patch he fixed a potential timer race condition by delaying
> idle_slice_timer by the slice_idle time value.
>
> Today this timer is delayed by either slice_idle or group_idle time
> values, which on my system, and according to
> Documentation/block/cfq-iosched.txt the default value for both is 8ms.
>
> Since the time given by either variables is supposed to be in
> milliseconds we should convert that value from milliseconds to jiffies
> before adding it to jiffies variable and setting our timer.
>
> In my obervations the area is really active as I've seen that function
> get called a lot for each device on my btrfs raid setup during btrfs
> check. I've also timed the btrfs check before and after applying the
> patch and I might've noticed a very slight improvement in execution
> time but the numbers vary too much for me to post any believable
> numbers (10 milliseconds difference at most on average).

cfqd->cfq_slice_idle is in jiffies, it's not in msecs.

-- 
Jens Axboe

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[toc] | [prev] | [next] | [standalone]


#1299062

FromAlexandru Moise <00moses.alexander00@gmail.com>
Date2015-12-29 18:40 +0100
Message-ID<qL6pB-3za-35@gated-at.bofh.it>
In reply to#1299060
On Tue, Dec 29, 2015 at 10:19:17AM -0700, Jens Axboe wrote:
> On 12/28/2015 06:08 PM, Alexandru Moise wrote:
> >This patch refers to Jens Axboe's change way back in 2006:
> >7b14e3b52 cfq-iosched: slice expiry fixups
> >
> >In this patch he fixed a potential timer race condition by delaying
> >idle_slice_timer by the slice_idle time value.
> >
> >Today this timer is delayed by either slice_idle or group_idle time
> >values, which on my system, and according to
> >Documentation/block/cfq-iosched.txt the default value for both is 8ms.
> >
> >Since the time given by either variables is supposed to be in
> >milliseconds we should convert that value from milliseconds to jiffies
> >before adding it to jiffies variable and setting our timer.
> >
> >In my obervations the area is really active as I've seen that function
> >get called a lot for each device on my btrfs raid setup during btrfs
> >check. I've also timed the btrfs check before and after applying the
> >patch and I might've noticed a very slight improvement in execution
> >time but the numbers vary too much for me to post any believable
> >numbers (10 milliseconds difference at most on average).
> 
> cfqd->cfq_slice_idle is in jiffies, it's not in msecs.
> 
> -- 
> Jens Axboe
> 

Then should I only do the conversion in the case of group_idle?
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web