From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756727AbbLDWkL (ORCPT ); Fri, 4 Dec 2015 17:40:11 -0500 Received: from terminus.zytor.com ([198.137.202.10]:38988 "EHLO mail.zytor.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751582AbbLDWkJ (ORCPT ); Fri, 4 Dec 2015 17:40:09 -0500 User-Agent: K-9 Mail for Android In-Reply-To: <20151204221446.GK17308@twins.programming.kicks-ass.net> References: <1449167222-17562-1-git-send-email-bp@alien8.de> <20151204074206.GB24827@gmail.com> <20151204082256.GC17308@twins.programming.kicks-ass.net> <20151204095102.768764b9@icelake> <20151204221446.GK17308@twins.programming.kicks-ass.net> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset=UTF-8 Subject: Re: [PATCH] x86/rapl: Do not load in a guest From: "H. Peter Anvin" Date: Fri, 04 Dec 2015 14:39:26 -0800 To: Peter Zijlstra , Jacob Pan CC: Ingo Molnar , Borislav Petkov , Amy Wiles , "Rafael J. Wysocki" , LKML , Arnaldo Carvalho de Melo , Ingo Molnar , Thomas Gleixner Message-ID: <1142766D-212C-47CF-8400-89616715BCF8@zytor.com> Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On December 4, 2015 2:14:46 PM PST, Peter Zijlstra wrote: >On Fri, Dec 04, 2015 at 09:51:02AM -0800, Jacob Pan wrote: >> On Fri, 4 Dec 2015 09:22:56 +0100 >> Peter Zijlstra wrote: >> >> > Also, yuck @ powercap/intel_rapl.c for doing rdmsr_on_cpu() + >> > wrmsr_on_cpu() all over the place. >> Can you please be more specific? is the concern related to the >> overhead of IPI? I am doing these calls based on MSR CPU scope and >> consider the fact that access is less frequent. > >Yeah, its just offensive to do an IPI to read a value, then twiddle a >few bits on the value and then IPI again to store the value. > >I know its low freq, and that MSR access is slow, but *groan*. Yes, for that it would be better to invoke a common routine to do all the accesses on the target CPU. MSR accesses may be slow, but IPIs are way slower. -- Sent from my Android device with K-9 Mail. Please excuse brevity and formatting.