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

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

2015-02-23 Thread Anton Blanchard
Many architectures have their own oops locking code that allows the lock to be taken recursively. Create a common version. Avoid creating generic locking functions, so they can't be abused in other parts of the kernel. Signed-off-by: Anton Blanchard an...@samba.org --- include/linux/die_lock.h

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