Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id ; Mon, 17 Feb 2003 09:25:27 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id ; Mon, 17 Feb 2003 09:24:25 -0500 Received: from modemcable092.130-200-24.mtl.mc.videotron.ca ([24.200.130.92]:25550 "EHLO montezuma.mastecende.com") by vger.kernel.org with ESMTP id ; Mon, 17 Feb 2003 09:23:29 -0500 Date: Mon, 17 Feb 2003 09:31:38 -0500 (EST) From: Zwane Mwaikambo X-X-Sender: zwane@montezuma.mastecende.com To: Ivan Kokshaysky cc: Richard Henderson , Linux Kernel , Linus Torvalds Subject: Re: [PATCH][2.5] Protect smp_call_function_data w/ spinlocks on Alpha In-Reply-To: <20030217172319.A1161@jurassic.park.msu.ru> Message-ID: References: <20030214175332.A19234@jurassic.park.msu.ru> <20030217001544.A13101@twiddle.net> <20030217172319.A1161@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: 1060 Lines: 27 On Mon, 17 Feb 2003, Ivan Kokshaysky wrote: > On Mon, Feb 17, 2003 at 03:32:09AM -0500, Zwane Mwaikambo wrote: > > Assigns whatever the pointer happens to be at the time, be it NULL or the > > next incoming message call. > > No, the pointer is guaranteed to be valid. > > > Therefore we'd need a lock to protect both the variable and critical > > section. > > But smp_call_function_data pointer itself is exactly such a lock - > other CPUs can't enter the section between 'if (pointer_lock())' and > 'smp_call_function_data = 0', so there is no need for extra lock > variable. Additionally, pointer_lock() with retry = 0 acts as spin_trylock. Oh my mistake i thought you were talking about atomic assignment and not blocking at that point. I misunderstood what you stated. 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/