From mboxrd@z Thu Jan 1 00:00:00 1970 From: Jennifer Herbert Subject: Re: [PATCHv1 3/4] spinlock: shrink struct lock_debug Date: Tue, 19 Jan 2016 12:31:25 +0000 Message-ID: <569E2C9D.2040901@citrix.com> References: <1450447746-9305-1-git-send-email-david.vrabel@citrix.com> <1450447746-9305-4-git-send-email-david.vrabel@citrix.com> <5674495102000078000C169A@prv-mh.provo.novell.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii"; Format="flowed" Content-Transfer-Encoding: 7bit Return-path: Received: from mail6.bemta5.messagelabs.com ([195.245.231.135]) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1aLVPC-0002ud-2c for xen-devel@lists.xenproject.org; Tue, 19 Jan 2016 12:29:02 +0000 In-Reply-To: <5674495102000078000C169A@prv-mh.provo.novell.com> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: Jan Beulich , David Vrabel Cc: xen-devel@lists.xenproject.org, Ian Campbell List-Id: xen-devel@lists.xenproject.org On 18/12/15 16:58, Jan Beulich wrote: >>>> On 18.12.15 at 15:09, wrote: >> --- a/xen/common/spinlock.c >> +++ b/xen/common/spinlock.c >> @@ -16,7 +16,7 @@ static atomic_t spin_debug __read_mostly = ATOMIC_INIT(0); >> >> static void check_lock(struct lock_debug *debug) >> { >> - int irq_safe = !local_irq_is_enabled(); >> + s16 irq_safe = !local_irq_is_enabled(); >> >> if ( unlikely(atomic_read(&spin_debug) <= 0) ) >> return; > I can't figure out why this odd looking change is needed. > > Jan > This patch shrinks struct lock_debug's irq_safe member. Since you end up with many instances of this embedded in other structures such as struct domain, this become a useful saving in memory. At one point, I had an issue with struct domain exceeding 4k, which caused trouble. Given the change to struct_lock debug, this local variable irq_safe, is compared with it, and used in cmpxchg with it it, and therefore should match type. - Jenny