[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <ZcEDVkWp6mXoyZsu@google.com>
Date: Mon, 5 Feb 2024 07:48:38 -0800
From: Sean Christopherson <seanjc@...gle.com>
To: Peter Xu <peterx@...hat.com>
Cc: Shaoqin Huang <shahuang@...hat.com>, Paolo Bonzini <pbonzini@...hat.com>,
Shuah Khan <shuah@...nel.org>, kvm@...r.kernel.org, linux-kselftest@...r.kernel.org,
linux-kernel@...r.kernel.org
Subject: Re: [PATCH v3] KVM: selftests: Fix the dirty_log_test semaphore imbalance
On Mon, Feb 05, 2024, Peter Xu wrote:
> Shaoqin, Sean,
>
> Apologies for a late comment. I'm trying to remember what I wrote..
>
> On Fri, Feb 02, 2024 at 01:43:32AM -0500, Shaoqin Huang wrote:
> > Why sem_vcpu_cont and sem_vcpu_stop can be non-zero value? It's because
> > the dirty_ring_before_vcpu_join() execute the sem_post(&sem_vcpu_cont)
> > at the end of each dirty-ring test. It can cause two cases:
>
> As a possible alternative, would it work if we simply reset all the sems
> for each run? Then we don't care about the leftovers. E.g. sem_destroy()
> at the end of run_test(), then always init to 0 at entry.
Gah, I posted v4[*] and didn't Cc you. I would prefer not to reset the semaphores,
mostly because it encourages sloppiness in the test. There's no reason to allow
the two threads to effectively get out of sync.
[*] https://lore.kernel.org/all/17eefa60-cf30-4830-943e-793a63d4e6f1@redhat.com
Powered by blists - more mailing lists