[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH 4/8] edu: add smp_mb__after_rmw()
From: |
Peter Maydell |
Subject: |
Re: [PATCH 4/8] edu: add smp_mb__after_rmw() |
Date: |
Mon, 6 Mar 2023 14:24:23 +0000 |
On Mon, 6 Mar 2023 at 14:10, Paolo Bonzini <pbonzini@redhat.com> wrote:
>
> On 3/6/23 14:38, Peter Maydell wrote:
> > On Fri, 3 Mar 2023 at 17:21, Paolo Bonzini <pbonzini@redhat.com> wrote:
> >>
> >> Ensure ordering between clearing the COMPUTING flag and checking
> >> IRQFACT, and between setting the IRQFACT flag and checking
> >> COMPUTING. This ensures that no wakeups are lost.
> >>
> >> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
> >
> > Why is this device even messing around with multiple
> > threads and atomics anyway ??
>
> Because it is an example of deferring device work to another thread,
> just like on real hardware it may be deferred to an on-device
> microcontroller or CPU.
If we want to be able to do that, we should probably have
infrastructure and higher-level primitives for it that
don't require device authors to be super-familiar with
QEMU's memory model and barriers... The fact there are only
half a dozen other uses of qemu_thread_create() under hw/
suggests that in practice we don't really need to do this
very often, though.
thanks
-- PMM
- Re: [PATCH 3/8] qemu-thread-win32: cleanup, fix, document QemuEvent, (continued)
- Re: [PATCH 3/8] qemu-thread-win32: cleanup, fix, document QemuEvent, Richard Henderson, 2023/03/05
- Re: [PATCH 3/8] qemu-thread-win32: cleanup, fix, document QemuEvent, David Hildenbrand, 2023/03/06
- Re: [PATCH 3/8] qemu-thread-win32: cleanup, fix, document QemuEvent, Paolo Bonzini, 2023/03/06
- Re: [PATCH 3/8] qemu-thread-win32: cleanup, fix, document QemuEvent, David Hildenbrand, 2023/03/06
- Re: [PATCH 3/8] qemu-thread-win32: cleanup, fix, document QemuEvent, Paolo Bonzini, 2023/03/06
[PATCH 4/8] edu: add smp_mb__after_rmw(), Paolo Bonzini, 2023/03/03
[PATCH 5/8] util/async: add smp_mb__after_rmw() around BH enqueue/dequeue, Paolo Bonzini, 2023/03/03
[PATCH 6/8] aio-wait: switch to smp_mb__after_rmw(), Paolo Bonzini, 2023/03/03
[PATCH 7/8] qemu-coroutine-lock: add smp_mb__after_rmw(), Paolo Bonzini, 2023/03/03