From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from lists1p.gnu.org (lists1p.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-ECDSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 3E68E606A327 for ; Wed, 2 Dec 2026 16:53:31 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key, unprotected) header.d=linaro.org header.i=@linaro.org header.a=rsa-sha256 header.s=google header.b=LVC3n3JR Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1xYnZZ-0007ie-LR; Wed, 02 Dec 2026 11:52:49 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists1p.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1xYnZV-0007hP-7o for qemu-devel@nongnu.org; Wed, 02 Dec 2026 11:52:45 -0500 Received: from mail-wr1-x436.google.com ([2a00:1450:4864:20::436]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1xYnZR-00059f-D2 for qemu-devel@nongnu.org; Wed, 02 Dec 2026 11:52:44 -0500 Received: by mail-wr1-x436.google.com with SMTP id ffacd0b85a97d-4acb44dcd7bso11682876f8f.0 for ; Wed, 02 Dec 2026 08:52:40 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1796230359; x=1796835159; darn=nongnu.org; h=content-transfer-encoding:content-type:mime-version:message-id:date :user-agent:references:in-reply-to:subject:cc:to:from:from:to:cc :subject:date:message-id:reply-to:content-type; bh=4Q3yvMpCISauq5ZkJz/flpjObfAMw6pY9H/kgX2VmKc=; b=LVC3n3JRxydSQ2a34EJ131Wq5cSJe0JqN0wCZB3PCE4LSKt6W8tpCNdtBLQL1T35vH 9hGscMg4rGkXHtCUSgC7GyKb0UtjlkLlyiH6g5+aUK9lfxc1Ie/KmGwnyuzD9sTmKTUv jGyOt6NjxFEvuKvM6FPiINhTnNhQ/M6TF/xOT5S6A4MVcLhHGqPdmIeSMFi3t9WJm6vs wesh1Fqs/wvKkgIu3D2MG13fGwPrVjj/eT7wglWEpqh/qUdjE5Q1ANY79/QKeg8Lr6eG pckzSPdwS2ma+TPzTretiLng9itsnE0W4PhGvTP16fWZ9AUIuMFsCChhwsmPLsOwY6J2 JcQw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20260707; t=1796230359; x=1796835159; h=content-transfer-encoding:content-type:mime-version:message-id:date :user-agent:references:in-reply-to:subject:cc:to:from:x-gm-gg :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to :content-type; bh=4Q3yvMpCISauq5ZkJz/flpjObfAMw6pY9H/kgX2VmKc=; b=eujvUsn6Bm9vUID7WlUwU5X8xFquavZa3rjDvUiQSlvat5IqsWM9klBjVAuP+4SY19 RaU6bOJqAoHcUUsWSI0PkMWjO3iLx2Zjzf2XzMTlxXftEIg1A7/CEifc0IlZl0abzsJm tRMtCuEdww5Gh3ARyMdaF7r8cgw5QJsD9ZY8/cyepsbybUxxYRy0EWvchtQ49Z4FDFd+ taaebLxuf+QdYBcbV08W7MtvMeB/NZIwlM4xhnlk4hhhsfNdu6ddtgZNcEAcpF0Y9QeB JmRu9dZ2Q3+4lGKufHP3qbkMvS5sQ3ATZhrulmZG32QYVY6j/EChAu3bxQrjB0A98/TE psxQ== X-Gm-Message-State: APuU4Z+p4daOAepwicpVbWV0lgLPObkNa/mwZuojLodY03iChhXkNFQS vMwbd1oK1XZJx4+1GrZnIxfF1ySQpiB2rBQbFQnbLQG0UdnIO/vVq1dePbWFrBxOlYE= X-Gm-Gg: AZFdTZeFLrCjxxIkZHWn0+K0QgA3o+834d8KqfJdPoJhZ3hcmOjvC3oKR+a0CqBvao1 XR5Wcwp2uf0bLPU7HudVEi8pQlKqEn5FBbBAqGuVdoC7dCR5zQfoRuHz76CcHgnZu/KgwldQvUq p7ItkbU+e1EqQ+j1JQ8R+seR7hqpe/Kt4p6mH00uh69p4y9ktwdsL463a+7SLELik1Y8A6vUg+y cPsdQHCw1MVt8CWDbpNUqIWkDCPWqMSOsUXjGPnRN/vjqoWpf/f32Lj6zz5mYJPeT8YQvcPIqrq gOY+zeaWupoM1bRkT1CAn0wsqQCEcsSOk8pMbuHZyfZq2jyzX6hhlSTAcD9BDFCi6LfGV41zb3V z8ESxulZery5mDMBiS4+ye/XsS9RFlBp9lqHOXAJEAI9/F6sty2zScbf4S7n3kTLCrebMYpccB4 WIx9nVSeCSf6lE/OyVL6hs4YaYzRIRecUp7gRpOTAfxTv2gwTtHXd67NiIFxEITGl/uoZxFAZkU iCaOZiGWY6zLxd3u/iuJnBmVT+V5CqLCkvYWCyBjK5C/Oipa95u8a82QvhyE8cprV9UBovG6BOa xzsZcEdH9DzpSquPwzLUfk6ivIxC X-Received: by 2002:a05:6000:29d5:b0:4a9:1649:9eb9 with SMTP id ffacd0b85a97d-4abb2168fcemr57452605f8f.16.1796230359446; Wed, 02 Dec 2026 08:52:39 -0800 (PST) Received: from draig.lan ([185.124.0.158]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-4ab6c4353d6sm75247691f8f.56.2026.12.02.08.52.38 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 02 Dec 2026 08:52:38 -0800 (PST) Received: from draig (localhost [IPv6:::1]) by draig.lan (Postfix) with ESMTP id 813745F9CE; Wed, 02 Dec 2026 16:52:37 +0000 (GMT) From: =?utf-8?Q?Alex_Benn=C3=A9e?= To: Alexander Mikhalitsyn Cc: qemu-devel@nongnu.org, peterx@redhat.com, =?utf-8?Q?St=C3=A9phane?= Graber , Zhao Liu , Klaus Jensen , Keith Busch , Paolo Bonzini , Fabiano Rosas , Jesper Devantier , qemu-block@nongnu.org Subject: Re: [PATCH] tests/functional/x86_64: fix race in NVMe live migration test In-Reply-To: (Alexander Mikhalitsyn's message of "Wed, 2 Dec 2026 16:21:39 +0100") References: <20261121184301.21112-1-alex@amutable.com> <99e96424636a55eb9c897ab03c04d1a47666eb3c.camel@amutable.com> <875wxb3eps.fsf@draig.linaro.org> User-Agent: mu4e 1.14.5-pre2; emacs 30.1 Date: Wed, 02 Dec 2026 16:52:37 +0000 Message-ID: <87ik1b1v6y.fsf@draig.linaro.org> X-Archived-By: MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Received-SPF: pass client-ip=2a00:1450:4864:20::436; envelope-from=alex.bennee@linaro.org; helo=mail-wr1-x436.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=unavailable autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: qemu development List-Archive: List-Post: List-Help: List-Subscribe: , Sender: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org X-Spam-Status: No, score=-15.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_CR_TRAILER,INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_PASS, SPF_PASS autolearn=ham autolearn_force=no version=4.0.1 X-Spam-Checker-Version: SpamAssassin 4.0.1 (2024-03-26) on aws-us-west-2-korg-listserv-alma10-1 Alexander Mikhalitsyn writes: > On Wed, Dec 2, 2026 at 4:05=E2=80=AFPM Alex Benn=C3=A9e wrote: >> >> Alexander Mikhalitsyn writes: >> >> > On Sat, 2026-11-21 at 19:43 +0100, Alexander Mikhalitsyn wrote: >> >> This test uses /tmp to hold test_nvme_mig_workload.pid file, which >> >> is a PID of a "workload" process (producing heavy read I/O). >> >> >> >> Earlier I did a mistake and forgot to mount /tmp as tmpfs, instead >> >> /tmp was using the same storage as root-filesystem (which lives on >> >> NVMe device). >> >> >> >> The problem here is that for this device we use "snapshot=3Don" mode, >> >> so after live migration all data that was written on the underlying >> >> disk is lost. It is not critical for the test itself (because it's >> >> read-only test by design), but very critical for the test logic >> >> that uses /tmp to find out the PID of the workload process to kill it >> >> after live migration. Absence of this file causes test to fail >> >> spontaneously. >> >> >> >> Link: >> >> https://lore.kernel.org/all/20260921190345.1709227-1-alex.bennee@lina= ro.org/ >> >> Reported-by: Alex Benn=C3=A9e >> >> Tested-by: Peter Xu >> >> Signed-off-by: Alexander Mikhalitsyn >> >> --- >> >> tests/functional/x86_64/test_nvme_migration.py | 2 ++ >> >> 1 file changed, 2 insertions(+) >> >> >> >> diff --git a/tests/functional/x86_64/test_nvme_migration.py >> >> b/tests/functional/x86_64/test_nvme_migration.py >> >> index 890f0aab6d..a8fb5f9e81 100755 >> >> --- a/tests/functional/x86_64/test_nvme_migration.py >> >> +++ b/tests/functional/x86_64/test_nvme_migration.py >> >> @@ -94,6 +94,8 @@ def launch_source_vm(self, vm): >> >> prompt, vm=3Dvm) >> >> exec_command_and_wait_for_pattern(self, 'mount -t sysfs >> >> sysfs /sys', >> >> prompt, vm=3Dvm) >> >> + exec_command_and_wait_for_pattern(self, 'mount -t tmpfs >> >> tmpfs /tmp', >> >> + prompt, vm=3Dvm) >> >> >> >> # Run workload before migration to check if it continues >> >> # to run properly after migration. >> > >> > Gentle ping > > Dear Alex, > >> >> Sorry I did look at this when you posted but I ran into errors but >> didn't have time to diagnose: > > No worries, thanks for reporting this! Let me try to figure this out. > > Please can you try 2nd chunk from > https://lore.kernel.org/all/CAJqdLrqxJF4tgfRYrm27rGivP-HyLUX=3DYCNUiaFqq4= nDq0a5pQ@mail.gmail.com/ That is this thread right? > > I mean this one: > --- a/tests/functional/x86_64/test_nvme_migration.py > +++ b/tests/functional/x86_64/test_nvme_migration.py > @@ -75,6 +75,11 @@ def configure_machine(self, vm): > def launch_source_vm(self, vm): > vm.launch() > > + vm.cmd('migrate-set-parameters', **{ > + 'downtime-limit': 2000000, > + 'max-bandwidth': 10 * 1024**3, > + }) > + > self.wait_for_console_pattern('Entering emergency mode.', vm) > prompt =3D '# ' > self.wait_for_console_pattern(prompt, vm) Manually applying these changes certainly help: retry.py -n 10 -c -- ./run env QEMU_TEST_QEMU_BINARY=3D/home/alex/lsrc/qe= mu.git/builds/all/qemu-system-x86_64 /home/alex/lsrc/qemu.git/builds/all/py= venv/bin/python3 /home/alex/lsrc/qemu.git/tests/functional/x86_64/test_nvme= _migration.py -k test_nvme_migration.X8664NVMeMigrationTest.test_migration_= with_tcp_localhost retry.py called with ['./run', 'env', 'QEMU_TEST_QEMU_BINARY=3D/home/alex= /lsrc/qemu.git/builds/all/qemu-system-x86_64', '/home/alex/lsrc/qemu.git/bu= ilds/all/pyvenv/bin/python3', '/home/alex/lsrc/qemu.git/tests/functional/x8= 6_64/test_nvme_migration.py', '-k', 'test_nvme_migration.X8664NVMeMigration= Test.test_migration_with_tcp_localhost'] Results: Run, Ret, Pass/Fail, Time, Total Pass, Total Run TAP version 13 ok 1 test_nvme_migration.X8664NVMeMigrationTest.test_migration_with_tcp_l= ocalhost 1..1 1, 0, PASS, 6.753956, 1, 1, - TAP version 13 ok 1 test_nvme_migration.X8664NVMeMigrationTest.test_migration_with_tcp_l= ocalhost 1..1 2, 0, PASS, 6.755757, 2, 2, - TAP version 13 ok 1 test_nvme_migration.X8664NVMeMigrationTest.test_migration_with_tcp_l= ocalhost 1..1 3, 0, PASS, 6.755513, 3, 3, - TAP version 13 ok 1 test_nvme_migration.X8664NVMeMigrationTest.test_migration_with_tcp_l= ocalhost 1..1 4, 0, PASS, 6.756819, 4, 4, - TAP version 13 ok 1 test_nvme_migration.X8664NVMeMigrationTest.test_migration_with_tcp_l= ocalhost 1..1 5, 0, PASS, 7.005975, 5, 5, - TAP version 13 ok 1 test_nvme_migration.X8664NVMeMigrationTest.test_migration_with_tcp_l= ocalhost 1..1 6, 0, PASS, 7.005582, 6, 6, - TAP version 13 ok 1 test_nvme_migration.X8664NVMeMigrationTest.test_migration_with_tcp_l= ocalhost 1..1 7, 0, PASS, 7.006506, 7, 7, - TAP version 13 ok 1 test_nvme_migration.X8664NVMeMigrationTest.test_migration_with_tcp_l= ocalhost 1..1 8, 0, PASS, 6.756830, 8, 8, - TAP version 13 ok 1 test_nvme_migration.X8664NVMeMigrationTest.test_migration_with_tcp_l= ocalhost 1..1 9, 0, PASS, 6.755800, 9, 9, - TAP version 13 ok 1 test_nvme_migration.X8664NVMeMigrationTest.test_migration_with_tcp_l= ocalhost 1..1 10, 0, PASS, 7.005840, 10, 10, - Results summary: 0: 10 times (100.00%), avg time 6.856 (0.02 varience/0.13 deviation) Ran command 10 times, 10 passes So with the bw change: Tested-by: Alex Benn=C3=A9e > > I wonder if this helps to make timings more consistent. > > Kind regards, > Alex > >> >> =E2=9E=9C ./run meson test --suite thorough func-x86_64-nvme_migration >> ninja: Entering directory `/home/alex/lsrc/qemu.git/builds/all' >> [2/2] Generating pyvenv/pyvenv_functests_group with a custom command >> mkvenv: checking for pygdbmi>=3D0.11.0.0 >> mkvenv: checking for pylint>=3D3.0.0 >> mkvenv: installing pygdbmi=3D=3D0.11.0.0 >> 1/1 qemu:func-thorough+func-x86_64-thorough+thorough / func-x86_64-nvm= e_migration ERROR 48.29s exit status 1 >> >>> QEMU_TEST_QEMU_IMG=3D/home/alex/lsrc/qemu.git/builds/all/qemu-img = UBSAN_OPTIONS=3Dhalt_on_error=3D1:abort_on_error=3D1:print_summary=3D1:prin= t_stacktrace=3D1 MSAN_OPTIONS=3Dhalt_on_error=3D1:abort_on_error=3D1:print_= summary=3D1:print_stacktrace=3D1 MALLOC_PERTURB_=3D232 ASAN_OPTIONS=3Dhalt_= on_error=3D1:abort_on_error=3D1:print_summary=3D1 QEMU_TEST_QEMU_BINARY=3D/= home/alex/lsrc/qemu.git/builds/all/qemu-system-x86_64 LD_LIBRARY_PATH=3D/ho= me/alex/lsrc/qemu.git/builds/all/contrib/plugins:/home/alex/lsrc/qemu.git/b= uilds/all/tests/tcg/plugins:/home/alex/src/emacs/install/lib/x86_64-linux-g= nu:/home/alex/src/emacs/install/lib:/home/alex/.local/lib MESON_TEST_ITERAT= ION=3D1 QEMU_TEST_GDB=3D/usr/bin/gdb-multiarch PYTHONPATH=3D/home/alex/lsrc= /qemu.git/python:/home/alex/lsrc/qemu.git/tests/functional:/home/alex/lsrc/= qemu.git/python:/home/alex/lsrc/qemu.git/tests/functional RUST_BACKTRACE=3D= 1 /home/alex/lsrc/qemu.git/builds/all/pyvenv/bin/python3 /home/alex/lsrc/qe= mu.git/tests/functional/x86_64/test_nvme_migration.py >> >> >> Ok: 0 >> Expected Fail: 0 >> Fail: 1 >> Unexpected Pass: 0 >> Skipped: 0 >> Timeout: 0 >> >> Full log written to /home/alex/lsrc/qemu.git/builds/all/meson-logs/tes= tlog.txt >> >> From the log: >> >> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D 1/1 =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D >> test: qemu:func-thorough+func-x86_64-thorough+thorough / func-= x86_64-nvme_migration >> start time: 14:52:19 >> duration: 48.29s >> result: exit status 1 >> command: QEMU_TEST_QEMU_IMG=3D/home/alex/lsrc/qemu.git/builds/all= /qemu-img UBSAN_OPTIONS=3Dhalt_on_error=3D1:abort_on_error=3D1:print_summar= y=3D1:print_stacktrace=3D1 MSAN_OPTIONS=3Dhalt_on_error=3D1:abort_on_error= =3D1:print_summary=3D1:print_stacktrace=3D1 MALLOC_PERTURB_=3D232 ASAN_OPTI= ONS=3Dhalt_on_error=3D1:abort_on_error=3D1:print_summary=3D1 QEMU_TEST_QEMU= _BINARY=3D/home/alex/lsrc/qemu.git/builds/all/qemu-system-x86_64 LD_LIBRARY= _PATH=3D/home/alex/lsrc/qemu.git/builds/all/contrib/plugins:/home/alex/lsrc= /qemu.git/builds/all/tests/tcg/plugins:/home/alex/src/emacs/install/lib/x86= _64-linux-gnu:/home/alex/src/emacs/install/lib:/home/alex/.local/lib MESON_= TEST_ITERATION=3D1 QEMU_TEST_GDB=3D/usr/bin/gdb-multiarch PYTHONPATH=3D/hom= e/alex/lsrc/qemu.git/python:/home/alex/lsrc/qemu.git/tests/functional:/home= /alex/lsrc/qemu.git/python:/home/alex/lsrc/qemu.git/tests/functional RUST_B= ACKTRACE=3D1 /home/alex/lsrc/qemu.git/builds/all/pyvenv/bin/python3 /home/a= lex/lsrc/qemu.git/tests/functional/x86_64/test_nvme_migration.py >> ----------------------------------- stdout ---------------------------= -------- >> TAP version 13 >> ok 1 test_nvme_migration.X8664NVMeMigrationTest.test_migration_with_ex= ec >> not ok 2 test_nvme_migration.X8664NVMeMigrationTest.test_migration_wit= h_tcp_localhost >> ok 3 test_nvme_migration.X8664NVMeMigrationTest.test_migration_with_un= ix >> 1..3 >> >> It looks like it is not completing: >> >> Traceback (most recent call last): >> File "/home/alex/lsrc/qemu.git/tests/functional/x86_64/test_nvme_mig= ration.py", line 158, in test_migration_with_tcp_localhost >> self.migration_with_tcp_localhost() >> ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^ >> File "/home/alex/lsrc/qemu.git/tests/functional/migration.py", line = 94, in migration_with_tcp_localhost >> self.migrate(dst_uri) >> ~~~~~~~~~~~~^^^^^^^^^ >> File "/home/alex/lsrc/qemu.git/tests/functional/migration.py", line = 78, in migrate >> self.migrate_vms(dst_uri, src_uri, dst_vm, src_vm) >> ~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ >> File "/home/alex/lsrc/qemu.git/tests/functional/migration.py", line = 62, in migrate_vms >> self.assert_migration(src_vm, dst_vm) >> ~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^ >> File "/home/alex/lsrc/qemu.git/tests/functional/migration.py", line = 38, in assert_migration >> self.assertEqual(src_vm.cmd('query-migrate')['status'], 'completed= ') >> ~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^= ^^ >> AssertionError: 'active' !=3D 'completed' >> - active >> + completed >> >> It does pass sometimes although the run time seems to vary wildly: >> >> retry.py -n 10 -c -- ./run env QEMU_TEST_QEMU_BINARY=3D/home/alex/lsrc= /qemu.git/builds/all/qemu-system-x86_64 /home/alex/lsrc/qemu.git/builds/all= /pyvenv/bin/python3 /home/alex/lsrc/qemu.git/tests/functional/x86_64/test_n= vme_migration.py -k test_nvme_migration.X8664NVMeMigrationTest.test_migrati= on_with_tcp_localhost >> ... >> Results summary: >> 0: 6 times (60.00%), avg time 16.634 (26.36 varience/5.13 deviation) >> 1: 4 times (40.00%), avg time 61.842 (5159.11 varience/71.83 deviation) >> Ran command 10 times, 6 passes >> >> > >> > Kind regards, >> > Alex >> >> -- >> Alex Benn=C3=A9e >> Virtualisation Tech Lead @ Linaro --=20 Alex Benn=C3=A9e Virtualisation Tech Lead @ Linaro