Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S281009AbUKBDMJ (ORCPT ); Mon, 1 Nov 2004 22:12:09 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S267382AbUKAW7s (ORCPT ); Mon, 1 Nov 2004 17:59:48 -0500 Received: from fw.osdl.org ([65.172.181.6]:16314 "EHLO mail.osdl.org") by vger.kernel.org with ESMTP id S274216AbUKAVqh (ORCPT ); Mon, 1 Nov 2004 16:46:37 -0500 Date: Mon, 1 Nov 2004 13:46:22 -0800 (PST) From: Linus Torvalds To: linux-os@analogic.com cc: dean gaudet , Andreas Steinmetz , Kernel Mailing List , Richard Henderson , Andi Kleen , Andrew Morton , Jan Hubicka Subject: Re: Semaphore assembly-code bug In-Reply-To: Message-ID: References: <417550FB.8020404@drdos.com> <1098218286.8675.82.camel@mentorng.gurulabs.com> <41757478.4090402@drdos.com> <20041020034524.GD10638@michonline.com> <1098245904.23628.84.camel@krustophenia.net> <1098247307.23628.91.camel@krustophenia.net> <41826A7E.6020801@domdv.de> 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: 1276 Lines: 28 On Mon, 1 Nov 2004, Linus Torvalds wrote: > > So can you _please_ just admit that you were wrong? On a P4, the pop/pop > is the same cost as lea/pop, and on a Pentium M the pop/pop is faster, > according to this test. Your contention that "pop" has to be slower than > "lea" is WRONG. Btw, I'd like to emphasize "this test". Modern OoO CPU's are complex animals. They have pipeline quirks etc that just means that things depend on alignment, on code around it, and on register usage patterns of the instructions that you test _and_ the instructions around those instructions. So take any proof with a pinch of salt, because there are bound to be other circumstances where factors around the code just change the assumptions. In short, any time you're looking at single cycle timings, you should be very aware of the fact that your measurements are suspect. The best way to avoid most of the problem is to never try to measure single cycles. Measure performance on a program, not on a single instruction. 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/