lkml.org 
[lkml]   [2010]   [Nov]   [12]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH 04/20] x86/ticketlock: make large and small ticket versions of spin_lock the same
On 11/12/2010 04:19 AM, Srivatsa Vaddagiri wrote:
> 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.

Yeah, likely. That's precisely why I wanted to make them the same ;).

J


\
 
 \ /
  Last update: 2010-11-12 17:29    [W:0.087 / U:0.196 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site