Re: [PATCH] mm: page-writeback: simplify memcg handling in test_clear_page_writeback()
From: Shakeel Butt <hidden>
Date: 2021-02-10 13:47:52
Also in:
linux-mm, lkml
From: Shakeel Butt <hidden>
Date: 2021-02-10 13:47:52
Also in:
linux-mm, lkml
On Tue, Feb 9, 2021 at 1:45 PM Johannes Weiner [off-list ref] wrote:
Page writeback doesn't hold a page reference, which allows truncate to
free a page the second PageWriteback is cleared. This used to require
special attention in test_clear_page_writeback(), where we had to be
careful not to rely on the unstable page->memcg binding and look up
all the necessary information before clearing the writeback flag.
Since commit 073861ed77b6 ("mm: fix VM_BUG_ON(PageTail) and
BUG_ON(PageWriteback)") test_clear_page_writeback() is called with an
explicit reference on the page, and this dance is no longer needed.
Use unlock_page_memcg() and dec_lruvec_page_stat() directly.
Signed-off-by: Johannes Weiner <redacted>Reviewed-by: Shakeel Butt <redacted>