Whamcloud - gitweb
LU-9771 lov: skip empty pages in lov_io_submit() 94/29094/14
authorJinshan Xiong <jinshan.xiong@intel.com>
Sat, 26 Aug 2017 19:49:38 +0000 (12:49 -0700)
committerJinshan Xiong <jinshan.xiong@intel.com>
Mon, 20 Nov 2017 21:50:31 +0000 (21:50 +0000)
empty page doesn't have corresponding bottem half so it should be
completed in the LOV layer.

Test-Parameters: testlist=sanity-flr
Signed-off-by: Jinshan Xiong <jinshan.xiong@intel.com>
Change-Id: Idb4576a8689bdf01638d66fddd123f05ffdd02cf
Reviewed-on: https://review.whamcloud.com/29094
Tested-by: Jenkins
Tested-by: Maloo <hpdd-maloo@intel.com>
Reviewed-by: Bobi Jam <bobijam@hotmail.com>
Reviewed-by: Dmitry Eremin <dmitry.eremin@intel.com>
lustre/lov/lov_cl_internal.h
lustre/lov/lov_io.c
lustre/lov/lov_page.c

index 9382830..56c8bc2 100644 (file)
@@ -650,6 +650,7 @@ struct lu_object *lovsub_object_alloc(const struct lu_env *env,
 
 struct lov_stripe_md *lov_lsm_addref(struct lov_object *lov);
 int lov_page_stripe(const struct cl_page *page);
+bool lov_page_is_empty(const struct cl_page *page);
 int lov_lsm_entry(const struct lov_stripe_md *lsm, __u64 offset);
 int lov_io_layout_at(struct lov_io *lio, __u64 offset);
 
index 317fb3f..c07540b 100644 (file)
@@ -1022,24 +1022,20 @@ static int lov_io_submit(const struct lu_env *env,
        int rc = 0;
        ENTRY;
 
-       if (lio->lis_nr_subios == 1) {
-               int idx = lio->lis_single_subio_index;
-
-               sub = lov_sub_get(env, lio, idx);
-               LASSERT(!IS_ERR(sub));
-               LASSERT(sub == &lio->lis_single_subio);
-               rc = cl_io_submit_rw(sub->sub_env, &sub->sub_io,
-                                    crt, queue);
-               RETURN(rc);
-       }
-
        cl_page_list_init(plist);
        while (qin->pl_nr > 0) {
                struct cl_2queue  *cl2q = &lov_env_info(env)->lti_cl2q;
 
-               cl_2queue_init(cl2q);
-
                page = cl_page_list_first(qin);
+               if (lov_page_is_empty(page)) {
+                       cl_page_list_move(&queue->c2_qout, qin, page);
+
+                       cl_page_prep(env, ios->cis_io, page, crt);
+                       cl_page_completion(env, page, crt, 0);
+                       continue;
+               }
+
+               cl_2queue_init(cl2q);
                cl_page_list_move(&cl2q->c2_qin, qin, page);
 
                index = lov_page_index(page);
@@ -1088,6 +1084,8 @@ static int lov_io_commit_async(const struct lu_env *env,
        if (lio->lis_nr_subios == 1) {
                int idx = lio->lis_single_subio_index;
 
+               LASSERT(!lov_page_is_empty(cl_page_list_first(queue)));
+
                sub = lov_sub_get(env, lio, idx);
                LASSERT(!IS_ERR(sub));
                LASSERT(sub == &lio->lis_single_subio);
@@ -1103,6 +1101,8 @@ static int lov_io_commit_async(const struct lu_env *env,
 
                LASSERT(plist->pl_nr == 0);
                page = cl_page_list_first(queue);
+               LASSERT(!lov_page_is_empty(page));
+
                cl_page_list_move(plist, queue, page);
 
                index = lov_page_index(page);
index fa7aea7..96f8da0 100644 (file)
@@ -137,6 +137,7 @@ int lov_page_init_empty(const struct lu_env *env, struct cl_object *obj,
        void *addr;
        ENTRY;
 
+       lpg->lps_index = ~0;
        cl_page_slice_add(page, &lpg->lps_cl, obj, index, &lov_empty_page_ops);
        addr = kmap(page->cp_vmpage);
        memset(addr, 0, cl_page_size(obj));
@@ -145,6 +146,14 @@ int lov_page_init_empty(const struct lu_env *env, struct cl_object *obj,
        RETURN(0);
 }
 
+bool lov_page_is_empty(const struct cl_page *page)
+{
+       const struct cl_page_slice *slice = cl_page_at(page, &lov_device_type);
+
+       LASSERT(slice != NULL);
+       return slice->cpl_ops == &lov_empty_page_ops;
+}
+
 
 /** @} lov */