[PATCH 05/24] io-controller: Modify cfq to make use of flat elevator fair queuing

Jerome Marchand jmarchan at redhat.com
Thu Jul 30 08:42:46 PDT 2009


Vivek Goyal wrote:
> @@ -1616,11 +1234,12 @@ static void changed_ioprio(struct io_context *ioc, struct cfq_io_context *cic)
>  	struct cfq_data *cfqd = cic->key;
>  	struct cfq_queue *cfqq;
>  	unsigned long flags;
> +	struct request_queue *q = cfqd->queue;

cfqd may be NULL here. We'd better test it before using it.

>  
>  	if (unlikely(!cfqd))
>  		return;
>  
> -	spin_lock_irqsave(cfqd->queue->queue_lock, flags);
> +	spin_lock_irqsave(q->queue_lock, flags);
>  
>  	cfqq = cic->cfqq[BLK_RW_ASYNC];
>  	if (cfqq) {
> @@ -1637,7 +1256,7 @@ static void changed_ioprio(struct io_context *ioc, struct cfq_io_context *cic)
>  	if (cfqq)
>  		cfq_mark_cfqq_prio_changed(cfqq);
>  
> -	spin_unlock_irqrestore(cfqd->queue->queue_lock, flags);
> +	spin_unlock_irqrestore(q->queue_lock, flags);
>  }
>  
>  static void cfq_ioc_set_ioprio(struct io_context *ioc)


--- block/cfq-iosched.c.orig	2009-07-29 10:22:08.000000000 +0200
+++ block/cfq-iosched.c	2009-07-30 17:25:05.000000000 +0200
@@ -1271,11 +1271,12 @@ static void changed_ioprio(struct io_con
 	struct cfq_data *cfqd = cic->key;
 	struct cfq_queue *cfqq;
 	unsigned long flags;
-	struct request_queue *q = cfqd->queue;
+	struct request_queue *q;
 
 	if (unlikely(!cfqd))
 		return;
 
+	q = cfqd->queue;
 	spin_lock_irqsave(q->queue_lock, flags);
 
 	cfqq = cic->cfqq[BLK_RW_ASYNC];


More information about the Containers mailing list