lkml.org 
[lkml]   [2003]   [Feb]   [14]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH][2.5] Protect smp_call_function_data w/ spinlocks on Alpha
On Fri, 14 Feb 2003, Ivan Kokshaysky wrote:

> On Fri, Feb 14, 2003 at 06:51:54AM -0500, Zwane Mwaikambo wrote:
> > This is an untested patch to remove the custom mutex, however it
> > doesn't maintain the same semantics wrt 'retry' and unconditionally
> > blocks on contention.
>
> Why do you want to remove it? The critical data here is a single pointer
> which can be effectively protected without spinlock.

Ok the reason being is that the lock not only protects the
smp_call_function_data pointer but also acts as a lock for that critical
section. Without it you'll constantly be overwriting the pointer halfway
through IPI acceptance (or even worse whilst a remote CPU is assigning the
data members).

Although i'm not denying there isn't a way to do this lockless, i believe
what some architectures did was poll on the pointer then do an assignment
which i think is a bit too much effort when using a spinlock is much
saner. Regardless i'd be interested to hear about alternatives.

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

\
 
 \ /
  Last update: 2005-03-22 13:33    [W:0.068 / U:5.796 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site