Linux-mm Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: "David Hildenbrand (Arm)" <david@kernel.org>
To: "Yadav, Arvind" <arvind.yadav@intel.com>,
	linux-mm@kvack.org, linux-kernel@vger.kernel.org
Cc: akpm@linux-foundation.org, matthew.brost@intel.com,
	joshua.hahnjy@gmail.com, ziy@nvidia.com, rakie.kim@sk.com,
	byungchul@sk.com, gourry@gourry.net,
	ying.huang@linux.alibaba.com, apopple@nvidia.com,
	balbirs@nvidia.com
Subject: Re: [PATCH v4] mm/migrate_device: Clear stale mapping after freeing swapcache
Date: Thu, 30 Jul 2026 14:47:52 +0200	[thread overview]
Message-ID: <86119f7f-bd70-428e-a6e0-eea7cc907bbe@kernel.org> (raw)
In-Reply-To: <d2480581-52b5-445b-b56d-af1bb9d71608@intel.com>


>> While this looks good, I do wonder why do we have to supply the mapping here
>> at all?
>>
>> Is there a path where we call folio_migrate_mapping() and the old folio (folio)
>> does no longer have the right mapping attached?
>>
>> It would be a lot less error prone if the function would just obtain the mapping
>> from the old folio.
> 
> 
> Agreed. I will make folio_migrate_mapping() obtain the mapping from the source
> folio and update its in-tree callers. Since this changes an exported helper, I
> will send it as a separate patch in v5.

I think it would be good to understand why we currently pass in the folio: was
there ever a reason to do so? Or why do we pass in something that can just
easily be had from the source folio?

But note that that should be a follow-up cleanup to the fix.

-- 
Cheers,

David


  reply	other threads:[~2026-07-30 12:48 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-07-28  6:28 [PATCH v4] mm/migrate_device: Clear stale mapping after freeing swapcache Arvind Yadav
2026-07-28  9:51 ` Balbir Singh
2026-07-28 12:50 ` David Hildenbrand (Arm)
2026-07-30  4:04   ` Yadav, Arvind
2026-07-30 12:47     ` David Hildenbrand (Arm) [this message]
2026-07-31  4:48       ` Yadav, Arvind

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=86119f7f-bd70-428e-a6e0-eea7cc907bbe@kernel.org \
    --to=david@kernel.org \
    --cc=akpm@linux-foundation.org \
    --cc=apopple@nvidia.com \
    --cc=arvind.yadav@intel.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=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