提交 3cd018b4 编写于 作者: M Matthew Wilcox 提交者: Linus Torvalds

mm/swap.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: 988c69f1 ("mm: optimise put_pages_list()")
Signed-off-by: NMatthew Wilcox (Oracle) <willy@infradead.org>
Reviewed-by: NSteve French <stfrench@microsoft.com>
Reported-by: NNamjae Jeon <linkinjeon@kernel.org>
Tested-by: NSteve French <stfrench@microsoft.com>
Tested-by: NNamjae Jeon <linkinjeon@kernel.org>
Cc: Steve French <smfrench@gmail.com>
Cc: Hyeoncheol Lee <hyc.lee@gmail.com>
Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
上级 a90af8f1
......@@ -156,6 +156,7 @@ void put_pages_list(struct list_head *pages)
}
free_unref_page_list(pages);
INIT_LIST_HEAD(pages);
}
EXPORT_SYMBOL(put_pages_list);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册