Skip to contentSkip to conversation

cfq-iosched: convert group idle time to jiffies

PATCH In review Alexandru Moise 2 participants 3 messages Dec 29, 2015 Block layer

lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 cfq-iosched: convert group idle time to jiffies

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.

---
V2: slice_idle not in miliseconds, convert only group_idle

 block/cfq-iosched.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
block/cfq-iosched.c +1 -1
index 1f9093e..088c45d 100644
@@ -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;
 
Signature · 1 line
1.9.1
maintainer
#1 lore raw
Quoted 6 lines · Alexandru Moise

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.

Quoted 8 lines

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.

Signature · 1 line
Jens Axboe
#2 lore raw
Quoted 12 lines · Jens Axboe
Quoted 11 lines · Alexandru Moise

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.

Quoted 11 lines
Quoted 3 lines

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.

Signature · 1 line
Jens Axboe

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

My bad..