Skip to contentSkip to conversation

cfq: set workload as expired if it doesn't have any slice left.

PATCH In review Gui Jianfeng 3 participants 3 messages Dec 15, 2009 Block layer

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 cfq: set workload as expired if it doesn't have any slice left.

When a group is resumed, if it doesn't have workload slice left, we should set workload_expires as expired. Otherwise, we might start from where we left in previous group by error. Thanks the idea from Corrado.

---
 block/cfq-iosched.c |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)
block/cfq-iosched.c +3 -1
index f3f6239..e2f8046 100644
@@ -2113,7 +2113,9 @@ static void cfq_choose_cfqg(struct cfq_data *cfqd)
 		cfqd->workload_expires = jiffies + cfqg->saved_workload_slice;
 		cfqd->serving_type = cfqg->saved_workload;
 		cfqd->serving_prio = cfqg->saved_serving_prio;
-	}
+	} else
+		cfqd->workload_expires = jiffies - 1;
+
 	choose_service_tree(cfqd, cfqg);
 }
 
Signature · 1 line
1.5.4.rc3
#1 lore raw
Quoted 4 lines · Gui Jianfeng

When a group is resumed, if it doesn't have workload slice left, we should set workload_expires as expired. Otherwise, we might start from where we left in previous group by error. Thanks the idea from Corrado.

Thanks for working this out guys, I have applied it.

Signature · 1 line
Jens Axboe
Acked-by on v1 1/1
#2 lore raw
In reply to Gui Jianfeng
Quoted 6 lines · Gui Jianfeng

When a group is resumed, if it doesn't have workload slice left, we should set workload_expires as expired. Otherwise, we might start from where we left in previous group by error. Thanks the idea from Corrado.

Thanks Gui. Looks good.

Vivek

Quoted 21 lines
---
 block/cfq-iosched.c |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)
block/cfq-iosched.c +3 -1
index f3f6239..e2f8046 100644
@@ -2113,7 +2113,9 @@ static void cfq_choose_cfqg(struct cfq_data *cfqd)
 		cfqd->workload_expires = jiffies + cfqg->saved_workload_slice;
 		cfqd->serving_type = cfqg->saved_workload;
 		cfqd->serving_prio = cfqg->saved_serving_prio;
-	}
+	} else
+		cfqd->workload_expires = jiffies - 1;
+
 	choose_service_tree(cfqd, cfqg);
 }
 
Signature · 1 line
1.5.4.rc3