[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <d5d7cf04-784b-447c-9d63-8322ac97be29@redhat.com>
Date: Mon, 15 Sep 2025 13:22:07 +0200
From: David Hildenbrand <david@...hat.com>
To: Balbir Singh <balbirs@...dia.com>, linux-kernel@...r.kernel.org,
linux-mm@...ck.org
Cc: damon@...ts.linux.dev, dri-devel@...ts.freedesktop.org,
Andrew Morton <akpm@...ux-foundation.org>, Zi Yan <ziy@...dia.com>,
Joshua Hahn <joshua.hahnjy@...il.com>, Rakie Kim <rakie.kim@...com>,
Byungchul Park <byungchul@...com>, Gregory Price <gourry@...rry.net>,
Ying Huang <ying.huang@...ux.alibaba.com>,
Alistair Popple <apopple@...dia.com>, Oscar Salvador <osalvador@...e.de>,
Lorenzo Stoakes <lorenzo.stoakes@...cle.com>,
Baolin Wang <baolin.wang@...ux.alibaba.com>,
"Liam R. Howlett" <Liam.Howlett@...cle.com>, Nico Pache <npache@...hat.com>,
Ryan Roberts <ryan.roberts@....com>, Dev Jain <dev.jain@....com>,
Barry Song <baohua@...nel.org>, Lyude Paul <lyude@...hat.com>,
Danilo Krummrich <dakr@...nel.org>, David Airlie <airlied@...il.com>,
Simona Vetter <simona@...ll.ch>, Ralph Campbell <rcampbell@...dia.com>,
Mika Penttilä <mpenttil@...hat.com>,
Matthew Brost <matthew.brost@...el.com>,
Francois Dugast <francois.dugast@...el.com>
Subject: Re: [v5 07/15] mm/memory/fault: add THP fault handling for zone
device private pages
>>> /*
>>> * always: directly stall for all thp allocations
>>> * defer: wake kswapd and fail if not immediately available
>>> diff --git a/mm/memory.c b/mm/memory.c
>>> index d9de6c056179..860665f4b692 100644
>>> --- a/mm/memory.c
>>> +++ b/mm/memory.c
>>> @@ -6298,8 +6298,10 @@ static vm_fault_t __handle_mm_fault(struct vm_area_struct *vma,
>>> vmf.orig_pmd = pmdp_get_lockless(vmf.pmd);
>>> if (unlikely(is_swap_pmd(vmf.orig_pmd))) {
>>> - VM_BUG_ON(thp_migration_supported() &&
>>> - !is_pmd_migration_entry(vmf.orig_pmd));
>>> + if (is_device_private_entry(
>>> + pmd_to_swp_entry(vmf.orig_pmd)))
>>
>> Single line please.
>
> Ack
>
>>
>> But didn't we have a pmd helper for that?
>>
>
> This is a single if that handles is_swap_pmd() and then is_device_private_entry() and is_pmd_migration_entry()
> under that
I meant using
if (is_pmd_device_private_entry(vmf.orig_pmd)))
just like below we use
if (is_pmd_migration_entry(vmf.orig_pmd))
--
Cheers
David / dhildenb
Powered by blists - more mailing lists