From: Srivatsa Vaddagiri Subject: Re: [PATCH 04/20] x86/ticketlock: make large and small ticket versions of spin_lock the same Date: Fri, 12 Nov 2010 17:49:32 +0530 Message-ID: <20101112121932.GA30016@linux.vnet.ibm.com> References: <5b3cbff3a6e96a085651f140a0525be80a4df8ba.1288794124.git.jeremy.fitzhardinge@citrix.com> Reply-To: vatsa@linux.vnet.ibm.com Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Return-path: Content-Disposition: inline In-Reply-To: <5b3cbff3a6e96a085651f140a0525be80a4df8ba.1288794124.git.jeremy.fitzhardinge@citrix.com> Sender: linux-kernel-owner@vger.kernel.org To: Jeremy Fitzhardinge Cc: Peter Zijlstra , Linux Kernel Mailing List , Nick Piggin , Jan Beulich , Avi Kivity , Xen-devel , "H. Peter Anvin" , Linux Virtualization , Jeremy Fitzhardinge List-Id: xen-devel@lists.xenproject.org On Wed, Nov 03, 2010 at 10:59:45AM -0400, Jeremy Fitzhardinge wrote: > Make the bulk of __ticket_spin_lock look identical for large and small > number of cpus. [snip] > #if (NR_CPUS < 256) > static __always_inline void __ticket_spin_lock(arch_spinlock_t *lock) > { > - register union { > - struct __raw_tickets tickets; > - unsigned short slock; > - } inc = { .slock = 1 << TICKET_SHIFT }; > + register struct __raw_tickets inc = { .tail = 1 }; [snip] > #else > static __always_inline void __ticket_spin_lock(arch_spinlock_t *lock) > { > - unsigned inc = 1 << TICKET_SHIFT; > - __ticket_t tmp; > + register struct __raw_tickets inc = { .tickets.tail = 1 }; s/.tickets//? Otherwise I get a compile error for NR_CPUS > 256, with just 4 patches applied. - vatsa