Received: by 2002:ac0:bc90:0:0:0:0:0 with SMTP id a16csp760632img; Fri, 22 Mar 2019 08:03:14 -0700 (PDT) X-Google-Smtp-Source: APXvYqw2BRA1cX5tgnC5CYQcpF06jZfLaUhf8nM0NpSDR9gEcLXIzdJrIrw1bD5z3zNjCGWM7P0J X-Received: by 2002:a63:d158:: with SMTP id c24mr9246592pgj.34.1553266994853; Fri, 22 Mar 2019 08:03:14 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1553266994; cv=none; d=google.com; s=arc-20160816; b=IT3vQQJM8SF6DwzahqDBOx6K3HdXVIHjfdw1Z3Jf1BzyQaevpVdaZTnIfV5pAhFz8H rfOnMJL1nZQEcXV6TsCRh+AaIkiKquECSN5/7fiLdKw6ksHrDKkFEn3j8HPTVLhAOFOT ti3kfoTnGAsEfP5tyV7ehpeAeATRQfZVDJ9PIJhLA1JQgKoK5IKxyTWoMranDfpKdZe1 cT6Y9TCi1zEHjb73cBvmPZZe+BZnO+lbnUj/+Z0Oe/vPKKCRX1PvQouuYmRg8f0yDUna 6/JZmQjLweEGicJdyiZsxvFj6B/rXnJvgUk5DlNaP2YO9OIb+C0tmh69Rlhwtt7ieD78 bJTQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=dYjCVcv6V5v51cbzYdQl2UO0Sx67KxhRWRVbVYjb8Wc=; b=XLTMI7J8sYRpA82OdBJtjB6h/agzp7AWiZmz+szjZUOx1f8uu1m5kXAS3tux/CR8wB +hKkVGqmqP7ridz6VrWVMT473cs5cPd73Q/f11cHOBswtO6AwwyUhLuCCKyHRcBwiA4R 4iNaA0UVPuBhv6a3FOEjRnt82S6oD4nmX/ICF8835D/AlBanFgOdjNn2sGrKDqiBatGH op5/LRJsSIaLDtrwNqmcg4Mn0gxFKE6fhAryoHGH2dqJ+eemhW2TKRETaGjZJCeflN6Z re2lKhYFu5EjCuTho9cDK5yCte4YKbj0XhcwHV+U/I24op0ylB6TmQW80r90ZquhrfuY ULtg== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@infradead.org header.s=merlin.20170209 header.b=0FE4OOn2; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id k1si7105503pls.208.2019.03.22.08.02.59; Fri, 22 Mar 2019 08:03:14 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=fail header.i=@infradead.org header.s=merlin.20170209 header.b=0FE4OOn2; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729477AbfCVPAW (ORCPT + 99 others); Fri, 22 Mar 2019 11:00:22 -0400 Received: from merlin.infradead.org ([205.233.59.134]:48746 "EHLO merlin.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729129AbfCVPAW (ORCPT ); Fri, 22 Mar 2019 11:00:22 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=merlin.20170209; h=In-Reply-To:Content-Type:MIME-Version: References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=dYjCVcv6V5v51cbzYdQl2UO0Sx67KxhRWRVbVYjb8Wc=; b=0FE4OOn29jCGsibK0eOvjADdg V7+Yom5ubyTxHfy2Dcf2fUCVB57MT9GnPxv8DCvR4+jLz/c66LO1G2KsiJeSvp2n6O/6A0qwX7lUt hOnlCaVRhLTFV5o2NMYwOv0xKrapTpzSMvkCg2YmTWWme1gQP8YuPHWH2hNw2oRmz0dQngNLRVt8h BZSa7n1sB0/cgrF8rkrc0xBMxGVFYX89BOOsBI62kQtxWQuH9grMu3Up6UzYejV5sNuZ5jKdUY5H4 k1RKEHQle4cgznGwq6/I7WBKrILD9sio1sqpCbPTuKk16gqebqWct98l52gOJiWYAvZBaZx4Qcjuv uMfK6fHhw==; Received: from j217100.upc-j.chello.nl ([24.132.217.100] helo=hirez.programming.kicks-ass.net) by merlin.infradead.org with esmtpsa (Exim 4.90_1 #2 (Red Hat Linux)) id 1h7LeU-0002Ou-W8; Fri, 22 Mar 2019 15:00:11 +0000 Received: by hirez.programming.kicks-ass.net (Postfix, from userid 1000) id 72E99287233CD; Fri, 22 Mar 2019 16:00:09 +0100 (CET) Date: Fri, 22 Mar 2019 16:00:09 +0100 From: Peter Zijlstra To: "Rafael J. Wysocki" Cc: x86 , LKML , Len Brown , Linux PM , Srinivas Pandruvada , Laura Abbott , Thomas Gleixner , Ingo Molnar , Simon Schricker , Borislav Petkov , Hannes Reinecke Subject: Re: [PATCH 2/2] PM / arch: x86: MSR_IA32_ENERGY_PERF_BIAS sysfs interface Message-ID: <20190322150009.GY6058@hirez.programming.kicks-ass.net> References: <1637073.gl2OfxWTjI@aspire.rjw.lan> <1762575.ER2xjzr9E1@aspire.rjw.lan> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1762575.ER2xjzr9E1@aspire.rjw.lan> User-Agent: Mutt/1.10.1 (2018-07-13) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Mar 21, 2019 at 11:20:17PM +0100, Rafael J. Wysocki wrote: > + ret = rdmsrl_on_cpu(cpu, MSR_IA32_ENERGY_PERF_BIAS, &epb); > + if (ret < 0) > + return ret; > + > + ret = wrmsrl_on_cpu(cpu, MSR_IA32_ENERGY_PERF_BIAS, > + (epb & ~EPB_MASK) | val); That's two back-to-back IPIs and a giant waste. If you'd use a proper msr shadow variable, you'd not have to do the rdmsr_on_cpu :-)