From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757939AbYDAN1T (ORCPT ); Tue, 1 Apr 2008 09:27:19 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1754615AbYDAN1J (ORCPT ); Tue, 1 Apr 2008 09:27:09 -0400 Received: from one.firstfloor.org ([213.235.205.2]:33854 "EHLO one.firstfloor.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752937AbYDAN1I (ORCPT ); Tue, 1 Apr 2008 09:27:08 -0400 Date: Tue, 1 Apr 2008 15:30:53 +0200 From: Andi Kleen To: Jiri Kosina Cc: Andi Kleen , Ingo Molnar , linux-kernel@vger.kernel.org Subject: Re: spinlocks -- why are releases inlined and acquires are not? Message-ID: <20080401133053.GJ29105@one.firstfloor.org> References: <20080401083359.GB32272@elte.hu> <874pal25iu.fsf@basil.nowhere.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.4.2.1i Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Apr 01, 2008 at 02:40:49PM +0200, Jiri Kosina wrote: > On Tue, 1 Apr 2008, Andi Kleen wrote: > > > At some point -- but that was before queued locks -- I noticed that for > > i386 spin unlocks the call sequence for the sub function is actually > > larger in code than the actual spin unlock operation and for x86-64 it > > was about the same. > > spin unlocks seem to be properly inlined anyway, so that should be fine. > My concern here is the non-inlining of spin locks, for which I don't think > your argument above is also valid, right? When I did the original numbers (again before queued locks) the call was slightly shorter than the actual spin lock operation. This was not counting register allocator effects though which are difficult to measure generally. -Andi