From: "Jan Beulich" Subject: Re: [PATCH] xen/common: Properly reference count DOMCTL_{, un}pausedomain hypercalls Date: Wed, 02 Jul 2014 10:15:41 +0100 Message-ID: <53B3E9DE020000780001F5DC@mail.emea.novell.com> References: <1404244655-31891-1-git-send-email-andrew.cooper3@citrix.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <1404244655-31891-1-git-send-email-andrew.cooper3@citrix.com> Content-Disposition: inline List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: Andrew Cooper Cc: Keir Fraser , Tim Deegan , StefanoStabellini , Ian Campbell , Xen-devel List-Id: xen-devel@lists.xenproject.org >>> On 01.07.14 at 21:57, wrote: > --- a/xen/include/xen/sched.h > +++ b/xen/include/xen/sched.h > @@ -365,8 +365,6 @@ struct domain > bool_t debugger_attached; > /* 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; > /* Domain's VCPUs are pinned 1:1 to physical CPUs? */ > bool_t is_pinned; > > @@ -389,6 +387,10 @@ struct domain > > atomic_t pause_count; > > + /* Domain is paused by controller software? */ > + spinlock_t toolstack_pause_lock; > + unsigned int toolstack_pause_count; I think I like "controller" better than "toolstack" here, and I even wonder whether the old name, just stripped of the "is_", couldn't remain. And I also like Don's cmpxchg suggestion, avoiding the need for a lock - we're doing this kind of lock avoidance in various other places already anyway. Jan