Skip to contentSkip to conversation

cfq-iosched: Do not merge queues of BE and IDLE classes

PATCH Applied Divyesh Shah 3 participants 3 messages Mar 24, 2010 – Mar 25, 2010 Block layer

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 cfq-iosched: Do not merge queues of BE and IDLE classes

even if they are found to be co-operating.

The prio_trees do not have any IDLE cfqqs on them. cfq_close_cooperator() is called from cfq_select_queue() and cfq_completed_request(). The latter ensures that the close cooperator code does not get invoked if the current cfqq is of class IDLE but the former doesn't seem to have any such checks. So an IDLE cfqq may get merged with a BE cfqq from the same group which should be avoided.

---

 block/cfq-iosched.c |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)
block/cfq-iosched.c +2 -0
index dee9d93..e6910dc 100644
@@ -1721,6 +1721,8 @@ static struct cfq_queue *cfq_close_cooperator(struct cfq_data *cfqd,
 {
 	struct cfq_queue *cfqq;
 
+	if (cfq_class_idle(cur_cfqq))
+		return NULL;
 	if (!cfq_cfqq_sync(cur_cfqq))
 		return NULL;
 	if (CFQQ_SEEKY(cur_cfqq))
Acked-by on v1 1/1
#1 lore raw
Quoted 11 lines · Divyesh Shah

even if they are found to be co-operating.

The prio_trees do not have any IDLE cfqqs on them. cfq_close_cooperator() is called from cfq_select_queue() and cfq_completed_request(). The latter ensures that the close cooperator code does not get invoked if the current cfqq is of class IDLE but the former doesn't seem to have any such checks. So an IDLE cfqq may get merged with a BE cfqq from the same group which should be avoided.

---

Looks good to me.

Vivek

Quoted 17 lines
 block/cfq-iosched.c |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)
block/cfq-iosched.c +2 -0
index dee9d93..e6910dc 100644
@@ -1721,6 +1721,8 @@ static struct cfq_queue *cfq_close_cooperator(struct cfq_data *cfqd,
 {
 	struct cfq_queue *cfqq;
 
+	if (cfq_class_idle(cur_cfqq))
+		return NULL;
 	if (!cfq_cfqq_sync(cur_cfqq))
 		return NULL;
 	if (CFQQ_SEEKY(cur_cfqq))
Applied
#2 lore raw
In reply to Divyesh Shah
Quoted 8 lines · Divyesh Shah

even if they are found to be co-operating.

The prio_trees do not have any IDLE cfqqs on them. cfq_close_cooperator() is called from cfq_select_queue() and cfq_completed_request(). The latter ensures that the close cooperator code does not get invoked if the current cfqq is of class IDLE but the former doesn't seem to have any such checks. So an IDLE cfqq may get merged with a BE cfqq from the same group which should be avoided.

Thanks, applied.

Signature · 1 line
Jens Axboe