Re: [PATCH v3 07/16] mm: avoid unnecessary use of is_swap_pmd()

From: Vlastimil Babka

Date: Fri Nov 21 2025 - 12:42:09 EST


On 11/10/25 23:21, Lorenzo Stoakes wrote:
> PMD 'non-swap' swap entries are currently used for PMD-level migration
> entries and device private entries.
>
> To add to the confusion in this terminology we use is_swap_pmd() in an
> inconsistent way similar to how is_swap_pte() was being used - sometimes
> adopting the convention that pmd_none(), !pmd_present() implies PMD 'swap'

!pmd_none()

?

> entry, sometimes not.
>
> This patch handles the low-hanging fruit of cases where we can simply
> substitute other predicates for is_swap_pmd().
>
> No functional change intended.
>
> Signed-off-by: Lorenzo Stoakes <lorenzo.stoakes@xxxxxxxxxx>

Reviewed-by: Vlastimil Babka <vbabka@xxxxxxx>