Whamcloud - gitweb
LU-874 osc: prioritize writeback pages
authorJinshan Xiong <jinshan.xiong@whamcloud.com>
Fri, 3 Feb 2012 19:11:37 +0000 (11:11 -0800)
committerOleg Drokin <green@whamcloud.com>
Fri, 16 Mar 2012 01:36:39 +0000 (21:36 -0400)
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: I2f914df0204375a51f4a7565a75640e9bb3c6d19
Reviewed-on: http://review.whamcloud.com/2087
Tested-by: Hudson
Tested-by: Maloo <whamcloud.maloo@gmail.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
lustre/osc/osc_request.c

index b6948c1..7764ddf 100644 (file)
@@ -2451,10 +2451,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 */