aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlex Elder <elder@inktank.com>2013-03-25 19:16:11 -0400
committerSage Weil <sage@inktank.com>2013-05-02 00:17:19 -0400
commitad885927dee2e72fbfab624c7599cb9d9352cc04 (patch)
treeba97df9b6f8eef6a669bd811c9b8f2776e02951d
parente02493c07c4cb08106d0b3a4b5003c7c005010fb (diff)
libceph: keep request lists in tid order
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> Reviewed-off-by: Sage Weil <sage@inktank.com>
-rw-r--r--net/ceph/osd_client.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/net/ceph/osd_client.c b/net/ceph/osd_client.c
index 8b84fb4980ba..356f7bc4ae4b 100644
--- a/net/ceph/osd_client.c
+++ b/net/ceph/osd_client.c
@@ -619,7 +619,7 @@ static void __kick_osd_requests(struct ceph_osd_client *osdc,
619 BUG_ON(!list_empty(&req->r_req_lru_item)); 619 BUG_ON(!list_empty(&req->r_req_lru_item));
620 __register_request(osdc, req); 620 __register_request(osdc, req);
621 list_add_tail(&req->r_req_lru_item, &osdc->req_unsent); 621 list_add_tail(&req->r_req_lru_item, &osdc->req_unsent);
622 list_add(&req->r_osd_item, &req->r_osd->o_requests); 622 list_add_tail(&req->r_osd_item, &req->r_osd->o_requests);
623 __unregister_linger_request(osdc, req); 623 __unregister_linger_request(osdc, req);
624 dout("requeued lingering %p tid %llu osd%d\n", req, req->r_tid, 624 dout("requeued lingering %p tid %llu osd%d\n", req, req->r_tid,
625 osd->o_osd); 625 osd->o_osd);
@@ -1035,10 +1035,10 @@ static int __map_request(struct ceph_osd_client *osdc,
1035 1035
1036 if (req->r_osd) { 1036 if (req->r_osd) {
1037 __remove_osd_from_lru(req->r_osd); 1037 __remove_osd_from_lru(req->r_osd);
1038 list_add(&req->r_osd_item, &req->r_osd->o_requests); 1038 list_add_tail(&req->r_osd_item, &req->r_osd->o_requests);
1039 list_move(&req->r_req_lru_item, &osdc->req_unsent); 1039 list_move_tail(&req->r_req_lru_item, &osdc->req_unsent);
1040 } else { 1040 } else {
1041 list_move(&req->r_req_lru_item, &osdc->req_notarget); 1041 list_move_tail(&req->r_req_lru_item, &osdc->req_notarget);
1042 } 1042 }
1043 err = 1; /* osd or pg changed */ 1043 err = 1; /* osd or pg changed */
1044 1044