Fix s390x flic migration and add some more qtests
cover Fix s390x flic migration and add some more qtests
I don't know s390x enough to know if this is the right fix, but I could debug the migration hangs this far at least (and the patch fixes the condition that would previously result in a hang on the qtest).
Also we could enable the test_ignore_shared test that seems to work on s390x and ppc64 at least.
Thanks,
Nick
Nicholas Piggin (3):
hw/intc/s390_flic: Migrate pending state tests/qtest/migration-test: enable on s390x tests/qtest/migration-test: Enable test_ignore_shared
hw/intc/s390_flic.c | 1 + tests/qtest/migration-test.c | 25 ++++++++----------------- 2 files changed, 9 insertions(+), 17 deletions(-)
Signature · 1 line
2.43.0
RFC PATCH 1/3 hw/intc/s390_flic: Migrate pending state
The flic pending state is not migrated, so if the machine is migrated while an interrupt is pending, it can be lost. This shows up in qtest migration test, an extint is pending (due to console writes?) and the CPU waits via s390_cpu_set_psw and expects the interrupt to wake it. However when the flic pending state is lost, s390_cpu_has_int returns false, so s390_cpu_exec_interrupt falls through to halting again.
Fix this by migrating pending. This prevents the qtest from hanging. Does service_param need to be migrated? Or the IO lists?
--- hw/intc/s390_flic.c | 1 + 1 file changed, 1 insertion(+)
hw/intc/s390_flic.c +1 -0
@@ -369,6 +369,7 @@ static const VMStateDescription qemu_s390_flic_vmstate = { .fields = (const VMStateField[]) {VMSTATE_UINT8 (simm, QEMUS390FLICState),VMSTATE_UINT8 (nimm, QEMUS390FLICState), +VMSTATE_UINT32 (pending, QEMUS390FLICState),VMSTATE_END_OF_LIST () } };
Signature · 1 line
2.43.0
Re: [RFC PATCH 1/3] hw/intc/s390_flic: Migrate pending state
Am 25.05.24 um 15:12 schrieb Nicholas Piggin:
Quoted 21 lines
The flic pending state is not migrated, so if the machine is migrated while an interrupt is pending, it can be lost. This shows up in qtest migration test, an extint is pending (due to console writes?) and the CPU waits via
s390_cpu_set_pswand expects the interrupt to wake it. However when the flic pending state is lost,s390_cpu_has_intreturns false, sos390_cpu_exec_interruptfalls through to halting again.Fix this by migrating pending. This prevents the qtest from hanging. Does
service_paramneed to be migrated? Or the IO lists?Signed-off-by Nicholas Piggin <[email protected]>--- hw/intc/s390_flic.c | 1 + 1 file changed, 1 insertion(+)hw/intc/s390_flic.c +0
-0
hw/intc/s390_flic.c static const VMStateDescription qemu_s390_flic_vmstate = { · line 375
Quoted 7 lines
hw/intc/s390_flic.c +1
-0@@ -369,6 +369,7 @@ static const VMStateDescription qemu_s390_flic_vmstate = { .fields = (const VMStateField[]) {VMSTATE_UINT8 (simm, QEMUS390FLICState),VMSTATE_UINT8 (nimm, QEMUS390FLICState), +VMSTATE_UINT32 (pending, QEMUS390FLICState),VMSTATE_END_OF_LIST () } };
Likely you have to handle this using QEMU compat machines.
Signature · 3 lines
Thanks, David / dhildenb
Re: [RFC PATCH 1/3] hw/intc/s390_flic: Migrate pending state
Quoted 17 lines · David Hildenbrand
Am 25.05.24 um 15:12 schrieb Nicholas Piggin:
Quoted 16 lines
The flic pending state is not migrated, so if the machine is migrated while an interrupt is pending, it can be lost. This shows up in qtest migration test, an extint is pending (due to console writes?) and the CPU waits via
s390_cpu_set_pswand expects the interrupt to wake it. However when the flic pending state is lost,s390_cpu_has_intreturns false, sos390_cpu_exec_interruptfalls through to halting again.Fix this by migrating pending. This prevents the qtest from hanging. Does
service_paramneed to be migrated? Or the IO lists?Signed-off-by Nicholas Piggin <[email protected]>---
hw/intc/s390_flic.c| 1 +1 file changed, 1 insertion(+)
Quoted 14 lines
hw/intc/s390_flic.c static const VMStateDescription qemu_s390_flic_vmstate = { · line 375
Quoted 12 lines
hw/intc/s390_flic.c +1
-0@@ -369,6 +369,7 @@ static const VMStateDescription qemu_s390_flic_vmstate = { .fields = (const VMStateField[]) { VMSTATE_UINT8(simm, QEMUS390FLICState), VMSTATE_UINT8(nimm, QEMUS390FLICState), + VMSTATE_UINT32(pending, QEMUS390FLICState), VMSTATE_END_OF_LIST() } };Likely you have to handle this using QEMU compat machines.
Well, since existing migration is broken, I don't think you have to preserve compatibility. But you do have to bump the version number.
r~
Re: [RFC PATCH 1/3] hw/intc/s390_flic: Migrate pending state
Am 26.05.24 um 21:44 schrieb Richard Henderson:
Quoted 33 lines · David Hildenbrand
Quoted 17 lines
Am 25.05.24 um 15:12 schrieb Nicholas Piggin:
Quoted 16 lines
The flic pending state is not migrated, so if the machine is migrated while an interrupt is pending, it can be lost. This shows up in qtest migration test, an extint is pending (due to console writes?) and the CPU waits via
s390_cpu_set_pswand expects the interrupt to wake it. However when the flic pending state is lost,s390_cpu_has_intreturns false, sos390_cpu_exec_interruptfalls through to halting again.Fix this by migrating pending. This prevents the qtest from hanging. Does
service_paramneed to be migrated? Or the IO lists?Signed-off-by Nicholas Piggin <[email protected]>---
hw/intc/s390_flic.c| 1 +1 file changed, 1 insertion(+)Quoted 14 lines
hw/intc/s390_flic.c static const VMStateDescription qemu_s390_flic_vmstate = { · line 375
Quoted 12 lines
hw/intc/s390_flic.c +1
-0@@ -369,6 +369,7 @@ static const VMStateDescription qemu_s390_flic_vmstate = { .fields = (const VMStateField[]) { VMSTATE_UINT8(simm, QEMUS390FLICState), VMSTATE_UINT8(nimm, QEMUS390FLICState), + VMSTATE_UINT32(pending, QEMUS390FLICState), VMSTATE_END_OF_LIST() } };Likely you have to handle this using QEMU compat machines.
Quoted 1 line
Well, since existing migration is broken, I don't think you have to preserve
Migration is broken only in some case "while an interrupt is pending, it can be lost".
Quoted 1 line
compatibility. But you do have to bump the version number.
Looking at it, this is TCG only, so likely we don't care that much about migration compatibility. But I have no idea what level of compatibility we want to support there.
Signature · 3 lines
Thanks, David / dhildenb
Re: [RFC PATCH 1/3] hw/intc/s390_flic: Migrate pending state
Quoted 35 lines · David Hildenbrand
Am 26.05.24 um 21:44 schrieb Richard Henderson:
Quoted 34 lines · David Hildenbrand
Quoted 32 lines
Am 25.05.24 um 15:12 schrieb Nicholas Piggin:
Quoted 28 lines
The flic pending state is not migrated, so if the machine is migrated while an interrupt is pending, it can be lost. This shows up in qtest migration test, an extint is pending (due to console writes?) and the CPU waits via
s390_cpu_set_pswand expects the interrupt to wake it. However when the flic pending state is lost,s390_cpu_has_intreturns false, sos390_cpu_exec_interruptfalls through to halting again.Fix this by migrating pending. This prevents the qtest from hanging. Does
service_paramneed to be migrated? Or the IO lists?Signed-off-by Nicholas Piggin <[email protected]>---
hw/intc/s390_flic.c| 1 +1 file changed, 1 insertion(+)hw/intc/s390_flic.c +1
-0@@ -369,6 +369,7 @@ static const VMStateDescription qemu_s390_flic_vmstate = { .fields = (const VMStateField[]) { VMSTATE_UINT8(simm, QEMUS390FLICState), VMSTATE_UINT8(nimm, QEMUS390FLICState), + VMSTATE_UINT32(pending, QEMUS390FLICState), VMSTATE_END_OF_LIST() }Quoted 1 line
};
Likely you have to handle this using QEMU compat machines.
Quoted 7 lines
Quoted 1 line
Well, since existing migration is broken, I don't think you have to preserve
Migration is broken only in some case "while an interrupt is pending, it can be lost".
Quoted 1 line
compatibility. But you do have to bump the version number.
Looking at it, this is TCG only, so likely we don't care that much about migration compatibility. But I have no idea what level of compatibility we want to support there.
Yes, this seems to only affect the TCG-only flic device, where migration has never been working very reliably. So I think we don't really need the whole compat-machine dance here. But I think we should at least bump the version_id to 2 now and then use
VMSTATE_UINT32_V(pending, QEMUS390FLICState, 2);
for the new field. That way we would at least support forward migrations without too much hassle.
Thomas
Re: [RFC PATCH 1/3] hw/intc/s390_flic: Migrate pending state
Quoted 52 lines · Thomas Huth
Quoted 37 lines · David Hildenbrand
Am 26.05.24 um 21:44 schrieb Richard Henderson:
Quoted 34 lines · David Hildenbrand
Quoted 17 lines
Am 25.05.24 um 15:12 schrieb Nicholas Piggin:
Quoted 16 lines
The flic pending state is not migrated, so if the machine is migrated while an interrupt is pending, it can be lost. This shows up in qtest migration test, an extint is pending (due to console writes?) and the CPU waits via
s390_cpu_set_pswand expects the interrupt to wake it. However when the flic pending state is lost,s390_cpu_has_intreturns false, sos390_cpu_exec_interruptfalls through to halting again.Fix this by migrating pending. This prevents the qtest from hanging. Does
service_paramneed to be migrated? Or the IO lists?Signed-off-by Nicholas Piggin <[email protected]>---
hw/intc/s390_flic.c| 1 +1 file changed, 1 insertion(+)Quoted 15 lines
Quoted 12 lines
hw/intc/s390_flic.c +1
-0@@ -369,6 +369,7 @@ static const VMStateDescription qemu_s390_flic_vmstate = { .fields = (const VMStateField[]) { VMSTATE_UINT8(simm, QEMUS390FLICState), VMSTATE_UINT8(nimm, QEMUS390FLICState), + VMSTATE_UINT32(pending, QEMUS390FLICState), VMSTATE_END_OF_LIST() }Quoted 1 line
};
Likely you have to handle this using QEMU compat machines.
Quoted 1 line
Well, since existing migration is broken, I don't think you have to preserve
Quoted 8 lines
Migration is broken only in some case "while an interrupt is pending, it can be lost".
Quoted 1 line
compatibility. But you do have to bump the version number.
Looking at it, this is TCG only, so likely we don't care that much about migration compatibility. But I have no idea what level of compatibility we want to support there.
Yes, this seems to only affect the TCG-only flic device, where migration has never been working very reliably. So I think we don't really need the whole compat-machine dance here. But I think we should at least bump the
version_idto 2 now and then use
Quoted 4 lines
VMSTATE_UINT32_V(pending, QEMUS390FLICState, 2);for the new field. That way we would at least support forward migrations without too much hassle.
Well if you could rebuild this state by checking sources or something it might be possible to avoid. Or if you could always mark pending and software can tolerate superflous. But that also seems like a lot of headache for something that was always flaky.
Thanks,
Nick
RFC PATCH 2/3 tests/qtest/migration-test: enable on s390x
In reply to Nicholas Piggins390x is more stable now. Enable it.
--- tests/qtest/migration-test.c | 12 ------------ 1 file changed, 12 deletions(-)
tests/qtest/migration-test.c +0 -12
@@ -3428,16 +3428,6 @@ int main(int argc, char **argv)migration_test_add ("/migration/analyze-script" , test_analyze_script);#endif -/* -* On s390x, the test seems to be touchy with TCG, perhaps due to race -* conditions on dirty bits, so disable it there until the problems are -* resolved. -*/ -if (g_str_equal (arch,"s390x" ) && !has_kvm) { -g_test_message ("Skipping tests: s390x host with KVM is required" ); - goto test_add_done; - } -if (is_x86) {migration_test_add ("/migration/precopy/unix/suspend/live" , test_precopy_unix_suspend_live);
@@ -3619,8 +3609,6 @@ int main(int argc, char **argv) test_vcpu_dirty_limit); } -test_add_done: - ret =g_test_run (); g_assert_cmpint(ret, ==, 0);
Signature · 1 line
2.43.0
Re: [RFC PATCH 2/3] tests/qtest/migration-test: enable on s390x
Hi,
Quoted 12 lines · Nicholas Piggin
s390x is more stable now. Enable it.
Signed-off-by Nicholas Piggin <[email protected]>--- tests/qtest/migration-test.c | 12 ------------ 1 file changed, 12 deletions(-)tests/qtest/migration-test.c +0
-0
tests/qtest/migration-test.c int main(int argc, char **argv) · line 3435
Quoted 8 lines
tests/qtest/migration-test.c +0
-5@@ -3428,16 +3428,6 @@ int main(int argc, char **argv)migration_test_add ("/migration/analyze-script" , test_analyze_script);#endif -/* -* On s390x, the test seems to be touchy with TCG, perhaps due to race -* conditions on dirty bits, so disable it there until the problems are -* resolved. -*/
-> https://lists.nongnu.org/archive/html/qemu-devel/2024-05/msg04774.html
* Above patch (not reviewed yet) adds comment about sporadic problems on s390x, and this patch says s390x is stable now? It'll help to mention in the commit log - what changed to make it stable in 1 day.
* IIUC, this and the ppc64 patch above enable 'migration-test' for s390x and ppc64 platforms, when KVM is not available for them? ie. When running s390x & ppc64 migration-tests with TCG on non s390x or non-ppc64 machines, right? Maybe the commit message could say something to the effect of - enable s390x and ppc64 'migration-test' to run with TCG across platforms where KVM for s390x OR KVM for ppc64 is not available.
Quoted 9 lines
tests/qtest/migration-test.c +0
-5-if (g_str_equal (arch,"s390x" ) && !has_kvm) { -g_test_message ("Skipping tests: s390x host with KVM is required" ); - goto test_add_done; - } -if (is_x86) {migration_test_add ("/migration/precopy/unix/suspend/live" , test_precopy_unix_suspend_live);
tests/qtest/migration-test.c int main(int argc, char **argv)
Quoted 9 lines
tests/qtest/migration-test.c +0
-3@@ -3619,8 +3609,6 @@ int main(int argc, char **argv) test_vcpu_dirty_limit); } -test_add_done: - ret =g_test_run (); g_assert_cmpint(ret, ==, 0); --
* Otherwise, the change looks okay to enable 'migration-test' for s390x with TCG IIUC.
Thank you.
---
- Prasad
Re: [RFC PATCH 2/3] tests/qtest/migration-test: enable on s390x
Quoted 26 lines · Prasad Pandit
Hi,
Quoted 12 lines · Nicholas Piggin
s390x is more stable now. Enable it.
Signed-off-by Nicholas Piggin <[email protected]>--- tests/qtest/migration-test.c | 12 ------------ 1 file changed, 12 deletions(-)tests/qtest/migration-test.c +0
-0tests/qtest/migration-test.c int main(int argc, char **argv) · line 3435
Quoted 8 lines
tests/qtest/migration-test.c +0
-5@@ -3428,16 +3428,6 @@ int main(int argc, char **argv)migration_test_add ("/migration/analyze-script" , test_analyze_script);#endif -/* -* On s390x, the test seems to be touchy with TCG, perhaps due to race -* conditions on dirty bits, so disable it there until the problems are -* resolved. -*/ -> https://lists.nongnu.org/archive/html/qemu-devel/2024-05/msg04774.html
Quoted 3 lines
* Above patch (not reviewed yet) adds comment about sporadic problems on s390x, and this patch says s390x is stable now? It'll help to mention in the commit log - what changed to make it stable in 1 day.
Patch 1 of this series.
Quoted 7 lines
* IIUC, this and the ppc64 patch above enable 'migration-test' for s390x and ppc64 platforms, when KVM is not available for them? ie. When running s390x & ppc64 migration-tests with TCG on non s390x or non-ppc64 machines, right? Maybe the commit message could say something to the effect of - enable s390x and ppc64 'migration-test' to run with TCG across platforms where KVM for s390x OR KVM for ppc64 is not available.
Yes they should be called "enable for TCG" indeed.
Quoted 16 lines
Quoted 16 lines
tests/qtest/migration-test.c +0
-7-if (g_str_equal (arch,"s390x" ) && !has_kvm) { -g_test_message ("Skipping tests: s390x host with KVM is required" ); - goto test_add_done; - } -if (is_x86) {migration_test_add ("/migration/precopy/unix/suspend/live" , test_precopy_unix_suspend_live);@@ -3619,8 +3609,6 @@ int main(int argc, char **argv) test_vcpu_dirty_limit); } -test_add_done: - ret =g_test_run ();
Quoted 5 lines
tests/qtest/migration-test.c int main(int argc, char **argv)
Quoted 2 lines
tests/qtest/migration-test.c +0
-1g_assert_cmpint(ret, ==, 0); --* Otherwise, the change looks okay to enable 'migration-test' for s390x with TCG IIUC.
Thanks,
Nick
Prasad Pandit
Reviewed-byRe: [RFC PATCH 2/3] tests/qtest/migration-test: enable on s390x
Quoted 5 lines · Nicholas Piggin
Quoted 3 lines
* Above patch (not reviewed yet) adds comment about sporadic problems on s390x, and this patch says s390x is stable now? It'll help to mention in the commit log - what changed to make it stable in 1 day.
Patch 1 of this series.
* Ah, that one got filtered to another folder. It'll help to add something about the 'flic pending' case being specific to migration of TCG device and so it's reasonable to remove 'has_kvm' check and enable migration-test to run with TCG.
Quoted 2 lines
Yes they should be called "enable for TCG" indeed.
Ack with commit message changes:
Thank you.
---
- Prasad
RFC PATCH 3/3 tests/qtest/migration-test: Enable test_ignore_shared
In reply to Nicholas PigginThis was said to be broken on aarch64, but if it works on others, let's try enable it. It's already starting to bitrot...
--- tests/qtest/migration-test.c | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-)
tests/qtest/migration-test.c +8 -5
@@ -1862,14 +1862,15 @@ static void test_precopy_unix_tls_x509_override_host(void)#endif /* CONFIG_TASN1 */ #endif /* CONFIG_GNUTLS */ -#if 0 -/* Currently upset on aarch64 TCG */ static void test_ignore_shared (void ) { g_autofree char *uri = g_strdup_printf("unix:%s/migsocket", tmpfs);QTestState *from, *to; +MigrateStart args = { + .use_shmem = true, + }; -if (test_migrate_start (&from, &to, uri, false, true,NULL ,NULL )) { +if (test_migrate_start (&from, &to, uri, &args)) {return ; }
@@ -1898,7 +1899,6 @@ static void test_ignore_shared(void)test_migrate_end (from, to, true); } -#endif static void * test_migrate_xbzrle_start(QTestState *from,
@@ -3537,7 +3537,10 @@ int main(int argc, char **argv)#endif /* CONFIG_TASN1 */ #endif /* CONFIG_GNUTLS */ -/* migration_test_add("/migration/ignore_shared", test_ignore_shared); */ +if (strcmp (arch,"aarch64" ) ==0 ) {/* Currently upset on aarch64 TCG */ +migration_test_add ("/migration/ignore_shared" , test_ignore_shared); + } +#ifndef _WIN32migration_test_add ("/migration/precopy/fd/tcp" , test_migrate_precopy_fd_socket);
Signature · 1 line
2.43.0
Re: [RFC PATCH 3/3] tests/qtest/migration-test: Enable test_ignore_shared
Quoted 2 lines · Nicholas Piggin
This was said to be broken on aarch64, but if it works on others, let's try enable it. It's already starting to bitrot...
Yeah, look at the state of this...
I don't know what the issue was on aarch64, but I'm all for enabling this test globally and then we deal with the breakage if it ever comes. I don't think it will.
However, there is an issue here still on all archs - which might very well have been the original issue - which is the fact that the containers on the Gitlab CI have limits on shared memory usage. Unfortunately we cannot enable this test for the CI, so it needs a check on the GITLAB_CI environment variable.
There's also the cpr-reboot test which got put under "flaky", that has the same issue. That one should also have been under GITLAB_CI. From that discussion:
"We have an issue with this test on CI:
$ df -h /dev/shm Filesystem Size Used Avail Use% Mounted on shm 64M 0 64M 0% /dev/shm
These are shared CI runners, so AFAICT there's no way to increase the shared memory size.
Reducing the memory for this single test also wouldn't work because we can run migration-test for different archs in parallel + there's the ivshmem_test which uses 4M.
Maybe just leave it out of CI? Laptops will probably have enough shared memory to not hit this. If we add a warning comment to the test, might be enough." -- https://lore.kernel.org/all/[email protected]
Quoted 51 lines
Cc Yury Kotov <[email protected]>Cc Dr. David Alan Gilbert <[email protected]>Signed-off-by Nicholas Piggin <[email protected]>--- tests/qtest/migration-test.c | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-)tests/qtest/migration-test.c +8
-5@@ -1862,14 +1862,15 @@ static void test_precopy_unix_tls_x509_override_host(void)#endif /* CONFIG_TASN1 */ #endif /* CONFIG_GNUTLS */ -#if 0 -/* Currently upset on aarch64 TCG */ static void test_ignore_shared (void ) { g_autofree char *uri = g_strdup_printf("unix:%s/migsocket", tmpfs);QTestState *from, *to; +MigrateStart args = { + .use_shmem = true, + }; -if (test_migrate_start (&from, &to, uri, false, true,NULL ,NULL )) { +if (test_migrate_start (&from, &to, uri, &args)) {return ; }@@ -1898,7 +1899,6 @@ static void test_ignore_shared(void)test_migrate_end (from, to, true); } -#endif static void * test_migrate_xbzrle_start(QTestState *from,@@ -3537,7 +3537,10 @@ int main(int argc, char **argv)#endif /* CONFIG_TASN1 */ #endif /* CONFIG_GNUTLS */ -/* migration_test_add("/migration/ignore_shared", test_ignore_shared); */ +if (strcmp (arch,"aarch64" ) ==0 ) {/* Currently upset on aarch64 TCG */ +migration_test_add ("/migration/ignore_shared" , test_ignore_shared); + } +#ifndef _WIN32migration_test_add ("/migration/precopy/fd/tcp" , test_migrate_precopy_fd_socket);
Re: [RFC PATCH 3/3] tests/qtest/migration-test: Enable test_ignore_shared
Quoted 5 lines · Fabiano Rosas
However, there is an issue here still on all archs - which might very well have been the original issue - which is the fact that the containers on the Gitlab CI have limits on shared memory usage. Unfortunately we cannot enable this test for the CI, so it needs a check on the
GITLAB_CIenvironment variable.
Another option is we teach migration-test to detect whether memory_size of shmem is available, skip if not. It can be a sequence of:
memfd_create()
fallocate()
ret = madvise(MADV_POPULATE_WRITE)
To be run at the entry of migration-test, and skip all use_shmem=true tests if ret != 0, or any step failed above.
Thanks,
Signature · 1 line
Peter Xu
Re: [RFC PATCH 3/3] tests/qtest/migration-test: Enable test_ignore_shared
Quoted 10 lines · Peter Xu
Quoted 5 lines · Fabiano Rosas
However, there is an issue here still on all archs - which might very well have been the original issue - which is the fact that the containers on the Gitlab CI have limits on shared memory usage. Unfortunately we cannot enable this test for the CI, so it needs a check on the
GITLAB_CIenvironment variable.Another option is we teach migration-test to detect whether
memory_sizeof shmem is available, skip if not. It can be a sequence of:
Quoted 6 lines
memfd_create()
fallocate()
ret =madvise(MADV_POPULATE_WRITE)To be run at the entry of migration-test, and skip all use_shmem=true tests if ret != 0, or any step failed above.
There are actually two issues:
1) Trying to run a test that needs more shmem than available in the container. This is covered well by your suggestion.
2) Trying to use some shmem while another test has already consumed all shmem. I'm not sure if this can be done reliably as the tests run in parallel.
Re: [RFC PATCH 3/3] tests/qtest/migration-test: Enable test_ignore_shared
Quoted 19 lines · Fabiano Rosas
Quoted 10 lines · Peter Xu
Quoted 5 lines · Fabiano Rosas
However, there is an issue here still on all archs - which might very well have been the original issue - which is the fact that the containers on the Gitlab CI have limits on shared memory usage. Unfortunately we cannot enable this test for the CI, so it needs a check on the
GITLAB_CIenvironment variable.Another option is we teach migration-test to detect whether
memory_sizeof shmem is available, skip if not. It can be a sequence of:Quoted 6 lines
memfd_create()
fallocate()
ret =madvise(MADV_POPULATE_WRITE)To be run at the entry of migration-test, and skip all use_shmem=true tests if ret != 0, or any step failed above.
Quoted 8 lines
There are actually two issues:
1) Trying to run a test that needs more shmem than available in the container. This is covered well by your suggestion.
2) Trying to use some shmem while another test has already consumed all shmem. I'm not sure if this can be done reliably as the tests run in parallel.
Maybe we can also make that check to be per-test, then when use_shmem=true the test populates the shmem file before using, skip if population fails. And if it succeeded, using that file in that test should be reliable.
Signature · 1 line
Peter Xu
Quoted 4 lines · Nicholas Piggin
I don't know s390x enough to know if this is the right fix, but I could debug the migration hangs this far at least (and the patch fixes the condition that would previously result in a hang on the qtest).
I've run this now for a while, and the hang seems to be gone, indeed! Pretty cool, thanks for digging into this!