Skip to contentSkip to conversation

block/nbd: micro-optimization in nbd request completion

PATCH In review Chetan Loke 3 participants 4 messages Jun 6, 2012 – Jul 31, 2012

Subsystems (4)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 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.

---
 drivers/block/nbd.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
drivers/block/nbd.c +1 -1
index 061427a..8957b9f 100644
@@ -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);
 	}
 
Signature · 1 line
1.7.5.2
Acked-by on v1 1/1
#1 lore raw

Makes sense. Looks good to me.

Quoted 25 lines · Chetan Loke

Add in-flight cmds to the tail. That way while searching(during request completion),we will always get a hit on the first element.

---
 drivers/block/nbd.c |    2 +-

 1 files changed, 1 insertions(+), 1 deletions(-)
drivers/block/nbd.c +1 -2
index 061427a..8957b9f 100644
@@ -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);
        }
 
--

1.7.5.2

#2 lore raw
Quoted 8 lines · Paul Clements

Makes sense. Looks good to me.

Quoted 3 lines · Chetan Loke

Add in-flight cmds to the tail. That way while searching(during request completion),we will always get a hit on the first element.

Paul/Jens,

Looks like this one isn't merged yet.

Chetan Loke

maintainer
#3 lore raw
Quoted 6 lines · chetan loke
Quoted 4 lines · Paul Clements

Makes sense. Looks good to me.

Quoted 8 lines
Quoted 4 lines · Chetan Loke
Quoted 3 lines

Add in-flight cmds to the tail. That way while searching(during request completion),we will always get a hit on the first element.

Paul/Jens,

Looks like this one isn't merged yet.

I've merged it now.

Signature · 1 line
Jens Axboe