[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <d5c75701-b353-4536-a306-187fab0655b3@redhat.com>
Date: Thu, 17 Jul 2025 11:54:07 -0400
From: Luiz Capitulino <luizcap@...hat.com>
To: Andrew Morton <akpm@...ux-foundation.org>,
David Hildenbrand <david@...hat.com>
Cc: willy@...radead.org, linux-kernel@...r.kernel.org, linux-mm@...ck.org,
shivankg@....com, sj@...nel.org, harry.yoo@...cle.com
Subject: Re: [PATCH v3 2/4] mm/util: introduce snapshot_page()
On 2025-07-16 21:52, Luiz Capitulino wrote:
> On 2025-07-16 18:19, Andrew Morton wrote:
>> On Wed, 16 Jul 2025 20:18:00 +0200 David Hildenbrand <david@...hat.com> wrote:
>>
>>> On 16.07.25 19:36, Luiz Capitulino wrote:
>>>> Yes, good catch. This was from an earlier version.
>>>>
>>>> Is it fine if I fix only this with a follow up patch for Andrew in this
>>>> thread or would you prefer that I post v4 with all the other changes as
>>>> well?
>>>
>>> I think the series was part of mm-new, but now I only spot it in
>>> mm-everything, weird. Maybe because of a conflict with the other
>>> stable_page_flags() change?
>>
>> I think I removed v2 from mm-unstable and added v3 to mm-new. Maybe.
>>
>>> So whatever Andrew prefers, really :)
>>
>> Either is OK at this stage. I do prefer little fixes so that I and
>> others can see what changed - it depends how tricky and large they are.
>
> I liked some of the other suggestions from David so I'll send v4.
I changed my mind again (sorry). I think the current version should be
good as is except for the doc bug, so here's a patch to fix it on top:
diff --git a/mm/util.c b/mm/util.c
index f270bf42465b..6e5b6ff1c90d 100644
--- a/mm/util.c
+++ b/mm/util.c
@@ -1198,10 +1198,12 @@ static void set_ps_flags(struct page_snapshot *ps, const struct folio *folio,
* Create a snapshot of the page and store both its struct page and struct
* folio representations in @ps.
*
- * Note that creating a faithful snapshot may fail if the compound
- * state of the page keeps changing (e.g., due to a folio split). In
- * this case, ps->faithful is set to false, and the snapshot assumes
- * that @page refers to a single page.
+ * A snapshot is marked as "faithful" if the compound state of @page was
+ * stable and allowed safe reconstruction of the folio representation. In
+ * rare cases where this is not possible (e.g. due to folio splitting),
+ * snapshot_page() falls back to treating @page as a single page and the
+ * snapshot is marked as "unfaithful". The snapshot_page_is_faithful()
+ * helper can be used to check for this condition.
*/
void snapshot_page(struct page_snapshot *ps, const struct page *page)
{
Powered by blists - more mailing lists