diff mbox series

+ hitting-bug_on-trap-in-read_pages-mm-optimise-put_pages_list.patch added to -mm tree

Message ID CAH2r5mugTNmhPnnjhLLeKySe1FuZ9u1J1EVNxyJLnzdzEudVnA@mail.gmail.com (mailing list archive)
State New, archived
Headers show
Series + hitting-bug_on-trap-in-read_pages-mm-optimise-put_pages_list.patch added to -mm tree | expand

Commit Message

Steve French Nov. 10, 2021, 5:14 p.m. UTC
You can add my reviewed-by and tested-by to this patch if desired.

Tested-by: Steve French <stfrench@microsoft.com>

http://smb3-test-rhel-75.southcentralus.cloudapp.azure.com/#/builders/8/builds/93

---------- Forwarded message ---------
From: <akpm@linux-foundation.org>
Date: Tue, Nov 9, 2021 at 5:24 PM
Subject: + hitting-bug_on-trap-in-read_pages-mm-optimise-put_pages_list.patch
added to -mm tree
To: <hyc.lee@gmail.com>, <linkinjeon@kernel.org>,
<mm-commits@vger.kernel.org>, <smfrench@gmail.com>,
<willy@infradead.org>



The patch titled
     Subject: ipc/ipc_sysctl.c:put_pages_list(): reinitialise the page list
has been added to the -mm tree.  Its filename is
     hitting-bug_on-trap-in-read_pages-mm-optimise-put_pages_list.patch

This patch should soon appear at
    https://ozlabs.org/~akpm/mmots/broken-out/hitting-bug_on-trap-in-read_pages-mm-optimise-put_pages_list.patch
and later at
    https://ozlabs.org/~akpm/mmotm/broken-out/hitting-bug_on-trap-in-read_pages-mm-optimise-put_pages_list.patch

Before you just go and hit "reply", please:
   a) Consider who else should be cc'ed
   b) Prefer to cc a suitable mailing list as well
   c) Ideally: find the original patch on the mailing list and do a
      reply-to-all to that, adding suitable additional cc's

*** Remember to use Documentation/process/submit-checklist.rst when
testing your code ***

The -mm tree is included into linux-next and is updated
there every 3-4 working days

------------------------------------------------------
From: Matthew Wilcox <willy@infradead.org>
Subject: ipc/ipc_sysctl.c:put_pages_list(): reinitialise the page list


While free_unref_page_list() puts pages onto the CPU local LRU list, it
does not remove them from the list they were passed in on.  That makes the
list_head appear to be non-empty, and would lead to various corruption
problems if we didn't have an assertion that the list was empty.

Reinitialise the list after calling free_unref_page_list() to avoid this
problem.

Link: https://lkml.kernel.org/r/YYp40A2lNrxaZji8@casper.infradead.org
Fixes: 988c69f1bc23 ("mm: optimise put_pages_list()")
Signed-off-by: Matthew Wilcox (Oracle) <willy@infradead.org>
Reported-by: Namjae Jeon <linkinjeon@kernel.org>
Tested-by: Namjae Jeon <linkinjeon@kernel.org>
Cc: Steve French <smfrench@gmail.com>
Cc: Hyeoncheol Lee <hyc.lee@gmail.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
---

 mm/swap.c |    1 +
 1 file changed, 1 insertion(+)
diff mbox series

Patch

--- a/mm/swap.c~hitting-bug_on-trap-in-read_pages-mm-optimise-put_pages_list
+++ a/mm/swap.c
@@ -155,6 +155,7 @@  void put_pages_list(struct list_head *pa
        }

        free_unref_page_list(pages);
+       INIT_LIST_HEAD(pages);
 }
 EXPORT_SYMBOL(put_pages_list);