[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <ee7e0841-e9b6-4a91-8b6c-43252432516c@redhat.com>
Date: Wed, 17 Sep 2025 12:32:22 +0200
From: David Hildenbrand <david@...hat.com>
To: Lance Yang <lance.yang@...ux.dev>, akpm@...ux-foundation.org,
lorenzo.stoakes@...cle.com
Cc: ziy@...dia.com, baolin.wang@...ux.alibaba.com, Liam.Howlett@...cle.com,
npache@...hat.com, ryan.roberts@....com, dev.jain@....com,
baohua@...nel.org, ioworker0@...il.com, linux-kernel@...r.kernel.org,
linux-mm@...ck.org, Kairui Song <kasong@...cent.com>
Subject: Re: [PATCH mm-new 2/3] mm: clean up and expose is_guard_pte_marker()
On 14.09.25 16:35, Lance Yang wrote:
> From: Lance Yang <lance.yang@...ux.dev>
>
> is_guard_pte_marker() performs a redundant check because it calls both
> is_pte_marker() and is_guard_swp_entry(), both of which internally check
> for a PTE marker.
>
> is_guard_pte_marker()
> |- is_pte_marker()
> | `- is_pte_marker_entry() // First check
> `- is_guard_swp_entry()
> `- is_pte_marker_entry() // Second, redundant check
>
> While a modern compiler could likely optimize this away, let's have clean
> code and not rely on it ;)
>
> Also, make it available for hugepage collapsing code.
>
> Cc: Kairui Song <kasong@...cent.com>
> Signed-off-by: Lance Yang <lance.yang@...ux.dev>
> ---
Acked-by: David Hildenbrand <david@...hat.com>
--
Cheers
David / dhildenb
Powered by blists - more mailing lists