Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932980AbXHVSVG (ORCPT ); Wed, 22 Aug 2007 14:21:06 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1762710AbXHVSUy (ORCPT ); Wed, 22 Aug 2007 14:20:54 -0400 Received: from smtp2.linux-foundation.org ([207.189.120.14]:47621 "EHLO smtp2.linux-foundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1759541AbXHVSUx (ORCPT ); Wed, 22 Aug 2007 14:20:53 -0400 Date: Wed, 22 Aug 2007 11:20:02 -0700 (PDT) From: Linus Torvalds To: Segher Boessenkool cc: Chris Snook , Hirokazu Takata , "Robert P. J. Day" , paulmck@linux.vnet.ibm.com, linux-kernel@vger.kernel.org, "Luck, Tony" , akpm@linux-foundation.org, linux-arch@vger.kernel.org, Chris Friesen Subject: Re: [PATCH 11/23] make atomic_read() and atomic_set() behavior consistent on m32r In-Reply-To: <8fc86c23579e12b012891d6e69b1b107@kernel.crashing.org> Message-ID: References: <46C03885.7000109@redhat.com> <20070813112452.GK24018@shell.boston.redhat.com> <46CC42EF.3030602@redhat.com> <8fc86c23579e12b012891d6e69b1b107@kernel.crashing.org> 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: 1382 Lines: 40 On Wed, 22 Aug 2007, Segher Boessenkool wrote: > > > I also tried to rewrite it with inline asm code, but the kernel text size > > > bacame roughly 2kB larger. So, I prefer C version. > > Could you send me the source code diff between the two versions > you tested? 2kB difference is way too much, the asm version should > be smaller if anything. Segher, can you please drop out of this discussion? Your points are all wrong. The inline asm version has the EXACT SAME PROBLEM as the "volatile" version has: it means that the compiler is unable to combine trivial instructions. There's no way that is acceptable. So why the *hell* you'd expect the asm version to be smaller, I can't imagine. It's obvkously not going to be true. So here's a clue to everybody in this thread: THE CURRENT x86 BEHAVIOUR IS THE CORRECT ONE where we don't have any "volatile" and no inline asm and no barriers, and we let the compiler do the right thing. If the code needs barriers, the code should damn well add them. It's worked for the past 8 months, on the most common platform there is. Stop this *idiotic* thread already. Linus - 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/