Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id ; Mon, 29 Jul 2002 08:05:02 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id ; Mon, 29 Jul 2002 08:05:02 -0400 Received: from dell-paw-3.cambridge.redhat.com ([195.224.55.237]:21233 "EHLO executor.cambridge.redhat.com") by vger.kernel.org with ESMTP id ; Mon, 29 Jul 2002 08:05:02 -0400 To: Roman Zippel Cc: David Howells , Christoph Hellwig , "Adam J. Richter" , linux-kernel@vger.kernel.org Subject: Re: Patch: linux-2.5.29 __downgrade_write() for CONFIG_RWSEM_GENERIC_SPINLOCK In-Reply-To: Message from Roman Zippel of "Mon, 29 Jul 2002 13:42:38 +0200." User-Agent: EMH/1.14.1 SEMI/1.14.3 (Ushinoya) FLIM/1.14.3 (=?ISO-8859-4?Q?Unebigory=F2mae?=) APEL/10.3 Emacs/21.2 (i386-redhat-linux-gnu) MULE/5.0 (SAKAKI) MIME-Version: 1.0 (generated by SEMI 1.14.3 - "Ushinoya") Content-Type: text/plain; charset=US-ASCII Date: Mon, 29 Jul 2002 13:08:22 +0100 Message-ID: <28935.1027944502@warthog.cambridge.redhat.com> From: David Howells Sender: linux-kernel-owner@vger.kernel.org X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1221 Lines: 31 Roman Zippel > > It doesn't appear to make any difference which way it is done. The i386 > > code from both looks the same. > > Then I vote for the simpler version. :) Maybe... I've got a patch for that variation too. > BTW even if gcc had problems optimizing that, I'd rather make it explicit, > that the two variables contain the same information: > > activity = sem->activity = 0; > if (!list_empty(&sem->wait_list)) > sem = __rwsem_do_wake(sem, activity); > > IMO that's more readable and will still work if gcc had to flush the > cached information before using it. Brrr... I don't like that. If I'm going to pass in a second argument, then I want it to be what Christoph's version because it's more readable and more obvious what it's doing (and, since the value is constant, the optimiser can obviously get rid of it easily). I don't think gcc is going to be a problem in that respect since the activity member is not volatile. David - 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/