[lkml]   [2008]   [Aug]   [7]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
SubjectRe: [ANNOUNCE] mdb-2.6.27-rc2-ia32-08-07-08.patch
> Stefan Richter wrote:
>> wrote:
> ...
>>> +typedef struct _RLOCK
>>> +{
>>> +#if defined(CONFIG_SMP)
>>> + spinlock_t lock;
>>> +#endif
>>> + unsigned long flags;
>>> + unsigned long processor;
>>> + unsigned long count;
>>> +} rlock_t;
> ...
>> The accessors rspin_lock() and rspin_try_lock() peek into spinlock_t and
>> may therefore not be fully portable. Also, they and rspin_unlock()
>> don't look SMP safe:
> ...
>>> + if (rlock->lock.raw_lock.slock && rlock->processor == proc)
> Correction: They _are_ not portable. Look at the first hit in
> .

OK. One more to fix. I have to be able to take nested page faults inside
the debugger in the event I am debugging a page fault handler or paging
event and someone's working set routine crashes.

rspin locks are for these types of cases -- so if I fault on the same
processor I took the lock on it just bumps a counter -- yes, it is atomic
and SMP safe to do it this way. You are correct that its non-portable
but the file this is in is named mdb-IA32 and is not meant as portable to
anything other than intel anyway.

As for coding style and misuse of a raw lock structure, I agree with you
completely, and I will look for a better way to do this without exposing
this structure.


> --
> Stefan Richter
> -=====-==--- =--- --===

 \ /
  Last update: 2008-08-07 18:19    [W:0.080 / U:1.572 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site