block/nbd: micro-optimization in nbd request completion
authorChetan Loke <loke.chetan@gmail.com>
Tue, 31 Jul 2012 06:47:13 +0000 (08:47 +0200)
committerJens Axboe <axboe@kernel.dk>
Tue, 31 Jul 2012 06:47:13 +0000 (08:47 +0200)
Add in-flight cmds to the tail. That way while searching
(during request completion),we will always get a hit on the
first element.

Signed-off-by: Chetan Loke <loke.chetan@gmail.com>
Acked-by: Paul.Clements@steeleye.com
Signed-off-by: Jens Axboe <axboe@kernel.dk>
drivers/block/nbd.c

index 061427a75d375a5ed0655bdac8422e668a252a5e..8957b9f0cfaddee18e9b8a47ac50d22db4bfb7c2 100644 (file)
@@ -481,7 +481,7 @@ static void nbd_handle_req(struct nbd_device *nbd, struct request *req)
                nbd_end_request(req);
        } else {
                spin_lock(&nbd->queue_lock);
-               list_add(&req->queuelist, &nbd->queue_head);
+               list_add_tail(&req->queuelist, &nbd->queue_head);
                spin_unlock(&nbd->queue_lock);
        }