linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: "Matthew Wilcox (Oracle)" <willy@infradead.org>
To: Andrew Morton <akpm@linux-foundation.org>
Cc: "Matthew Wilcox (Oracle)" <willy@infradead.org>,
	linux-mm@kvack.org, Alex Shi <alexs@kernel.org>
Subject: [PATCH 3/5] ksm: Convert should_skip_rmap_item() to take a folio
Date: Wed,  2 Oct 2024 16:25:29 +0100	[thread overview]
Message-ID: <20241002152533.1350629-4-willy@infradead.org> (raw)
In-Reply-To: <20241002152533.1350629-1-willy@infradead.org>

Remove a call to PageKSM() by passing the folio containing tmp_page to
should_skip_rmap_item.  Removes a hidden call to compound_head().

Signed-off-by: Matthew Wilcox (Oracle) <willy@infradead.org>
---
 mm/ksm.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/mm/ksm.c b/mm/ksm.c
index 19e17b228ae1..1b8b43dc6ba7 100644
--- a/mm/ksm.c
+++ b/mm/ksm.c
@@ -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;
@@ -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;
@@ -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;
 					}
-- 
2.43.0



  parent reply	other threads:[~2024-10-02 15:25 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-10-02 15:25 [PATCH 0/5] Remove PageKsm() Matthew Wilcox (Oracle)
2024-10-02 15:25 ` [PATCH 1/5] ksm: Use a folio in try_to_merge_one_page() Matthew Wilcox (Oracle)
2024-10-07  9:43   ` David Hildenbrand
2024-10-02 15:25 ` [PATCH 2/5] ksm: Convert cmp_and_merge_page() to use a folio Matthew Wilcox (Oracle)
2024-10-07  9:44   ` David Hildenbrand
2024-10-02 15:25 ` Matthew Wilcox (Oracle) [this message]
2024-10-07  9:46   ` [PATCH 3/5] ksm: Convert should_skip_rmap_item() to take " David Hildenbrand
2024-10-02 15:25 ` [PATCH 4/5] mm: Add PageAnonNotKsm() Matthew Wilcox (Oracle)
     [not found]   ` <CGME20241004114615eucas1p1910b6b4e74f8a878f56104026eece731@eucas1p1.samsung.com>
2024-10-04 11:46     ` Marek Szyprowski
2024-10-06 14:11   ` kernel test robot
2024-10-07  9:46   ` David Hildenbrand
2024-10-02 15:25 ` [PATCH 5/5] mm: Remove PageKsm() Matthew Wilcox (Oracle)
2024-10-07  9:47   ` David Hildenbrand

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20241002152533.1350629-4-willy@infradead.org \
    --to=willy@infradead.org \
    --cc=akpm@linux-foundation.org \
    --cc=alexs@kernel.org \
    --cc=linux-mm@kvack.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).