Linux-mm Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: "Yadav, Arvind" <arvind.yadav@intel.com>
To: "David Hildenbrand (Arm)" <david@kernel.org>,
	<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: Fri, 31 Jul 2026 10:18:47 +0530	[thread overview]
Message-ID: <cc5658b3-b5cd-4cc8-8b50-8df8d62815d0@intel.com> (raw)
In-Reply-To: <86119f7f-bd70-428e-a6e0-eea7cc907bbe@kernel.org>


On 30-07-2026 18:17, David Hildenbrand (Arm) wrote:
>>> 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.


Thanks for the suggestion. Once this is merged, I will review the 
history and callers to confirm whether any path intentionally uses a 
mapping other than folio_mapping(src) and follow up with a separate 
cleanup patch if needed.

Thanks,
Arvind



      reply	other threads:[~2026-07-31  4:49 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)
2026-07-31  4:48       ` Yadav, Arvind [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=cc5658b3-b5cd-4cc8-8b50-8df8d62815d0@intel.com \
    --to=arvind.yadav@intel.com \
    --cc=akpm@linux-foundation.org \
    --cc=apopple@nvidia.com \
    --cc=balbirs@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=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