diff mbox series

[10/11] mm/page-writeback: Support tail pages in wait_for_stable_page

Message ID 20200908195539.25896-11-willy@infradead.org (mailing list archive)
State New, archived
Headers show
Series Remove assumptions of THP size | expand

Commit Message

Matthew Wilcox Sept. 8, 2020, 7:55 p.m. UTC
page->mapping is undefined for tail pages, so operate exclusively on
the head page.

Signed-off-by: Matthew Wilcox (Oracle) <willy@infradead.org>
---
 mm/page-writeback.c | 1 +
 1 file changed, 1 insertion(+)

Comments

Kirill A . Shutemov Sept. 9, 2020, 2:53 p.m. UTC | #1
On Tue, Sep 08, 2020 at 08:55:37PM +0100, Matthew Wilcox (Oracle) wrote:
> page->mapping is undefined for tail pages, so operate exclusively on
> the head page.
> 
> Signed-off-by: Matthew Wilcox (Oracle) <willy@infradead.org>

Acked-by: Kirill A. Shutemov <kirill.shutemov@linux.intel.com>
SeongJae Park Sept. 15, 2020, 7:37 a.m. UTC | #2
On Tue,  8 Sep 2020 20:55:37 +0100 "Matthew Wilcox (Oracle)" <willy@infradead.org> wrote:

> page->mapping is undefined for tail pages, so operate exclusively on
> the head page.
> 
> Signed-off-by: Matthew Wilcox (Oracle) <willy@infradead.org>

Reviewed-by: SeongJae Park <sjpark@amazon.de>


Thanks,
SeongJae Park
diff mbox series

Patch

diff --git a/mm/page-writeback.c b/mm/page-writeback.c
index 4e4ddd67b71e..dac075e451d3 100644
--- a/mm/page-writeback.c
+++ b/mm/page-writeback.c
@@ -2849,6 +2849,7 @@  EXPORT_SYMBOL_GPL(wait_on_page_writeback);
  */
 void wait_for_stable_page(struct page *page)
 {
+	page = thp_head(page);
 	if (bdi_cap_stable_pages_required(inode_to_bdi(page->mapping->host)))
 		wait_on_page_writeback(page);
 }