[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Xen-devel] [PATCH v3] xen/common: Properly reference count DOMCTL_{, un}pausedomain hypercalls



On 02/07/14 17:06, Jan Beulich wrote:
>>>> On 02.07.14 at 17:41, <andrew.cooper3@xxxxxxxxxx> wrote:
>> On 02/07/14 16:29, Jan Beulich wrote:
>>>>>> On 02.07.14 at 17:03, <andrew.cooper3@xxxxxxxxxx> wrote:
>>>> --- a/xen/include/xen/sched.h
>>>> +++ b/xen/include/xen/sched.h
>>>> @@ -366,7 +366,7 @@ struct domain
>>>>      /* Is this guest dying (i.e., a zombie)? */
>>>>      enum { DOMDYING_alive, DOMDYING_dying, DOMDYING_dead } is_dying;
>>>>      /* Domain is paused by controller software? */
>>>> -    bool_t           is_paused_by_controller;
>>>> +    atomic_t         controller_pause_count;
>>>>      /* Domain's VCPUs are pinned 1:1 to physical CPUs? */
>>>>      bool_t           is_pinned;
>>>>  
>>> Now why did you leave this be an atomic_t, sitting between two
>>> bool_t-s?
>> It is not sitting between two bool_t's.  It is sitting next to an enum
>> which has the same natural width and alignment.
> Oh, right, the first one is being replaced.
>
> But you didn't say why it need to be an atomic_t, while in v1 it was a
> plain scalar.
>
> Jan
>

v1 was a plain scalar because of the spinlock.  v2 was an atomic_t
because of atomic_{inc,dec}_bounded()

But given the hand rolled loops with cmpxchg(), this can indeed be a
plan scalar.

v4 on its way.

~Andrew

_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxx
http://lists.xen.org/xen-devel


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.