Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id ; Fri, 10 Jan 2003 07:29:06 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id ; Fri, 10 Jan 2003 07:29:06 -0500 Received: from pc2-cwma1-4-cust86.swan.cable.ntl.com ([213.105.254.86]:61841 "EHLO irongate.swansea.linux.org.uk") by vger.kernel.org with ESMTP id ; Fri, 10 Jan 2003 07:29:05 -0500 Subject: Re: spin_locks without smp. From: Alan Cox To: William Lee Irwin III Cc: Maciej Soltysiak , Linux Kernel Mailing List In-Reply-To: <20030110114546.GN23814@holomorphy.com> References: <20030110114546.GN23814@holomorphy.com> Content-Type: text/plain Content-Transfer-Encoding: 7bit Organization: Message-Id: <1042205036.28469.78.camel@irongate.swansea.linux.org.uk> Mime-Version: 1.0 X-Mailer: Ximian Evolution 1.2.1 (1.2.1-2) Date: 10 Jan 2003 13:23:56 +0000 Sender: linux-kernel-owner@vger.kernel.org X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 894 Lines: 23 On Fri, 2003-01-10 at 11:45, William Lee Irwin III wrote: > On Fri, Jan 10, 2003 at 12:42:34PM +0100, Maciej Soltysiak wrote: > > while browsing through the network drivers about the etherleak issue i > > found that some drivers have: > > #ifdef CONFIG_SMP > > spin_lock_irqsave(...) > > #endif > > and some just: > > spin_lock_irqsave(...) > > or similar. > > Which version should be practiced? i thought spinlocks are irrelevant > > without SMP so we should use #ifdef to shorten the execution path. > > Buggy on preempt. Remove the #ifdef And render the driver unusable. Very clever. How about understanding *why* something was done first 8) - 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/