Re: [ANNOUNCE] mdb-2.6.27-rc2-ia32-08-07-08.patch

From: jmerkey
Date: Thu Aug 07 2008 - 12:55:11 EST


> jmerkey@xxxxxxxxxxxxxxxxxxxxx wrote:
>> 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.
>
> Only if all contexts which take rlocks are not preemptible. Which I
> don't know whether they are; I'm just a driver guy. You use
> spin_lock_irqsave() rather than plain spin_lock() though, which
> indicates that you want to be able to take the locks from preemptible
> contexts too. In that case, your accessors are subtly buggy.
> --
> Stefan Richter
> -=====-==--- =--- --===
> http://arcgraph.de/sr/
>

check mdb-main.c -- I disable preemption before rspin_lock is attempted.
Since the only processor which sets the proc number does do inside the
spin lock, and the other processors only read it, unless memory is
corrupted or the machine is severely broken, its SMP safe to this.

I use the debug_lock rspin_lock to prevent the other processors from
entering the debugger command console when one of them has the console...

Jeff

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/