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


Groups > linux.kernel > #1299122 > unrolled thread

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

Started byAlexandru Moise <00moses.alexander00@gmail.com>
First post2015-12-29 21:20 +0100
Last post2015-12-29 21:30 +0100
Articles 3 — 2 participants

Back to article view | Back to linux.kernel


Contents

  [PATCH v2] cfq-iosched: convert group idle time to jiffies Alexandru Moise <00moses.alexander00@gmail.com> - 2015-12-29 21:20 +0100
    Re: [PATCH v2] cfq-iosched: convert group idle time to jiffies Jens Axboe <axboe@kernel.dk> - 2015-12-29 21:30 +0100
      Re: [PATCH v2] cfq-iosched: convert group idle time to jiffies Alexandru Moise <00moses.alexander00@gmail.com> - 2015-12-29 21:30 +0100

#1299122 — [PATCH v2] cfq-iosched: convert group idle time to jiffies

FromAlexandru Moise <00moses.alexander00@gmail.com>
Date2015-12-29 21:20 +0100
Subject[PATCH v2] cfq-iosched: convert group idle time to jiffies
Message-ID<qL8Uq-5fn-19@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 group_idle
is 8ms.

Since the time given by group_idle 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.

Signed-off-by: Alexandru Moise <00moses.alexader00@gmail.com>
---
V2: slice_idle not in miliseconds, convert only group_idle

 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..088c45d 100644
--- a/block/cfq-iosched.c
+++ b/block/cfq-iosched.c
@@ -2954,7 +2954,7 @@ static void cfq_arm_slice_timer(struct cfq_data *cfqd)
 	cfq_mark_cfqq_wait_request(cfqq);
 
 	if (group_idle)
-		sl = cfqd->cfq_group_idle;
+		sl = msecs_to_jiffies(cfqd->cfq_group_idle);
 	else
 		sl = cfqd->cfq_slice_idle;
 
-- 
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]


#1299123

FromJens Axboe <axboe@kernel.dk>
Date2015-12-29 21:30 +0100
Message-ID<qL945-5iB-3@gated-at.bofh.it>
In reply to#1299122
On 12/29/2015 01:16 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 group_idle
> is 8ms.
>
> Since the time given by group_idle 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.

Again, the slice idle values are stored in jiffies, there's no need to 
convert. I think you are missing the fact that we display the value in 
msecs, and convert when displaying/storing through sysfs.

-- 
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]


#1299125

FromAlexandru Moise <00moses.alexander00@gmail.com>
Date2015-12-29 21:30 +0100
Message-ID<qL946-5iB-13@gated-at.bofh.it>
In reply to#1299123
On Tue, Dec 29, 2015 at 01:19:57PM -0700, Jens Axboe wrote:
> On 12/29/2015 01:16 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 group_idle
> >is 8ms.
> >
> >Since the time given by group_idle 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.
> 
> Again, the slice idle values are stored in jiffies, there's no need
> to convert. I think you are missing the fact that we display the
> value in msecs, and convert when displaying/storing through sysfs.
> 
> -- 
> Jens Axboe
> 

Damn, yeah just saw the conversion in the STORE/SHOW_FUNCTION macros.

My bad..
--
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