Received: by 2002:a25:824b:0:0:0:0:0 with SMTP id d11csp4001616ybn; Fri, 27 Sep 2019 14:48:32 -0700 (PDT) X-Google-Smtp-Source: APXvYqxtPZRUwAcMeFJVCJjpBhQM50IUcyZ1xVzMgyTVZh8wppKqwkNkxYfIUBmmAYTkklu0BMh0 X-Received: by 2002:aa7:d698:: with SMTP id d24mr7116185edr.32.1569620912707; Fri, 27 Sep 2019 14:48:32 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1569620912; cv=none; d=google.com; s=arc-20160816; b=gBJPEF0clIgBZ5HkxDlg/eMoQBeNdyD+Bo8XDyT8O/zViKg3k7e6JXqLViHUVM0eWz srqZtsectljI/Q3Idf3HZKERr8L0CbJMK/r3V1gIn4HZAHnUwYmFh94yg1i4zsX3asYI lWNaRQ/SJ2B4fO3qNdRPNH4wNGVayj1i4Pn+0CfH1heYMDC9dD/cfCAIUbpNkSmSjmpW YCBBFom6ZHv6r06VjdiHSAIDgWTI3SzhcpUWVMUOqKmOGNX0CpOUY7IqDNzxSA5fAqPT 614l8p/rGWTZaX+cqlQLYKw61Pk4jBB3LHY6XaXew2wYdbHu4QMlP7g9Ik7uNzkr1253 j0Ig== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from; bh=7HLVxV1ahcLkx+Y71oLFFHzBbbCAc8aFkGeOQE1x6GM=; b=Rzf1J8b3hOY5c48UHIT3MEdiiY+Zh+85zojHvh0ufczingqNmyUIdH7idzOWVWuY8B vK8XlaqVwSLWUOpBEs8a8bWDpVPS4u51BmyIVjLcc14eocSW6bZBYjkQZoqiHYxjXmYO HrMke0fYrjbNSPpRvKU65/YEuCkVLkv28XCYi6DY0n/2ilnqI4Rydkh4LIUamSQEA5y/ 5f3YQkgP4n+s4AycEcuJojWEVN7/d9wewbKF3nwC/ZQhTYj5dcScFjhqvOysa7vMDdIM etGOQIx/D1zp5K9SuAbc3t4eJ+NnDlG7LnTUB3kcit93mNzJaz/i05BUW4/revTmhVQO uYEA== ARC-Authentication-Results: i=1; mx.google.com; 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 f5si2361677edx.302.2019.09.27.14.48.08; Fri, 27 Sep 2019 14:48:32 -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; 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 S1726408AbfI0VsF (ORCPT + 99 others); Fri, 27 Sep 2019 17:48:05 -0400 Received: from mx2.suse.de ([195.135.220.15]:55570 "EHLO mx1.suse.de" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1725815AbfI0VsF (ORCPT ); Fri, 27 Sep 2019 17:48:05 -0400 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.220.254]) by mx1.suse.de (Postfix) with ESMTP id 36BC2ADFE; Fri, 27 Sep 2019 21:48:02 +0000 (UTC) From: Thomas Renninger To: " Natarajan, Janakarajan " Cc: "linux-kernel@vger.kernel.org" , "linux-pm@vger.kernel.org" , Pu Wen , Shuah Khan , Thomas Gleixner , Greg Kroah-Hartman , Kate Stewart , Allison Randal , Richard Fontana , Thomas Renninger , Borislav Petkov Subject: Re: [PATCH 1/2] Modify cpupower to schedule itself on cores it is reading MSRs from Date: Fri, 27 Sep 2019 23:48:16 +0200 Message-ID: <4340017.MFpoU6RDpq@c100> In-Reply-To: <9f94bb60-4be2-4303-54de-f50bdd7cb3e6@amd.com> References: <20190918163445.129103-1-Janakarajan.Natarajan@amd.com> <9f94bb60-4be2-4303-54de-f50bdd7cb3e6@amd.com> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Friday, September 27, 2019 6:07:56 PM CEST Natarajan, Janakarajan wrote: > On 9/18/2019 11:34 AM, Natarajan, Janakarajan wrote: > > This is advantageous because an IPI is not generated when a read_msr() is > > executed on the local logical CPU thereby reducing the chance of having > > APERF and MPERF being out of sync. > > + if (sched_setaffinity(getpid(), sizeof(set), &set) == -1) { > > + dprint("Could not migrate to cpu: %d\n", cpu); > > + return 1; On a 80 core cpu the process would be pushed around through the system quite a lot. This might affect what you are measuring or the other measure values? Otherwise it's the kernel's MSR read only, not the whole cpupower process, right? No idea about the exact overhead, though. Others in CC list should know. Afaik msr reads through msr module should be avoided anyway? Those which are worth it are abstracted through sysfs nowadays? For aperf/mperf it might make sense to define a sysfs file where you can read both, as this is what you always need? It would take a while, but could be a longterm solution which is also usable in secure boot or without msr module case. Thomas