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, David Hildenbrand <david@redhat.com>
Subject: [PATCH 2/3] mm: Remove redundant test in validate_page_before_insert()
Date: Wed, 10 Sep 2025 15:29:18 +0100	[thread overview]
Message-ID: <20250910142923.2465470-3-willy@infradead.org> (raw)
In-Reply-To: <20250910142923.2465470-1-willy@infradead.org>

The page_has_type() call would have included slab since commit
46df8e73a4a3 and now we don't even get that far because slab
pages have a zero refcount since commit 9aec2fb0fd5e.

Signed-off-by: Matthew Wilcox (Oracle) <willy@infradead.org>
Acked-by: David Hildenbrand <david@redhat.com>
---
 mm/memory.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/mm/memory.c b/mm/memory.c
index 3e0404bd57a0..46fa459d9a11 100644
--- a/mm/memory.c
+++ b/mm/memory.c
@@ -2268,8 +2268,7 @@ static int validate_page_before_insert(struct vm_area_struct *vma,
 			return -EINVAL;
 		return 0;
 	}
-	if (folio_test_anon(folio) || folio_test_slab(folio) ||
-	    page_has_type(page))
+	if (folio_test_anon(folio) || page_has_type(page))
 		return -EINVAL;
 	flush_dcache_folio(folio);
 	return 0;
-- 
2.47.2



  parent reply	other threads:[~2025-09-10 14:29 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-09-10 14:29 [PATCH 0/3] Small cleanups Matthew Wilcox (Oracle)
2025-09-10 14:29 ` [PATCH 1/3] mm: Constify compound_order() and page_size() Matthew Wilcox (Oracle)
2025-09-10 14:42   ` Vlastimil Babka
2025-09-10 14:29 ` Matthew Wilcox (Oracle) [this message]
2025-09-10 14:42   ` [PATCH 2/3] mm: Remove redundant test in validate_page_before_insert() Vlastimil Babka
2025-09-10 14:29 ` [PATCH 3/3] mm: Remove page->order Matthew Wilcox (Oracle)
2025-09-10 14:50   ` Vlastimil Babka
2025-09-10 20:03   ` Alexei Starovoitov

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=20250910142923.2465470-3-willy@infradead.org \
    --to=willy@infradead.org \
    --cc=akpm@linux-foundation.org \
    --cc=david@redhat.com \
    --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