The Linux Kernel Mailing List
 help / color / mirror / Atom feed
From: "David Hildenbrand (Arm)" <david@kernel.org>
To: Zi Yan <ziy@nvidia.com>, Hui Su <sh_def@163.com>,
	Andrew Morton <akpm@linux-foundation.org>
Cc: Matthew Brost <matthew.brost@intel.com>,
	Joshua Hahn <joshua.hahnjy@gmail.com>,
	Rakie Kim <rakie.kim@sk.com>, Byungchul Park <byungchul@sk.com>,
	Gregory Price <gourry@gourry.net>,
	Ying Huang <ying.huang@linux.alibaba.com>,
	Alistair Popple <apopple@nvidia.com>,
	Balbir Singh <balbirs@nvidia.com>,
	linux-mm@kvack.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] mm/migrate_device: fix cache flush when replacing huge zero PMD
Date: Mon, 17 Aug 2026 19:47:51 +0200	[thread overview]
Message-ID: <4148c151-5ef7-4e5e-986e-b05e600045db@kernel.org> (raw)
In-Reply-To: <DKRD8RERQHHC.1CVF14YIY4BSA@nvidia.com>

On 8/17/26 18:39, Zi Yan wrote:
> On Mon Aug 17, 2026 at 2:08 AM EDT, Hui Su wrote:
>> migrate_vma_insert_huge_pmd_page() calls flush_cache_page() before
>> replacing an existing huge zero PMD. However, the third argument to
>> flush_cache_page() is a PFN, while addr + HPAGE_PMD_SIZE is an end
>> virtual address.
>>
>> More importantly, the mapping being invalidated is PMD-sized rather
>> than PAGE_SIZE-sized. Flush the whole PMD range with
>> flush_cache_range(), matching other huge PMD invalidation paths.
>>
>> Fixes: a30b48bf1b24 ("mm/migrate_device: implement THP migration of zone device pages")
>> Signed-off-by: Hui Su <sh_def@163.com>
>> ---
>>  mm/migrate_device.c | 2 +-
>>  1 file changed, 1 insertion(+), 1 deletion(-)
>>
> 
> Thank you for fixing it.
> 
> Reviewed-by: Zi Yan <ziy@nvidia.com>

Acked-by: David Hildenbrand (Arm) <david@kernel.org>

I do wonder whether there should be a PMD helper.

-- 
Cheers,

David

      reply	other threads:[~2026-08-17 17:47 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
2026-08-17 22:12         ` Andrew Morton
2026-08-17 16:39 ` Zi Yan
2026-08-17 17:47   ` David Hildenbrand (Arm) [this message]

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=4148c151-5ef7-4e5e-986e-b05e600045db@kernel.org \
    --to=david@kernel.org \
    --cc=akpm@linux-foundation.org \
    --cc=apopple@nvidia.com \
    --cc=balbirs@nvidia.com \
    --cc=byungchul@sk.com \
    --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