From: "David Hildenbrand (Arm)" <david@kernel.org>
To: Wei Yang <richard.weiyang@gmail.com>, Lance Yang <lance.yang@linux.dev>
Cc: akpm@linux-foundation.org, ljs@kernel.org, riel@surriel.com,
liam@infradead.org, vbabka@kernel.org, harry@kernel.org,
jannh@google.com, ziy@nvidia.com, sj@kernel.org,
balbirs@nvidia.com, linux-mm@kvack.org,
linux-kernel@vger.kernel.org, stable@vger.kernel.org
Subject: Re: [Patch mm-hotfixes v4] mm/page_vma_mapped: fix device-private PMD handling
Date: Thu, 25 Jun 2026 12:37:55 +0200 [thread overview]
Message-ID: <2252683e-df5d-47ce-b15d-1036bef8d063@kernel.org> (raw)
In-Reply-To: <20260625095728.woikmkxb6gskth3b@master>
>> CPU0: pmde = pmdp_get_lockless(); // sees PMD migration entry
>>
>> CPU1: remove_migration_ptes(src, dst /* device-private */)
>> ... via rmap_walk(dst) ...
>> page_vma_mapped_walk(&pvmw /* src, PVMW_MIGRATION */)
>> returns with PTL held for the PMD migration entry
>> remove_migration_pmd(new = dst page)
>> installs a device-private PMD
>> next page_vma_mapped_walk()
>> drops PTL via not_found()
>>
>> CPU0: takes PTL
>> pmde = *pvmw->pmd; // now device-private PMD
>>
>> So when PVMW_MIGRATION is not set, current code can return not_found()
>> before we even decode the locked PMD as a device-private entry.
>>
>> Commit 65edfda6f3f2 ("mm/rmap: extend rmap and migration support
>> device-private entries") made the
>>
>> device-private PMD <-> PMD migration
>>
>> transition possible.
Doesn't the folio lock help here already?
--
Cheers,
David
next prev parent reply other threads:[~2026-06-25 10:38 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-06-24 6:53 [Patch mm-hotfixes v4] mm/page_vma_mapped: fix device-private PMD handling Wei Yang
2026-06-24 8:57 ` Lance Yang
2026-06-25 9:57 ` Wei Yang
2026-06-25 10:37 ` David Hildenbrand (Arm) [this message]
2026-06-25 11:25 ` Lance Yang
2026-06-25 11:42 ` Lance Yang
2026-06-25 13:12 ` Lorenzo Stoakes
2026-06-25 11:12 ` Balbir Singh
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=2252683e-df5d-47ce-b15d-1036bef8d063@kernel.org \
--to=david@kernel.org \
--cc=akpm@linux-foundation.org \
--cc=balbirs@nvidia.com \
--cc=harry@kernel.org \
--cc=jannh@google.com \
--cc=lance.yang@linux.dev \
--cc=liam@infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=ljs@kernel.org \
--cc=richard.weiyang@gmail.com \
--cc=riel@surriel.com \
--cc=sj@kernel.org \
--cc=stable@vger.kernel.org \
--cc=vbabka@kernel.org \
--cc=ziy@nvidia.com \
/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