From: Pasha Tatashin <pasha.tatashin@soleen.com>
To: Pratyush Yadav <pratyush@kernel.org>
Cc: Andrew Morton <akpm@linux-foundation.org>,
Alexander Graf <graf@amazon.com>,
Mike Rapoport <rppt@kernel.org>,
kexec@lists.infradead.org, linux-mm@kvack.org,
linux-kernel@vger.kernel.org,
Suren Baghdasaryan <surenb@google.com>
Subject: Re: [PATCH v2 2/2] kho: simplify page initialization in kho_restore_page()
Date: Thu, 22 Jan 2026 14:11:27 -0500 [thread overview]
Message-ID: <CA+CK2bCTT5Chn+i0ZxDBsn2WwZTx0qC0q-2PbkW+4xSbQa=GOg@mail.gmail.com> (raw)
In-Reply-To: <20260116112217.915803-3-pratyush@kernel.org>
On Fri, Jan 16, 2026 at 6:22 AM Pratyush Yadav <pratyush@kernel.org> wrote:
>
> When restoring a page (from kho_restore_pages()) or folio (from
> kho_restore_folio()), KHO must initialize the struct page. The
> initialization differs slightly depending on if a folio is requested or
> a set of 0-order pages is requested.
>
> Conceptually, it is quite simple to understand. When restoring 0-order
> pages, each page gets a refcount of 1 and that's it. When restoring a
> folio, head page gets a refcount of 1 and tail pages get 0.
>
> kho_restore_page() tries to combine the two separate initialization flow
> into one piece of code. While it works fine, it is more complicated to
> read than it needs to be. Make the code simpler by splitting the two
> initalization paths into two separate functions. This improves
> readability by clearly showing how each type must be initialized.
>
> Signed-off-by: Pratyush Yadav <pratyush@kernel.org>
Reviewed-by: Pasha Tatashin <pasha.tatashin@soleen.com>
prev parent reply other threads:[~2026-01-22 19:12 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-01-16 11:22 [PATCH v2 0/2] kho: clean up page initialization logic Pratyush Yadav
2026-01-16 11:22 ` [PATCH v2 1/2] kho: use unsigned long for nr_pages Pratyush Yadav
2026-01-16 22:26 ` Andrew Morton
2026-01-20 13:06 ` Mike Rapoport
2026-01-20 13:03 ` Mike Rapoport
2026-01-22 19:08 ` Pasha Tatashin
2026-01-16 11:22 ` [PATCH v2 2/2] kho: simplify page initialization in kho_restore_page() Pratyush Yadav
2026-01-20 13:05 ` Mike Rapoport
2026-01-22 19:11 ` Pasha Tatashin [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='CA+CK2bCTT5Chn+i0ZxDBsn2WwZTx0qC0q-2PbkW+4xSbQa=GOg@mail.gmail.com' \
--to=pasha.tatashin@soleen.com \
--cc=akpm@linux-foundation.org \
--cc=graf@amazon.com \
--cc=kexec@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=pratyush@kernel.org \
--cc=rppt@kernel.org \
--cc=surenb@google.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