[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH v3] i386: Add ratelimit for bus locks acquired in guest
From: |
Stefan Hajnoczi |
Subject: |
Re: [PATCH v3] i386: Add ratelimit for bus locks acquired in guest |
Date: |
Tue, 18 May 2021 14:48:20 +0100 |
On Mon, May 17, 2021 at 03:46:29PM -0400, Eduardo Habkost wrote:
> > + X86MachineState *x86ms = X86_MACHINE(ms);
> > +
> > + qemu_mutex_lock(&bus_lock_ratelimit_lock);
> > + uint64_t delay_ns =
> > ratelimit_calculate_delay(&x86ms->bus_lock_ratelimit_ctrl, 1);
> > + qemu_mutex_unlock(&bus_lock_ratelimit_lock);
>
> Stefan, ratelimit_calculate_delay() is supposed to be thread
> safe, correct?
Yes, it was a recent change by Paolo Bonzini:
commit 4951967d84a0acbf47895add9158e2d4c6056ea0
Author: Paolo Bonzini <pbonzini@redhat.com>
Date: Tue Apr 13 10:20:32 2021 +0200
ratelimit: protect with a mutex
>
> In that case, bus_lock_ratelimit_lock would be completely unnecessary.
I agree.
signature.asc
Description: PGP signature