Linux-mm Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Mike Rapoport <rppt@kernel.org>
To: Samiullah Khawaja <skhawaja@google.com>
Cc: Pasha Tatashin <pasha.tatashin@soleen.com>,
	Pratyush Yadav <pratyush@kernel.org>,
	Alexander Graf <graf@amazon.com>,
	David Matlack <dmatlack@google.com>,
	open list <linux-kernel@vger.kernel.org>,
	"open list:KEXEC HANDOVER (KHO)" <kexec@lists.infradead.org>,
	"open list:KEXEC HANDOVER (KHO)" <linux-mm@kvack.org>
Subject: Re: [PATCH v2 0/3] kho: Add support for kunit mocking KHO restore API
Date: Wed, 17 Jun 2026 21:57:34 +0300	[thread overview]
Message-ID: <ajLuHq-FJxrIzr51@kernel.org> (raw)
In-Reply-To: <ajGOIOqBY1pazq5g@google.com>

Hi Sami,

On Tue, Jun 16, 2026 at 07:15:03PM +0000, Samiullah Khawaja wrote:
> On Mon, Jun 01, 2026 at 10:00:05AM +0300, Mike Rapoport wrote:
> > Hi Samiullah,
> > 
> > On Thu, May 21, 2026 at 07:31:59PM +0000, Samiullah Khawaja wrote:
> > > To write kunit tests for preservation and restoration of liveupdate
> > > state in various subsystems without triggering the actual kexec, the KHO
> > > restore API needs to be mocked by the test writer. The mocking is done
> > > to allow testing of the individual components or functions in isolation.
> > > 
> > > The patch series adds the following to support kunit testing when using the KHO
> > > API:
> > > 
> > > - Add static stub hooks to mock the KHO restore API so the restore path
> > >   can be tested without triggering kexec.
> > > - Add helper function that can be used by the test writer to check if
> > >   memory is preserved in KHO tree.
> > > 
> > > Finally, it adds a KUnit test for the KHO API that verifies the allocation of
> > > preserved memory, and the preservation/restoration of pages and folios.
> > 
> > I looked at the tests for preservation and apparently they don't add
> > coverage beyond the existing KHO selftest. How hard and/or intrusive would
> > be adding tests for example for error paths?
> > 
> > Do you have an example of a kunit test for another subsystem that would
> > benefit from mocking of KHO APIs?
> 
> I think intrusive tests to get more coverage for KHO would probably not
> use the stubs added in this series, as these are meant to mock the KHO
> restore API itself.
> 
> My motivation was to allow downstream users of KHO to test their own
> preservation logic (making sure their ABI doesn't have bugs). LUO or the
> recently added KHO linked-block can probably be a start?
> 
> The KHO kunit test added here is just a minimum example of how to use the
> stubs, which is why it doesn't provide much extra coverage.
> 
> I am perfectly happy to drop this patch for now. We can get this in
> later when we have kunit tests for KHO users. WDYT?

I wouldn't want to merge this upstream before the actual users appear, but
we can apply this to a branch in the liveupdate tree and keep it there so
that subsystems that plan to use these stubs could base their work on that
branch.

Let's revisit this after -rc1 is out.

> Thanks,
> Sami

-- 
Sincerely yours,
Mike.


      reply	other threads:[~2026-06-17 18:57 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-05-21 19:31 [PATCH v2 0/3] kho: Add support for kunit mocking KHO restore API Samiullah Khawaja
2026-05-21 19:32 ` [PATCH v2 1/3] kho: Add kunit static stubs Samiullah Khawaja
2026-05-21 19:32 ` [PATCH v2 2/3] kho: Add helper function to check if pages are preserved Samiullah Khawaja
2026-05-21 19:32 ` [PATCH v2 3/3] kho: Add kunit test to verify preserve/restore pages and folio Samiullah Khawaja
2026-06-01  7:00 ` [PATCH v2 0/3] kho: Add support for kunit mocking KHO restore API Mike Rapoport
2026-06-16 19:15   ` Samiullah Khawaja
2026-06-17 18:57     ` Mike Rapoport [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=ajLuHq-FJxrIzr51@kernel.org \
    --to=rppt@kernel.org \
    --cc=dmatlack@google.com \
    --cc=graf@amazon.com \
    --cc=kexec@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=pasha.tatashin@soleen.com \
    --cc=pratyush@kernel.org \
    --cc=skhawaja@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