Whamcloud - gitweb
LU-874 osc: prioritize writeback pages
authorJinshan Xiong <jinshan.xiong@whamcloud.com>
Tue, 10 Jan 2012 07:34:06 +0000 (23:34 -0800)
committerOleg Drokin <green@whamcloud.com>
Mon, 13 Feb 2012 17:24:27 +0000 (12:24 -0500)
When a lock is being canceled, we should prioritize those covering
pages which have already been submitted by page writeback daemon;
otherwise, this client may be evicted because there is no active IO
for that lock for a long time.

Signed-off-by: Jinshan Xiong <jinshan.xiong@whamcloud.com>
Change-Id: If14eff6361f55d2b2eeb2db7146789dda4c32060
Reviewed-on: http://review.whamcloud.com/1938
Tested-by: Hudson
Tested-by: Maloo <whamcloud.maloo@gmail.com>
Reviewed-by: Johann Lombardi <johann@whamcloud.com>
Reviewed-by: Niu Yawei <niu@whamcloud.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
lustre/osc/osc_request.c

index a1aaaeb..c4ea288 100644 (file)
@@ -2432,10 +2432,14 @@ osc_send_oap_rpc(const struct lu_env *env, struct client_obd *cli,
          * with ASYNC_HP. We have to send out them as soon as possible. */
         cfs_list_for_each_entry_safe(oap, tmp, &lop->lop_urgent, oap_urgent_item) {
                 if (oap->oap_async_flags & ASYNC_HP)
-                        cfs_list_move(&oap->oap_pending_item, &lop->lop_pending);
+                        cfs_list_move(&oap->oap_pending_item, &rpc_list);
+                else if (!(oap->oap_brw_flags & OBD_BRW_SYNC))
+                        /* only do this for writeback pages. */
+                        cfs_list_move_tail(&oap->oap_pending_item, &rpc_list);
                 if (++page_count >= cli->cl_max_pages_per_rpc)
                         break;
         }
+        cfs_list_splice_init(&rpc_list, &lop->lop_pending);
         page_count = 0;
 
         /* first we find the pages we're allowed to work with */