Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752340AbbBWREo (ORCPT ); Mon, 23 Feb 2015 12:04:44 -0500 Received: from casper.infradead.org ([85.118.1.10]:40951 "EHLO casper.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751832AbbBWREn (ORCPT ); Mon, 23 Feb 2015 12:04:43 -0500 Date: Mon, 23 Feb 2015 18:04:36 +0100 From: Peter Zijlstra To: Andi Kleen Cc: x86@kernel.org, linux-kernel@vger.kernel.org, Andi Kleen Subject: Re: [PATCH 1/3] x86: Move msr accesses out of line Message-ID: <20150223170436.GC5029@twins.programming.kicks-ass.net> References: <1424482737-958-1-git-send-email-andi@firstfloor.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1424482737-958-1-git-send-email-andi@firstfloor.org> User-Agent: Mutt/1.5.21 (2012-12-30) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1001 Lines: 23 On Fri, Feb 20, 2015 at 05:38:55PM -0800, Andi Kleen wrote: > This patch moves the MSR functions out of line. A MSR access is typically > 40-100 cycles or even slower, a call is a few cycles at best, so the > additional function call is not really significant. If I look at the below PDF a CALL+PUSH EBP+MOV RSP,RBP+ ... +POP+RET ends up being 5+1.5+0.5+ .. + 1.5+8 = 16.5 + .. cycles. ~16 is fairly significant on 40. And I figure people are working hard to make some MSR accesses cheaper, which means it'll be even worse in the future. Now I appreciate the intent for debuggability, but I don't think we can do this unconditionally. http://www.intel.com/content/www/us/en/architecture-and-technology/64-ia-32-architectures-optimization-manual.html -- 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/