Whamcloud - gitweb
LU-4198 clio: Remove pl_owner 24/37824/3
authorMr NeilBrown <neilb@suse.de>
Fri, 6 Mar 2020 04:59:17 +0000 (15:59 +1100)
committerOleg Drokin <green@whamcloud.com>
Tue, 17 Mar 2020 03:40:55 +0000 (03:40 +0000)
The pl_owner field is only used for invariant testing, but standard
tests to enable that testing, so it doesn't really serve any purpose.
If you do enable it, you will finx the invariant in cl_page_list_del()
fails.

As async-io allows completion to happen in a different thread to
submission, this might not be a surprise.

So let's remove the field.

Sample stack trace:
LustreError: 2813:0:(cl_io.c:823:cl_page_list_del()) ASSERTION(
    plist->pl_owner == get_current() ) failed:
LustreError: 2813:0:(cl_io.c:823:cl_page_list_del()) LBUG
Pid: 2813, comm: ptlrpcd_01_01 3.10.0-7.7-debug #1 SMP Fri Oct 25
    00:19:37 EDT 2019
Call Trace:
 [<ffffffffa017de4c>] libcfs_call_trace+0x8c/0xc0 [libcfs]
 [<ffffffffa017defc>] lbug_with_loc+0x4c/0xa0 [libcfs]
 [<ffffffffa0318e21>] cl_page_list_del+0x1c1/0x200 [obdclass]
 [<ffffffffa031aeee>] cl_aio_end+0x5e/0x180 [obdclass]
 [<ffffffffa031a531>] cl_sync_io_note+0xa1/0x280 [obdclass]
 [<ffffffffa0315bf0>] cl_page_completion+0xd0/0x410 [obdclass]
 [<ffffffffa0822d79>] osc_ap_completion.isra.29+0x169/0x4c0 [osc]
 [<ffffffffa082a1c2>] osc_extent_finish+0x3a2/0xb10 [osc]
 [<ffffffffa080eb53>] brw_interpret+0x1f3/0xd60 [osc]
 [<ffffffffa05debc0>] ptlrpc_check_set+0x520/0x1ec0 [ptlrpc]
 [<ffffffffa060d0fb>] ptlrpcd_check+0x48b/0x580 [ptlrpc]
 [<ffffffffa060d4f3>] ptlrpcd+0x303/0x6c0 [ptlrpc]
 [<ffffffff810b8254>] kthread+0xe4/0xf0
 [<ffffffff817e5ddd>] ret_from_fork_nospec_begin+0x7/0x21
 [<ffffffffffffffff>] 0xffffffffffffffff

Test-Parameters: trivial
Signed-off-by: Mr NeilBrown <neilb@suse.de>
Change-Id: Icc3af742140ddc5dd31426154d578da0ba4300fe
Reviewed-on: https://review.whamcloud.com/37824
Tested-by: Maloo <maloo@whamcloud.com>
Tested-by: jenkins <devops@whamcloud.com>
Reviewed-by: Patrick Farrell <farr0186@gmail.com>
Reviewed-by: James Simmons <jsimmons@infradead.org>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
lustre/include/cl_object.h
lustre/obdclass/cl_io.c

index 8edb653..d1e8f7a 100644 (file)
@@ -1293,7 +1293,6 @@ do {                                                                    \
 struct cl_page_list {
        unsigned                 pl_nr;
        struct list_head         pl_pages;
-       struct task_struct      *pl_owner;
 };
 
 /**
index fdc80ae..76fe87b 100644 (file)
@@ -787,7 +787,6 @@ void cl_page_list_init(struct cl_page_list *plist)
        ENTRY;
        plist->pl_nr = 0;
        INIT_LIST_HEAD(&plist->pl_pages);
-       plist->pl_owner = current;
        EXIT;
 }
 EXPORT_SYMBOL(cl_page_list_init);
@@ -801,7 +800,6 @@ void cl_page_list_add(struct cl_page_list *plist, struct cl_page *page)
        /* it would be better to check that page is owned by "current" io, but
         * it is not passed here. */
        LASSERT(page->cp_owner != NULL);
-       LINVRNT(plist->pl_owner == current);
 
        LASSERT(list_empty(&page->cp_batch));
        list_add_tail(&page->cp_batch, &plist->pl_pages);
@@ -820,7 +818,6 @@ void cl_page_list_del(const struct lu_env *env,
 {
        LASSERT(plist->pl_nr > 0);
        LASSERT(cl_page_is_vmlocked(env, page));
-       LINVRNT(plist->pl_owner == current);
 
        ENTRY;
        list_del_init(&page->cp_batch);
@@ -838,8 +835,6 @@ void cl_page_list_move(struct cl_page_list *dst, struct cl_page_list *src,
                       struct cl_page *page)
 {
        LASSERT(src->pl_nr > 0);
-       LINVRNT(dst->pl_owner == current);
-       LINVRNT(src->pl_owner == current);
 
        ENTRY;
        list_move_tail(&page->cp_batch, &dst->pl_pages);
@@ -858,8 +853,6 @@ void cl_page_list_move_head(struct cl_page_list *dst, struct cl_page_list *src,
                            struct cl_page *page)
 {
        LASSERT(src->pl_nr > 0);
-       LINVRNT(dst->pl_owner == current);
-       LINVRNT(src->pl_owner == current);
 
        ENTRY;
        list_move(&page->cp_batch, &dst->pl_pages);
@@ -879,8 +872,6 @@ void cl_page_list_splice(struct cl_page_list *list, struct cl_page_list *head)
        struct cl_page *page;
        struct cl_page *tmp;
 
-       LINVRNT(list->pl_owner == current);
-       LINVRNT(head->pl_owner == current);
 
        ENTRY;
        cl_page_list_for_each_safe(page, tmp, list)
@@ -898,7 +889,6 @@ void cl_page_list_disown(const struct lu_env *env,
        struct cl_page *page;
        struct cl_page *temp;
 
-       LINVRNT(plist->pl_owner == current);
 
        ENTRY;
        cl_page_list_for_each_safe(page, temp, plist) {
@@ -931,7 +921,6 @@ void cl_page_list_fini(const struct lu_env *env, struct cl_page_list *plist)
        struct cl_page *page;
        struct cl_page *temp;
 
-       LINVRNT(plist->pl_owner == current);
 
        ENTRY;
        cl_page_list_for_each_safe(page, temp, plist)
@@ -949,7 +938,6 @@ void cl_page_list_assume(const struct lu_env *env,
 {
        struct cl_page *page;
 
-       LINVRNT(plist->pl_owner == current);
 
        cl_page_list_for_each(page, plist)
                cl_page_assume(env, io, page);
@@ -963,7 +951,6 @@ void cl_page_list_discard(const struct lu_env *env, struct cl_io *io,
 {
        struct cl_page *page;
 
-       LINVRNT(plist->pl_owner == current);
        ENTRY;
        cl_page_list_for_each(page, plist)
                cl_page_discard(env, io, page);