Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id ; Fri, 14 Feb 2003 12:08:01 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id ; Fri, 14 Feb 2003 12:08:01 -0500 Received: from modemcable092.130-200-24.mtl.mc.videotron.ca ([24.200.130.92]:33889 "EHLO montezuma.mastecende.com") by vger.kernel.org with ESMTP id ; Fri, 14 Feb 2003 12:08:00 -0500 Date: Fri, 14 Feb 2003 12:16:12 -0500 (EST) From: Zwane Mwaikambo X-X-Sender: zwane@montezuma.mastecende.com To: Ivan Kokshaysky cc: Linux Kernel , Richard T Henderson , Linus Torvalds Subject: Re: [PATCH][2.5] Protect smp_call_function_data w/ spinlocks on Alpha In-Reply-To: <20030214175332.A19234@jurassic.park.msu.ru> Message-ID: References: <20030214175332.A19234@jurassic.park.msu.ru> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: linux-kernel-owner@vger.kernel.org X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1287 Lines: 30 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/