From: David Hildenbrand <david@redhat.com>
To: Hyeonggon Yoo <42.hyeyoo@gmail.com>,
Vlastimil Babka <vbabka@suse.cz>,
Matthew Wilcox <willy@infradead.org>,
Andrew Morton <akpm@linux-foundation.org>,
Christoph Lameter <cl@linux.com>,
Pekka Enberg <penberg@kernel.org>,
David Rientjes <rientjes@google.com>,
Joonsoo Kim <iamjoonsoo.kim@lge.com>,
Roman Gushchin <roman.gushchin@linux.dev>,
linux-mm@kvack.org
Subject: Re: [PATCH v1 mm-unstable] mm/migrate: Remove slab checks in isolate_movable_page()
Date: Tue, 10 Dec 2024 15:27:04 +0100 [thread overview]
Message-ID: <e4b2491b-8ce5-472c-b1f8-7a4272ef549c@redhat.com> (raw)
In-Reply-To: <20241210124807.8584-1-42.hyeyoo@gmail.com>
On 10.12.24 13:48, Hyeonggon Yoo wrote:
> Commit 8b8817630ae8 ("mm/migrate: make isolate_movable_page() skip slab
> pages") introduced slab checks to prevent mis-identification of slab
> pages as movable kernel pages.
>
> However, after Matthew's frozen folio series, these slab checks became
> unnecessary as the migration logic fails to increase the reference count
> for frozen slab folios. Remove these redundant slab checks and associated
> memory barriers.
>
> Signed-off-by: Hyeonggon Yoo <42.hyeyoo@gmail.com>
> ---
> mm/migrate.c | 8 --------
> mm/slub.c | 4 ----
> 2 files changed, 12 deletions(-)
>
> diff --git a/mm/migrate.c b/mm/migrate.c
> index e9e00d1d1d19..32cc8e0b1cce 100644
> --- a/mm/migrate.c
> +++ b/mm/migrate.c
> @@ -68,10 +68,6 @@ bool isolate_movable_page(struct page *page, isolate_mode_t mode)
> if (!folio)
> goto out;
>
> - if (unlikely(folio_test_slab(folio)))
> - goto out_putfolio;
> - /* Pairs with smp_wmb() in slab freeing, e.g. SLUB's __free_slab() */
> - smp_rmb();
> /*
> * Check movable flag before taking the page lock because
> * we use non-atomic bitops on newly allocated page flags so
> @@ -79,10 +75,6 @@ bool isolate_movable_page(struct page *page, isolate_mode_t mode)
> */
> if (unlikely(!__folio_test_movable(folio)))
> goto out_putfolio;
> - /* Pairs with smp_wmb() in slab allocation, e.g. SLUB's alloc_slab_page() */
> - smp_rmb();
> - if (unlikely(folio_test_slab(folio)))
> - goto out_putfolio;
>
> /*
> * As movable pages are not isolated from LRU lists, concurrent
> diff --git a/mm/slub.c b/mm/slub.c
> index f62c829b7b6b..ee94baba12f7 100644
> --- a/mm/slub.c
> +++ b/mm/slub.c
> @@ -2414,8 +2414,6 @@ static inline struct slab *alloc_slab_page(gfp_t flags, int node,
>
> slab = folio_slab(folio);
> __folio_set_slab(folio);
> - /* Make the flag visible before any changes to folio->mapping */
> - smp_wmb();
> if (folio_is_pfmemalloc(folio))
> slab_set_pfmemalloc(slab);
>
> @@ -2636,8 +2634,6 @@ static void __free_slab(struct kmem_cache *s, struct slab *slab)
>
> __slab_clear_pfmemalloc(slab);
> folio->mapping = NULL;
> - /* Make the mapping reset visible before clearing the flag */
> - smp_wmb();
> __folio_clear_slab(folio);
> mm_account_reclaimed_pages(pages);
> unaccount_slab(slab, order, s);
Nice
Acked-by: David Hildenbrand <david@redhat.com>
--
Cheers,
David / dhildenb
next prev parent reply other threads:[~2024-12-10 14:27 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-12-10 12:48 Hyeonggon Yoo
2024-12-10 14:27 ` David Hildenbrand [this message]
2024-12-11 8:10 ` Vlastimil Babka
2024-12-16 0:01 ` David Rientjes
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=e4b2491b-8ce5-472c-b1f8-7a4272ef549c@redhat.com \
--to=david@redhat.com \
--cc=42.hyeyoo@gmail.com \
--cc=akpm@linux-foundation.org \
--cc=cl@linux.com \
--cc=iamjoonsoo.kim@lge.com \
--cc=linux-mm@kvack.org \
--cc=penberg@kernel.org \
--cc=rientjes@google.com \
--cc=roman.gushchin@linux.dev \
--cc=vbabka@suse.cz \
--cc=willy@infradead.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