[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH v6 1/8] atomic: introduce atomic operations
From: |
Paolo Bonzini |
Subject: |
Re: [Qemu-devel] [PATCH v6 1/8] atomic: introduce atomic operations |
Date: |
Tue, 13 Nov 2012 05:11:53 -0500 (EST) |
> > Il 05/11/2012 06:38, Liu Ping Fan ha scritto:
> > > From: Liu Ping Fan <address@hidden>
> > >
> > > If out of global lock, we will be challenged by SMP in low level,
> > > so need atomic ops.
> > >
> > > This file is a wrapper of GCC atomic builtin.
> >
> > I still object to this.
> >
> > I know it enforces type-safety, but it is incomplete. It doesn't
>
> Although it is incomplete, but the rest cases are rarely used. Linux
> faces such issue, and the "int" version is enough, so I think we can
> borrow experience from there.
One of the two places that use __sync_* require 64-bit accesses. My
RCU prototype required pointer-sized access, which you cannot make type-
safe without C++ templates.
> > provide neither atomic accesses to pointers, nor useful operations such
> > as exchange. It won't be used consistently, because in some places you
> > just do not have an Atomic value (see both current uses of __sync_*
> > builtins).
> >
> > If you can make it complete, and prove it by using it where
> > __sync_* is
>
> For current code, __sync_* is used rarely, I think except the
> barriers, only two places use it. We can substitute it easily.
No, you cannot. See above, one doesn't use ints and the other is
guest state so migration becomes complicated if you use Atomic. I'm
happy to be proven wrong, however.
Paolo
- Re: [Qemu-devel] [PATCH v6 1/8] atomic: introduce atomic operations, (continued)
- Re: [Qemu-devel] [PATCH v6 1/8] atomic: introduce atomic operations, liu ping fan, 2012/11/13
- Re: [Qemu-devel] [PATCH v6 1/8] atomic: introduce atomic operations, Paolo Bonzini, 2012/11/13
- Re: [Qemu-devel] [PATCH v6 1/8] atomic: introduce atomic operations, liu ping fan, 2012/11/14
- Re: [Qemu-devel] [PATCH v6 1/8] atomic: introduce atomic operations, Paolo Bonzini, 2012/11/14
- Re: [Qemu-devel] [PATCH v6 1/8] atomic: introduce atomic operations, liu ping fan, 2012/11/15
- Re: [Qemu-devel] [PATCH v6 1/8] atomic: introduce atomic operations, Paolo Bonzini, 2012/11/15
- Re: [Qemu-devel] [PATCH v6 1/8] atomic: introduce atomic operations, Richard Henderson, 2012/11/15
- Re: [Qemu-devel] [PATCH v6 1/8] atomic: introduce atomic operations, liu ping fan, 2012/11/21
- Re: [Qemu-devel] [PATCH v6 1/8] atomic: introduce atomic operations, Avi Kivity, 2012/11/18
- Re: [Qemu-devel] [PATCH v6 1/8] atomic: introduce atomic operations, liu ping fan, 2012/11/21
- Re: [Qemu-devel] [PATCH v6 1/8] atomic: introduce atomic operations,
Paolo Bonzini <=
[Qemu-devel] [PATCH v6 2/8] qom: apply atomic on object's refcount, Liu Ping Fan, 2012/11/05
[Qemu-devel] [PATCH v6 3/8] hotplug: introduce qdev_unplug_complete() to remove device from views, Liu Ping Fan, 2012/11/05
[Qemu-devel] [PATCH v6 4/8] pci: remove pci device from mem view when unplug, Liu Ping Fan, 2012/11/05
[Qemu-devel] [PATCH v6 5/8] memory: introduce local lock for address space, Liu Ping Fan, 2012/11/05
[Qemu-devel] [PATCH v6 6/8] memory: make mmio dispatch able to be out of biglock, Liu Ping Fan, 2012/11/05
[Qemu-devel] [PATCH v6 8/8] vcpu: push mmio dispatcher out of big lock, Liu Ping Fan, 2012/11/05
[Qemu-devel] [PATCH v6 7/8] memory: introduce tls context to trace nested mmio request issue, Liu Ping Fan, 2012/11/05