From: Balbir Singh <balbirs@nvidia.com>
To: Andrew Morton <akpm@linux-foundation.org>, Hui Su <sh_def@163.com>
Cc: apopple@nvidia.com, byungchul@sk.com, david@kernel.org,
gourry@gourry.net, joshua.hahnjy@gmail.com,
linux-kernel@vger.kernel.org, linux-mm@kvack.org,
matthew.brost@intel.com, rakie.kim@sk.com,
ying.huang@linux.alibaba.com, ziy@nvidia.com
Subject: Re: [PATCH] mm/migrate_device: fix cache flush when replacing huge zero PMD
Date: Tue, 18 Aug 2026 08:06:40 +1000 [thread overview]
Message-ID: <0f534a0d-c523-4643-afb3-0f098ea52059@nvidia.com> (raw)
In-Reply-To: <20260817143415.60bedb09819d13a2dc0fbe63@linux-foundation.org>
On 8/18/26 7:34 AM, Andrew Morton wrote:
> On Tue, 18 Aug 2026 00:36:46 +0800 Hui Su <sh_def@163.com> wrote:
>
>>>>> --- a/mm/migrate_device.c
>>>>> +++ b/mm/migrate_device.c
>>>>> @@ -872,7 +872,7 @@ static int migrate_vma_insert_huge_pmd_page(struct migrate_vma *migrate,
>>>>>
>>>>> if (flush) {
>>>>> pte_free(vma->vm_mm, pgtable);
>>>>> - flush_cache_page(vma, addr, addr + HPAGE_PMD_SIZE);
>>>>> + flush_cache_range(vma, addr, addr + HPAGE_PMD_SIZE);
>>>>> pmdp_invalidate(vma, addr, pmdp);
>>>>> } else {
>>>>> pgtable_trans_huge_deposit(vma->vm_mm, pmdp, pgtable);
>>>>
>>>> Reviewed-by: Balbir Singh <balbirs@nvidia.com>
>>>
>>> doh. It's a shame this actually compiled...
>>>
>>> Can we add some speculation about the userspace-visible effects of the
>>> bug?
>>>
>>> I'm assuming we should backport the fix?
>>
>> Hi,
>>
>> I took a closer look at this, there is no userspace-visible effect today.
>>
>> The architectures that currently enable ARCH_ENABLE_THP_MIGRATION use
>> no-op implementations of flush_cache_page()/flush_cache_range().
>> 32-bit ARM has non-trivial implementations, but does not enable
>> ARCH_ENABLE_THP_MIGRATION.
>>
>> So this appears to be a latent API misuse rather than a currently
>> observable bug, and I don't think a stable backport is necessary.
>
> OK, thanks for checking.
>
>> Should I resend a v2 clarifying the userspace-visible effect in the
>> changelog?
>
> Yes please, after 7.3-rc1.
I have been running some tests at my end, I have some new ones, nothing
so far exposes this. Thanks for checking Hui!
Balbir
next prev parent reply other threads:[~2026-08-17 22:06 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-08-17 6:08 [PATCH] mm/migrate_device: fix cache flush when replacing huge zero PMD Hui Su
2026-08-17 7:35 ` Balbir Singh
2026-08-17 16:06 ` Andrew Morton
2026-08-17 16:36 ` Hui Su
2026-08-17 21:34 ` Andrew Morton
2026-08-17 22:06 ` Balbir Singh [this message]
2026-08-17 22:12 ` Andrew Morton
2026-08-17 16:39 ` Zi Yan
2026-08-17 17:47 ` David Hildenbrand (Arm)
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=0f534a0d-c523-4643-afb3-0f098ea52059@nvidia.com \
--to=balbirs@nvidia.com \
--cc=akpm@linux-foundation.org \
--cc=apopple@nvidia.com \
--cc=byungchul@sk.com \
--cc=david@kernel.org \
--cc=gourry@gourry.net \
--cc=joshua.hahnjy@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=matthew.brost@intel.com \
--cc=rakie.kim@sk.com \
--cc=sh_def@163.com \
--cc=ying.huang@linux.alibaba.com \
--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