lkml.org 
[lkml]   [2014]   [Jan]   [29]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
SubjectRe: BUG: spinlock lockup
From
Dear Will,


Thanks for your input. We debug by adding print as below and found
very big value difference between next and owner(more then 1000). So
it seams memory corruption.



linux/lib/spinlock_debug.c

msg, raw_smp_processor_id(),
current->comm, task_pid_nr(current));
printk(KERN_EMERG " lock: %pS, .magic: %08x, .owner: %s/%d, "
- ".owner_cpu: %d\n",
+ ".owner_cpu: %d raw_lock.tickets.next %u raw_lock.tickets.owner %u \n",
lock, lock->magic,
owner ? owner->comm : "<none>",
owner ? task_pid_nr(owner) : -1,
- lock->owner_cpu);
+ lock->owner_cpu,
+ lock->raw_lock.tickets.next,
+ lock->raw_lock.tickets.owner);
dump_stack();
}


I have one request, is it possible to change like below, if any
corruption, it is easy to debug .
if magic is corrupt, we can find quickly.

typedef struct raw_spinlock {

#ifdef CONFIG_DEBUG_SPINLOCK
unsigned int magic, owner_cpu;
void *owner;
#endif

arch_spinlock_t raw_lock;
#ifdef CONFIG_GENERIC_LOCKBREAK
unsigned int break_lock;
#endif
#ifdef CONFIG_DEBUG_LOCK_ALLOC
struct lockdep_map dep_map;
#endif
} raw_spinlock_t;

So if this structure got corrupt,
On Tue, Jan 21, 2014 at 3:44 PM, Will Deacon <will.deacon@arm.com> wrote:
> On Tue, Jan 21, 2014 at 06:37:31AM +0000, naveen yadav wrote:
>> Thanks for your reply,
>>
>> We are using Cortex A15.
>> yes, this is with ticket lock.
>>
>> We will check value of arch_spinlock_t and share it. It is bit
>> difficult to reproduce this scenario.
>>
>> If you have some idea ,please suggest how to reproduce it.
>
> You could try enabling lockdep and see if it catches anything earlier
> on.
>
> Will


\
 
 \ /
  Last update: 2014-01-29 12:41    [W:0.042 / U:0.736 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site