All of lore.kernel.org
 help / color / mirror / Atom feed
From: Alex Elder <elder@inktank.com>
To: ceph-devel@vger.kernel.org
Subject: [PATCH 4/6] libceph: keep request lists in tid order
Date: Mon, 25 Mar 2013 21:27:56 -0500	[thread overview]
Message-ID: <515107AC.5090407@inktank.com> (raw)
In-Reply-To: <5151071C.3000309@inktank.com>

In __map_request(), when adding a request to an osd client's unsent
list, add it to the tail rather than the head.  That way the newest
entries (with the highest tid value) will be last.

Maintain an osd's request list in order of increasing tid also.

Finally--to be consistent--maintain an osd client's "notarget" list
in that order as well.

This partially resolves:
    http://tracker.ceph.com/issues/4392

Signed-off-by: Alex Elder <elder@inktank.com>
---
 net/ceph/osd_client.c |    8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/net/ceph/osd_client.c b/net/ceph/osd_client.c
index 707d632..202b9cd 100644
--- a/net/ceph/osd_client.c
+++ b/net/ceph/osd_client.c
@@ -606,7 +606,7 @@ static void __kick_osd_requests(struct
ceph_osd_client *osdc,
 		BUG_ON(!list_empty(&req->r_req_lru_item));
 		__register_request(osdc, req);
 		list_add_tail(&req->r_req_lru_item, &osdc->req_unsent);
-		list_add(&req->r_osd_item, &req->r_osd->o_requests);
+		list_add_tail(&req->r_osd_item, &req->r_osd->o_requests);
 		__unregister_linger_request(osdc, req);
 		dout("requeued lingering %p tid %llu osd%d\n", req, req->r_tid,
 		     osd->o_osd);
@@ -1022,10 +1022,10 @@ static int __map_request(struct ceph_osd_client
*osdc,

 	if (req->r_osd) {
 		__remove_osd_from_lru(req->r_osd);
-		list_add(&req->r_osd_item, &req->r_osd->o_requests);
-		list_move(&req->r_req_lru_item, &osdc->req_unsent);
+		list_add_tail(&req->r_osd_item, &req->r_osd->o_requests);
+		list_move_tail(&req->r_req_lru_item, &osdc->req_unsent);
 	} else {
-		list_move(&req->r_req_lru_item, &osdc->req_notarget);
+		list_move_tail(&req->r_req_lru_item, &osdc->req_notarget);
 	}
 	err = 1;   /* osd or pg changed */

-- 
1.7.9.5


  parent reply	other threads:[~2013-03-26  2:27 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-03-26  2:25 [PATCH 0/6] libceph: send osd requests in tid order Alex Elder
2013-03-26  2:27 ` [PATCH 1/6] libceph: slightly defer registering osd request Alex Elder
2013-03-26  2:27 ` [PATCH 2/6] libceph: no more kick_requests() race Alex Elder
2013-03-26  2:27 ` [PATCH 3/6] libceph: prepend requests in order when kicking Alex Elder
2013-03-26 14:50   ` [PATCH 3/6, v2] libceph: requeue only sent requests " Alex Elder
2013-03-26  2:27 ` Alex Elder [this message]
2013-03-26  2:28 ` [PATCH 5/6] libceph: send queued requests when starting new one Alex Elder
2013-03-26  2:28 ` [PATCH 6/6] libceph: verify requests queued in order Alex Elder
2013-03-26 14:50   ` [PATCH 6/6, v2] " Alex Elder
2013-03-26 14:49 ` [PATCH 0/6] libceph: send osd requests in tid order Alex Elder

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=515107AC.5090407@inktank.com \
    --to=elder@inktank.com \
    --cc=ceph-devel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.