Skip to content

Commit

Permalink
ksm: convert should_skip_rmap_item() to take a folio
Browse files Browse the repository at this point in the history
Remove a call to PageKSM() by passing the folio containing tmp_page to
should_skip_rmap_item.  Removes a hidden call to compound_head().

Link: https://lkml.kernel.org/r/20241002152533.1350629-4-willy@infradead.org
Signed-off-by: Matthew Wilcox (Oracle) <willy@infradead.org>
Acked-by: David Hildenbrand <david@redhat.com>
Cc: Alex Shi <alexs@kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
  • Loading branch information
Matthew Wilcox (Oracle) authored and Andrew Morton committed Nov 7, 2024
1 parent 98c3ca0 commit 76f1a82
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions mm/ksm.c
Original file line number Diff line number Diff line change
Expand Up @@ -2402,10 +2402,10 @@ static unsigned int skip_age(rmap_age_t age)
/*
* Determines if a page should be skipped for the current scan.
*
* @page: page to check
* @folio: folio containing the page to check
* @rmap_item: associated rmap_item of page
*/
static bool should_skip_rmap_item(struct page *page,
static bool should_skip_rmap_item(struct folio *folio,
struct ksm_rmap_item *rmap_item)
{
rmap_age_t age;
Expand All @@ -2418,7 +2418,7 @@ static bool should_skip_rmap_item(struct page *page,
* will essentially ignore them, but we still have to process them
* properly.
*/
if (PageKsm(page))
if (folio_test_ksm(folio))
return false;

age = rmap_item->age;
Expand Down Expand Up @@ -2561,7 +2561,7 @@ static struct ksm_rmap_item *scan_get_next_rmap_item(struct page **page)
ksm_scan.rmap_list =
&rmap_item->rmap_list;

if (should_skip_rmap_item(tmp_page, rmap_item)) {
if (should_skip_rmap_item(folio, rmap_item)) {
folio_put(folio);
goto next_page;
}
Expand Down

0 comments on commit 76f1a82

Please sign in to comment.