From: Zi Yan <ziy@nvidia.com>
To: "Mika Penttilä" <mpenttil@redhat.com>
Cc: Francois Dugast <francois.dugast@intel.com>,
intel-xe@lists.freedesktop.org, dri-devel@lists.freedesktop.org,
Matthew Brost <matthew.brost@intel.com>,
Balbir Singh <balbirs@nvidia.com>,
Alistair Popple <apopple@nvidia.com>,
David Hildenbrand <david@kernel.org>,
Oscar Salvador <osalvador@suse.de>,
Andrew Morton <akpm@linux-foundation.org>,
linux-mm@kvack.org, linux-cxl@vger.kernel.org,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH v3 3/7] mm: Split device-private and coherent folios before freeing
Date: Fri, 09 Jan 2026 12:28:22 -0500 [thread overview]
Message-ID: <DF5A6B81-7811-4654-855F-8EAB76CCCE51@nvidia.com> (raw)
In-Reply-To: <d1d80b81-678d-4d28-9ac2-95cb74824e73@redhat.com>
On 9 Jan 2026, at 6:09, Mika Penttilä wrote:
> Hi,
>
> On 1/9/26 10:54, Francois Dugast wrote:
>
>> From: Matthew Brost <matthew.brost@intel.com>
>>
>> Split device-private and coherent folios into individual pages before
>> freeing so that any order folio can be formed upon the next use of the
>> pages.
>>
>> Cc: Balbir Singh <balbirs@nvidia.com>
>> Cc: Alistair Popple <apopple@nvidia.com>
>> Cc: Zi Yan <ziy@nvidia.com>
>> Cc: David Hildenbrand <david@kernel.org>
>> Cc: Oscar Salvador <osalvador@suse.de>
>> Cc: Andrew Morton <akpm@linux-foundation.org>
>> Cc: linux-mm@kvack.org
>> Cc: linux-cxl@vger.kernel.org
>> Cc: linux-kernel@vger.kernel.org
>> Signed-off-by: Matthew Brost <matthew.brost@intel.com>
>> Signed-off-by: Francois Dugast <francois.dugast@intel.com>
>> ---
>> mm/memremap.c | 2 ++
>> 1 file changed, 2 insertions(+)
>>
>> diff --git a/mm/memremap.c b/mm/memremap.c
>> index 63c6ab4fdf08..7289cdd6862f 100644
>> --- a/mm/memremap.c
>> +++ b/mm/memremap.c
>> @@ -453,6 +453,8 @@ void free_zone_device_folio(struct folio *folio)
>> case MEMORY_DEVICE_COHERENT:
>> if (WARN_ON_ONCE(!pgmap->ops || !pgmap->ops->folio_free))
>> break;
>> +
>> + folio_split_unref(folio);
>> pgmap->ops->folio_free(folio);
>> percpu_ref_put_many(&folio->pgmap->ref, nr);
>> break;
>
> This breaks folio_free implementations like nouveau_dmem_folio_free
> which checks the folio order and act upon that.
> Maybe add an order parameter to folio_free or let the driver handle the split?
Passing an order parameter might be better to avoid exposing core MM internals
by asking drivers to undo compound pages.
Best Regards,
Yan, Zi
next prev parent reply other threads:[~2026-01-09 17:28 UTC|newest]
Thread overview: 27+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <20260109085605.443316-1-francois.dugast@intel.com>
2026-01-09 8:54 ` [PATCH v3 1/7] mm: Add folio_split_unref helper Francois Dugast
2026-01-09 13:19 ` David Hildenbrand (Red Hat)
2026-01-09 13:26 ` David Hildenbrand (Red Hat)
2026-01-09 14:30 ` Zi Yan
2026-01-09 15:11 ` David Hildenbrand (Red Hat)
2026-01-09 18:38 ` Matthew Brost
2026-01-09 18:37 ` Andrew Morton
2026-01-09 18:41 ` Zi Yan
2026-01-09 18:54 ` Francois Dugast
2026-01-09 18:43 ` Matthew Brost
2026-01-09 19:22 ` Andrew Morton
2026-01-09 19:26 ` Liam R. Howlett
2026-01-09 8:54 ` [PATCH v3 3/7] mm: Split device-private and coherent folios before freeing Francois Dugast
2026-01-09 11:09 ` Mika Penttilä
2026-01-09 17:28 ` Zi Yan [this message]
2026-01-09 18:26 ` Matthew Brost
2026-01-09 18:53 ` Zi Yan
2026-01-09 19:08 ` Matthew Brost
2026-01-09 19:23 ` Zi Yan
2026-01-09 20:03 ` Matthew Brost
2026-01-09 20:15 ` Zi Yan
2026-01-09 21:34 ` Balbir Singh
2026-01-09 21:43 ` Zi Yan
2026-01-09 22:11 ` Balbir Singh
2026-01-09 22:14 ` Zi Yan
2026-01-09 22:36 ` Balbir Singh
2026-01-09 23:15 ` Matthew Brost
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=DF5A6B81-7811-4654-855F-8EAB76CCCE51@nvidia.com \
--to=ziy@nvidia.com \
--cc=akpm@linux-foundation.org \
--cc=apopple@nvidia.com \
--cc=balbirs@nvidia.com \
--cc=david@kernel.org \
--cc=dri-devel@lists.freedesktop.org \
--cc=francois.dugast@intel.com \
--cc=intel-xe@lists.freedesktop.org \
--cc=linux-cxl@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=matthew.brost@intel.com \
--cc=mpenttil@redhat.com \
--cc=osalvador@suse.de \
/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