From: Chetan Loke Date: Tue, 31 Jul 2012 06:47:13 +0000 (+0200) Subject: block/nbd: micro-optimization in nbd request completion X-Git-Tag: firefly_0821_release~3680^2~2262^2~8 X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=01ff5dbc0925d11c8ad76eed3bdd02d0c7e1e0f5;p=firefly-linux-kernel-4.4.55.git block/nbd: micro-optimization in nbd request completion 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 Acked-by: Paul.Clements@steeleye.com Signed-off-by: Jens Axboe --- diff --git a/drivers/block/nbd.c b/drivers/block/nbd.c index 061427a75d37..8957b9f0cfad 100644 --- a/drivers/block/nbd.c +++ b/drivers/block/nbd.c @@ -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); }