linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Luiz Capitulino <luizcap@redhat.com>
To: Andrew Morton <akpm@linux-foundation.org>,
	David Hildenbrand <david@redhat.com>
Cc: willy@infradead.org, linux-kernel@vger.kernel.org,
	linux-mm@kvack.org, shivankg@amd.com, sj@kernel.org,
	harry.yoo@oracle.com
Subject: Re: [PATCH v3 2/4] mm/util: introduce snapshot_page()
Date: Thu, 17 Jul 2025 11:54:07 -0400	[thread overview]
Message-ID: <d5c75701-b353-4536-a306-187fab0655b3@redhat.com> (raw)
In-Reply-To: <e4798260-41b7-492b-8b7c-0922173f59f9@redhat.com>

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@redhat.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)
  {



  reply	other threads:[~2025-07-17 15:54 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-07-14 13:16 [PATCH v3 0/4] mm: introduce snapshot_page() Luiz Capitulino
2025-07-14 13:16 ` [PATCH v3 1/4] mm/memory: introduce is_huge_zero_pfn() and use it in vm_normal_page_pmd() Luiz Capitulino
2025-07-14 14:26   ` David Hildenbrand
2025-07-14 13:16 ` [PATCH v3 2/4] mm/util: introduce snapshot_page() Luiz Capitulino
2025-07-16 10:16   ` David Hildenbrand
2025-07-16 17:36     ` Luiz Capitulino
2025-07-16 18:18       ` David Hildenbrand
2025-07-16 22:19         ` Andrew Morton
2025-07-17  1:52           ` Luiz Capitulino
2025-07-17 15:54             ` Luiz Capitulino [this message]
2025-07-14 13:16 ` [PATCH v3 3/4] proc: kpagecount: use snapshot_page() Luiz Capitulino
2025-07-16 10:17   ` David Hildenbrand
2025-07-16 17:41     ` Luiz Capitulino
2025-07-16 18:18       ` David Hildenbrand
2025-07-14 13:16 ` [PATCH v3 4/4] fs: stable_page_flags(): " Luiz Capitulino
2025-07-16 10:19   ` David Hildenbrand
2025-07-14 13:55 ` [PATCH v3 0/4] mm: introduce snapshot_page() Shivank Garg
2025-07-15 22:53 ` Harry Yoo

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=d5c75701-b353-4536-a306-187fab0655b3@redhat.com \
    --to=luizcap@redhat.com \
    --cc=akpm@linux-foundation.org \
    --cc=david@redhat.com \
    --cc=harry.yoo@oracle.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=shivankg@amd.com \
    --cc=sj@kernel.org \
    --cc=willy@infradead.org \
    /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;
as well as URLs for NNTP newsgroup(s).