Re: [PATCH v2] kvm/selftests: Fix race condition with dirty_log_test

2021-04-17 Thread Peter Xu
Paolo, Please hold-on with this patch since I got another report that this patch can still trigger test failure if even heavier workload (e.g., "taskset -c 0 ./dirty_log_test" plus another one or multiple "taskset -c 0 while :; do:; done"). So I plan to do it in another way. I tested longer yest

Re: [PATCH v2] kvm/selftests: Fix race condition with dirty_log_test

2021-04-17 Thread Paolo Bonzini
On 13/04/21 23:36, Peter Xu wrote: This patch closes this race by allowing the main thread to give the vcpu thread chance to do a VMENTER to complete that write operation. It's done by adding a vcpu loop counter (must be defined as volatile as main thread will do read loop), then the main thread

Re: [PATCH v2] kvm/selftests: Fix race condition with dirty_log_test

2021-04-14 Thread Andrew Jones
On Tue, Apr 13, 2021 at 05:36:41PM -0400, Peter Xu wrote: > This fixes a bug that can trigger with e.g. "taskset -c 0 ./dirty_log_test" or > when the testing host is very busy. > > The issue is when the vcpu thread got the dirty bit set but got preempted by > other threads _before_ the data is wri