Skip to content

Commit e20c41b

Browse files
author
Matthew Wilcox (Oracle)
committed
mm/vmscan: Turn page_check_dirty_writeback() into folio_check_dirty_writeback()
Saves a few calls to compound_head(). Signed-off-by: Matthew Wilcox (Oracle) <[email protected]> Reviewed-by: Christoph Hellwig <[email protected]>
1 parent cbcc268 commit e20c41b

File tree

1 file changed

+10
-10
lines changed

1 file changed

+10
-10
lines changed

mm/vmscan.c

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1437,7 +1437,7 @@ static enum page_references page_check_references(struct page *page,
14371437
}
14381438

14391439
/* Check if a page is dirty or under writeback */
1440-
static void page_check_dirty_writeback(struct page *page,
1440+
static void folio_check_dirty_writeback(struct folio *folio,
14411441
bool *dirty, bool *writeback)
14421442
{
14431443
struct address_space *mapping;
@@ -1446,24 +1446,24 @@ static void page_check_dirty_writeback(struct page *page,
14461446
* Anonymous pages are not handled by flushers and must be written
14471447
* from reclaim context. Do not stall reclaim based on them
14481448
*/
1449-
if (!page_is_file_lru(page) ||
1450-
(PageAnon(page) && !PageSwapBacked(page))) {
1449+
if (!folio_is_file_lru(folio) ||
1450+
(folio_test_anon(folio) && !folio_test_swapbacked(folio))) {
14511451
*dirty = false;
14521452
*writeback = false;
14531453
return;
14541454
}
14551455

1456-
/* By default assume that the page flags are accurate */
1457-
*dirty = PageDirty(page);
1458-
*writeback = PageWriteback(page);
1456+
/* By default assume that the folio flags are accurate */
1457+
*dirty = folio_test_dirty(folio);
1458+
*writeback = folio_test_writeback(folio);
14591459

14601460
/* Verify dirty/writeback state if the filesystem supports it */
1461-
if (!page_has_private(page))
1461+
if (!folio_test_private(folio))
14621462
return;
14631463

1464-
mapping = page_mapping(page);
1464+
mapping = folio_mapping(folio);
14651465
if (mapping && mapping->a_ops->is_dirty_writeback)
1466-
mapping->a_ops->is_dirty_writeback(page, dirty, writeback);
1466+
mapping->a_ops->is_dirty_writeback(&folio->page, dirty, writeback);
14671467
}
14681468

14691469
static struct page *alloc_demote_page(struct page *page, unsigned long node)
@@ -1572,7 +1572,7 @@ static unsigned int shrink_page_list(struct list_head *page_list,
15721572
* reclaim_congested. kswapd will stall and start writing
15731573
* pages if the tail of the LRU is all dirty unqueued pages.
15741574
*/
1575-
page_check_dirty_writeback(page, &dirty, &writeback);
1575+
folio_check_dirty_writeback(folio, &dirty, &writeback);
15761576
if (dirty || writeback)
15771577
stat->nr_dirty++;
15781578

0 commit comments

Comments
 (0)