Skip to content

Commit

Permalink
block/nbd: micro-optimization in nbd request completion
Browse files Browse the repository at this point in the history
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 <[email protected]>
Acked-by: [email protected]
Signed-off-by: Jens Axboe <[email protected]>
  • Loading branch information
Chetan Loke authored and axboe committed Jul 31, 2012
1 parent 72ea1f7 commit 01ff5db
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/block/nbd.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}

Expand Down

0 comments on commit 01ff5db

Please sign in to comment.