All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Edwin Török" <edwin.torok@citrix.com>
To: xen-devel@lists.xenproject.org
Cc: marcus.granado@citrix.com, "Edwin Török" <edwin.torok@citrix.com>,
	"Anthony PERARD" <anthony.perard@vates.tech>,
	"Juergen Gross" <jgross@suse.com>
Subject: [PATCH v1 0/2] Functional and performance tests for migration
Date: Mon, 30 Mar 2026 21:45:30 +0100	[thread overview]
Message-ID: <cover.1774903347.git.edwin.torok@citrix.com> (raw)

This is a test that can be run in Dom0, which constructs a minimal
guest, fills the memory with a deterministic pattern,
xc_domains_save/xc_domain_restore on 2 threads, and checks the pattern
at the end. On mismatch hexdumps of the portions that do not match are
printed.
Although the test is very simple it has already been very useful during
the development of 2 migration optimization patch sets (foreign copy and
migration compression, to be posted separately).

Of course the test is not a guarantee that migration works correctly,
there are lots of aspects that are not tested (interaction with device
emulators, more complicated memory layouts, the memory layout changing
during migration, etc.), but is a lot easier to debug when it goes wrong
than a real guest crashing (quite often even if you run 'memtest' in the
guest, it'll either crash while executing without printing where the mismatch
is -- if you corrupted the actual program, or continue undetected,
requiring many migration iterations to catch the bug).

It can also be used as a low-level performance test by specifying the
REPEAT environment variable.

Example usage from the tests/migration directory when working on
optimizations in libxenguest:
```
make -j$(nproc) -O -C ../../libs/guest && make -j$(nproc) -O && scp ../../libs/guest/libxenguest.so.4.22.0 ../../libs/guest/libxenguest.so.4.22 test-migration root@$HOST: && ssh root@$HOST env REPEAT=20 LD_LIBRARY_PATH=/root ./test-migration 2>/dev/null | grep 'Performance.*xc_domain_restore'
```
The output can be post-processed with `cut -f2 -d: |cut -f1 -ds`, and
then compared with `ministat` for example.

Currently this patchset depends on another that refactors the unit test
Makefiles. Once I've updated that patchset I'll send a rebased version
of this one.

Edwin Török (2):
  tools/tests/migration: introduce migration functional and performance
    tests
  tools/lib/call: cache up to 4 pages in hypercall bounce buffers

 tools/libs/call/buffer.c               |  28 +-
 tools/libs/call/core.c                 |   3 +-
 tools/libs/call/private.h              |   8 +-
 tools/tests/Makefile                   |   1 +
 tools/tests/common/guests.c            |   1 +
 tools/tests/migration/.gitignore       |   1 +
 tools/tests/migration/Makefile         |  70 +++
 tools/tests/migration/memory.c         |   6 +
 tools/tests/migration/memory.h         |  92 ++++
 tools/tests/migration/patterns.c       |  76 +++
 tools/tests/migration/patterns.h       |  22 +
 tools/tests/migration/test-migration.c | 713 +++++++++++++++++++++++++
 tools/tests/migration/xen_patterns.c   |  92 ++++
 tools/tests/migration/xen_patterns.h   |  14 +
 14 files changed, 1111 insertions(+), 16 deletions(-)
 create mode 100644 tools/tests/migration/.gitignore
 create mode 100644 tools/tests/migration/Makefile
 create mode 100644 tools/tests/migration/memory.c
 create mode 100644 tools/tests/migration/memory.h
 create mode 100644 tools/tests/migration/patterns.c
 create mode 100644 tools/tests/migration/patterns.h
 create mode 100644 tools/tests/migration/test-migration.c
 create mode 100644 tools/tests/migration/xen_patterns.c
 create mode 100644 tools/tests/migration/xen_patterns.h

-- 
2.47.3



             reply	other threads:[~2026-03-30 20:46 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-03-30 20:45 Edwin Török [this message]
2026-03-30 20:45 ` [PATCH v1 1/2] tools/tests/migration: introduce migration functional and performance tests Edwin Török
2026-03-30 20:45 ` [PATCH v1 2/2] tools/lib/call: cache up to 4 pages in hypercall bounce buffers Edwin Török

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=cover.1774903347.git.edwin.torok@citrix.com \
    --to=edwin.torok@citrix.com \
    --cc=anthony.perard@vates.tech \
    --cc=jgross@suse.com \
    --cc=marcus.granado@citrix.com \
    --cc=xen-devel@lists.xenproject.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 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.