All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/5] migration-test: Support running a real kernel
@ 2026-11-26 21:46 Fabiano Rosas
  2026-11-26 21:47 ` [PATCH 1/5] tests/migration-stress: Fix stress.c loop Fabiano Rosas
                   ` (5 more replies)
  0 siblings, 6 replies; 12+ messages in thread
From: Fabiano Rosas @ 2026-11-26 21:46 UTC (permalink / raw)
  To: qemu-devel; +Cc: Peter Xu

There's a class of migration performance bugs that are very specific
to the internals of QEMU and most likely require work on our side, but
are currently invisible to our testing because migration-test runs a
simple guest workload (not even that, really). The more important ones
are BQL contention issues that result in vcpu starvation.

My plan is to incrementally add some pieces to migration-test to
reduce that testing gap.

The first piece is adding support for running a kernel + initrd inside
the guest which gives us an easy way to start exercising migration of
a more loaded guest that can already cause VM exits.

This series adds support for -kernel and -initrd arguments to
migration-test and runs the same set of tests we currently have, but
with the kernel instead of the custom loop. By default it uses the
initrd from tests/migration-stress/ which runs a read-write loop over
all memory and has customizable vcpu and memory size.

I don't intend for this to run in CI nor for it to run by default. The
developer needs to pass the options explicitly and bring at least
their own kernel.

My plan is to do pretty much what we did with the cross-migration
work, keep it around, unubtrosive and stable so we can do
experimentation and debugging when the need arises in an environment
that is closer to where the bugs actually lie.

I've been using this sporadically for downstream work and so far
tested guests with a couple of TiB of ram and ~256 vcpus. With and
without hugepages (more on this below).

- patches 1 and 2 bring the stress.c up-to-date with current coding
style and fix a bug. (note that guestperf is currently broken, I don't
have bandwidth for it).

- patch 3 consolidates some code into bootfile.c so we keep framework.c
under control.

- patch 4 adds parsing of dmesg and detection of panics and such.

- patch 5 adds the support for kernel/initrd/append.

Minimal invocation is:

QTEST_MIG_KERNEL=/boot/vmlinuz-...
QTEST_QEMU_BINARY=./qemu-system-x86_64 ./tests/qtest/migration-test

extra env vars:
  QTEST_MIG_APPEND="" allows changing kernel command-line options.
  QTEST_MIG_GUEST_STDOUT=1 redirects the guest output

CI run: https://gitlab.com/farosas/qemu/-/pipelines/3120905449

====================================================================
Heads up for upcoming work, suggestions welcomed:

- Hugepages support: so we can send the host into the costly dirty
  logging split/restore paths while the guest is loaded. This is already
  done, I just need to fish it out from a larger branch.

- Worker thread: to execute in parallel with the migration so we can
  poke at QEMU directly instead of hoping for the right timing in the
  kernel. The worker thread infra is done, but no useful work to put in
  it so far. I wrote a work function that spams the serial console via
  qtest, but I haven't had success triggering any issues with it.

  (I also played a bit with adding the pci-testdev to the guest, but
  that code seems to have kvm-unit-test assumptions that I haven't
  figured out yet)

Fabiano Rosas (5):
  tests/migration-stress: Fix stress.c loop
  tests/migration-stress: Cleanups to stress.c
  tests/qtest/migration: Move guest workload code into bootfile.c
  tests/qtest/migration: Adapt wait_for_serial routine for stress.c
  tests/qtest/migration: Make it possible to run stress.c

 tests/migration-stress/stress.c        | 140 +++++-----
 tests/qtest/migration/bootfile.c       | 353 ++++++++++++++++++++++++-
 tests/qtest/migration/bootfile.h       |  23 +-
 tests/qtest/migration/cpr-tests.c      |  52 +++-
 tests/qtest/migration/framework.c      | 269 ++++++-------------
 tests/qtest/migration/framework.h      |   4 +-
 tests/qtest/migration/misc-tests.c     |   1 +
 tests/qtest/migration/postcopy-tests.c |   6 +-
 tests/qtest/migration/precopy-tests.c  |  19 +-
 9 files changed, 606 insertions(+), 261 deletions(-)

-- 
2.53.0



^ permalink raw reply	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2026-11-27 19:17 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-11-26 21:46 [PATCH 0/5] migration-test: Support running a real kernel Fabiano Rosas
2026-11-26 21:47 ` [PATCH 1/5] tests/migration-stress: Fix stress.c loop Fabiano Rosas
2026-11-26 21:47 ` [PATCH 2/5] tests/migration-stress: Cleanups to stress.c Fabiano Rosas
2026-11-26 21:47 ` [PATCH 3/5] tests/qtest/migration: Move guest workload code into bootfile.c Fabiano Rosas
2026-11-26 21:47 ` [PATCH 4/5] tests/qtest/migration: Adapt wait_for_serial routine for stress.c Fabiano Rosas
2026-11-26 21:47 ` [PATCH 5/5] tests/qtest/migration: Make it possible to run stress.c Fabiano Rosas
2026-11-27 13:45 ` [PATCH 0/5] migration-test: Support running a real kernel Peter Xu
2026-11-27 14:01   ` Daniel P. Berrangé
2026-11-27 15:01     ` Peter Xu
2026-11-27 19:15       ` Fabiano Rosas
2026-11-27 15:18     ` Fabiano Rosas
2026-11-27 15:33       ` Daniel P. Berrangé

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.