RE: [PATCH 1/7] Add die_spin_lock_{irqsave,irqrestore}

2015-02-24 Thread David Laight
From: Ingo Molnar ... > So why not trylock and time out here after a few seconds, > instead of indefinitely supressing some potentially vital > output due to some other CPU crashing/locking with the lock > held? I've used that for status requests that usually lock a table to get a consistent

RE: [PATCH 1/7] Add die_spin_lock_{irqsave,irqrestore}

2015-02-24 Thread David Laight
From: Ingo Molnar ... So why not trylock and time out here after a few seconds, instead of indefinitely supressing some potentially vital output due to some other CPU crashing/locking with the lock held? I've used that for status requests that usually lock a table to get a consistent view. If

Re: [PATCH 1/7] Add die_spin_lock_{irqsave,irqrestore}

2015-02-23 Thread Ingo Molnar
* Ingo Molnar wrote: > > * Anton Blanchard wrote: > > > +static arch_spinlock_t die_lock = __ARCH_SPIN_LOCK_UNLOCKED; > > +static int die_owner = -1; > > +static unsigned int die_nest_count; > > + > > +unsigned long __die_spin_lock_irqsave(void) > > +{ > > + unsigned long flags; > > +

Re: [PATCH 1/7] Add die_spin_lock_{irqsave,irqrestore}

2015-02-23 Thread Ingo Molnar
* Anton Blanchard wrote: > +static arch_spinlock_t die_lock = __ARCH_SPIN_LOCK_UNLOCKED; > +static int die_owner = -1; > +static unsigned int die_nest_count; > + > +unsigned long __die_spin_lock_irqsave(void) > +{ > + unsigned long flags; > + int cpu; > + > + /* racy, but better

Re: [PATCH 1/7] Add die_spin_lock_{irqsave,irqrestore}

2015-02-23 Thread Ingo Molnar
* Ingo Molnar mi...@kernel.org wrote: * Anton Blanchard an...@samba.org wrote: +static arch_spinlock_t die_lock = __ARCH_SPIN_LOCK_UNLOCKED; +static int die_owner = -1; +static unsigned int die_nest_count; + +unsigned long __die_spin_lock_irqsave(void) +{ + unsigned long

Re: [PATCH 1/7] Add die_spin_lock_{irqsave,irqrestore}

2015-02-23 Thread Ingo Molnar
* Anton Blanchard an...@samba.org wrote: +static arch_spinlock_t die_lock = __ARCH_SPIN_LOCK_UNLOCKED; +static int die_owner = -1; +static unsigned int die_nest_count; + +unsigned long __die_spin_lock_irqsave(void) +{ + unsigned long flags; + int cpu; + + /* racy, but