Received: by 2002:a25:868d:0:0:0:0:0 with SMTP id z13csp1396755ybk; Sat, 16 May 2020 10:01:06 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxT4PuIKHJcew7CKOkVXR8oPMXebOvSrQLsUNNc3Kzf0iWg/7wbDyLbUJozDIRTl+znBCfn X-Received: by 2002:a17:906:410a:: with SMTP id j10mr7978904ejk.378.1589648465983; Sat, 16 May 2020 10:01:05 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1589648465; cv=none; d=google.com; s=arc-20160816; b=XRoVWvQN8f49gBH987jFUj68slIIJwC394o0jGzqMFzeLVMGW4S0UuJO2Sy4zjx5fp HNj6HJx/xqk8YS7caBwUbjwRZgqRplCPOLwpr3s/TXFirBoFP1CXQcZJp4zg37w3n7gn JbWyJfoF3CC5P5zGk6d7nRxoe2aMgw8+LmD+tH9F2l2C/PoCgf6XhQ6iPZKNnewTCgyz 8IMrC5cSwL5ILppkEE4R7QDgC4n05lyjPvtEgWmJc5OrYZsN3pSwOA0b0Yln09HHP7k5 +Qnrs3QG9XwUPjq8RO1L1ndVp8JU/GkmKnk9dx/v0GcRXp2psUfmzsnO9hLsGN0C5Sb9 66PQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:user-agent:references :message-id:in-reply-to:subject:cc:to:from:date; bh=n1f4wZ/iBkmy8GcVPlb9NfIK1aqdyEchgFNG8zxdxuo=; b=IVqxwoKA7TeMmWvGf4cCfVwBv2F6/gEg+FMKj0opz+4Z1BijW5QpVBk5PxNMMK43KU bZvRZjtzOBFDWVBF7zKeKYCis1BsMIgm8LGJm9DuTmWqXA8M6ABDAu8lp3fMHF/7jV9W e9JwQkRLmNHvLRrw+QQ9qNMg2tTGNzgNETwKOgkKkS0r7KhUg758qLbCx+kbEccj0zFv G8eZpTzgis5W5I4wbdRIMrE9oGRuJd0e+KFC6lJgifXw9WywDpoVjy034al2WyhXk0jG FOVh9WEkIJ00fOMleYJKknnNU4ShctaXQHeazAlZeiWmphwUl3dK80f1fWEarL32HmzW WVTw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=ispras.ru Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id o22si3507197ejr.146.2020.05.16.10.00.42; Sat, 16 May 2020 10:01:05 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=ispras.ru Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726280AbgEPQ42 (ORCPT + 99 others); Sat, 16 May 2020 12:56:28 -0400 Received: from winnie.ispras.ru ([83.149.199.91]:28364 "EHLO smtp.ispras.ru" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726237AbgEPQ41 (ORCPT ); Sat, 16 May 2020 12:56:27 -0400 Received: from monopod.intra.ispras.ru (monopod.intra.ispras.ru [10.10.3.121]) by smtp.ispras.ru (Postfix) with ESMTP id F0B5C203BF; Sat, 16 May 2020 19:56:22 +0300 (MSK) Date: Sat, 16 May 2020 19:56:22 +0300 (MSK) From: Alexander Monakov To: Stephane Eranian cc: linux-kernel@vger.kernel.org, peterz@infradead.org, mingo@elte.hu, irogers@google.com, kim.phillips@amd.com, jolsa@redhat.com Subject: Re: [PATCH 0/3] perf/x86/rapl: Enable RAPL for AMD Fam17h In-Reply-To: <20200515215733.20647-1-eranian@google.com> Message-ID: References: <20200515215733.20647-1-eranian@google.com> User-Agent: Alpine 2.20.13 (LNX 116 2015-12-14) MIME-Version: 1.0 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 Fri, 15 May 2020, Stephane Eranian wrote: > The series first moves the rapl.c file to common perf_events x86 and then > adds the support. > From the user's point of view, the interface is identical with > /sys/devices/power. The energy-pkg event is the only one supported. AMD also has per-core energy metering via MSR 0xc001029a, and I wonder if you have plans to expose it to perf as well. I see it does not fit so nicely with the existing code (as it's per-core instead of per-die). The turbostat tool already exposes these per-core readings: Core CPU Avg_MHz Busy% Bzy_MHz TSC_MHz CorWatt PkgWatt - - 3951 100.00 3951 2373 54.92 30.04 0 0 3945 100.00 3945 2370 8.97 29.98 1 1 3945 100.00 3945 2370 9.11 2 2 3945 100.00 3945 2370 8.96 4 3 3946 100.00 3946 2370 9.32 5 4 3946 100.00 3946 2370 9.11 6 5 3946 100.00 3946 2370 9.39 turbostat sums the per-core energy figures to show the per-socket 54.92W value. Though as you can see on this example, the figure is not in agreement with the per-socket MSR you're using in your patch. Maybe the per-core values are less reliable, but I believe I have a test that shows per-package figure to be inaccurate as well. It would be nice if AMD clarified how the counters work. And, for what (little) it's worth, the series is: Tested-by: Alexander Monakov Thank you. Alexander