Received: by 2002:a05:6520:2f93:b029:af:d4db:7a05 with SMTP id 19csp2383477lkf; Fri, 5 Feb 2021 11:43:17 -0800 (PST) X-Google-Smtp-Source: ABdhPJz+IX+MXyV/+SjTlY4EvprYZeeyPvhe9edEVm+T1tFUIaMfb+GoENwWMRkkuDWZafLos0S+ X-Received: by 2002:a17:907:20f2:: with SMTP id rh18mr5547513ejb.350.1612554197595; Fri, 05 Feb 2021 11:43:17 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1612554197; cv=none; d=google.com; s=arc-20160816; b=yJ/HJ5FkNd3Fqne/jQBt5qZeTKGiVxBkiy7GZ+DgVu16HOQW/tEQn5pdb5Sofums7A Tic/o/5pGpPd/yRP/51NyVvQ95KMSewXqBS8bYKjIUk4AgCC8qKsFUjRVt0ljTZHBO99 6Jvo9x5+PQUjuQOt2N3hBjczcsWqEiNml1J0ey5VvSBwL1pwULZmWE4QpYueofd6GxtX NG9mZtvUnAhR8HGcj37osPkuZRGc5XFetabSSw+PbiKZvrb94WE9lpK3ckrR/gjIXkrp RansJqZOq3eea3A9mB6e0qMkdqZU2Io+ms3R8DKpm7qEhzWRfZoJBJLjLHoMgzBhL1Gr XfVA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:date:cc:to:from:subject :message-id:ironport-sdr:ironport-sdr; bh=oiIoTyyWkwl3TUAmLLfrjskY0SF3ZpFBiXArle3KuBo=; b=iPar47vpLYJAC3PV2WAfzpRUrYFDIVl36poUFy/i8mI6bj69zZFJFB7pp7GKqloOM+ Jernxq665WvtruMh902sy0a5epT71yWRvmzS+nHjhIhJNoJOfnp2Z2I2drVq1KZxTaKH InShkEJQhPz0grFzbr2zYbM/dR7nclXoDdU3tNyo3Uj3lhWJH9fo+2ZgSZ3tCOal/W1D tOeMSG7HinXMxGoWh0jS8gD6RggsRYOlcaLHq3EZbZAW1MzuRoGS+It7IhN1Xwl5kES6 +xJWenOHZgEYFUg0v+V7GWnyqDw8qXwh/DcdpUrNkYbsb5mLRhQV8JRpBjKcmAVha+/R z3WA== 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=intel.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id bw14si5788564ejb.201.2021.02.05.11.42.53; Fri, 05 Feb 2021 11:43:17 -0800 (PST) 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=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233251AbhBER66 (ORCPT + 99 others); Fri, 5 Feb 2021 12:58:58 -0500 Received: from mga11.intel.com ([192.55.52.93]:3071 "EHLO mga11.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233238AbhBEP1Q (ORCPT ); Fri, 5 Feb 2021 10:27:16 -0500 IronPort-SDR: DBWi9nnisSoA8Cdvker+OvShWDgaPtMv0Jwpi8AQhzj/Ly7SSvlMl+ZAOuOsdgSEWN4CXgQMPU Ep1HDkmi/vRQ== X-IronPort-AV: E=McAfee;i="6000,8403,9885"; a="177955330" X-IronPort-AV: E=Sophos;i="5.81,155,1610438400"; d="scan'208";a="177955330" Received: from orsmga008.jf.intel.com ([10.7.209.65]) by fmsmga102.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 05 Feb 2021 09:07:37 -0800 IronPort-SDR: mGPnbtVPmJJg3NoDEko5zdYAU1Mj7/ClAx+9ByIq3ztejbmWSU/Op+By5NXQ/Xnnb32UcH1EmV HSs71W5HB+0g== X-IronPort-AV: E=Sophos;i="5.81,155,1610438400"; d="scan'208";a="393939598" Received: from mjwilkin-mobl.amr.corp.intel.com ([10.212.80.131]) by orsmga008-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 05 Feb 2021 09:07:36 -0800 Message-ID: <0f63aaa63cb4217f772aa702fac5c44a3ac110b6.camel@linux.intel.com> Subject: Re: [PATCH 1/2] powercap/intel_rapl: Use topology interface in rapl_add_package() From: Srinivas Pandruvada To: "Rafael J. Wysocki" , Yunfeng Ye , "Zhang, Rui" Cc: "Rafael J. Wysocki" , Linux PM , Linux Kernel Mailing List , hushiyuan@huawei.com, hewenliang4@huawei.com, caihongda@huawei.com Date: Fri, 05 Feb 2021 09:07:28 -0800 In-Reply-To: References: <20210123100608.2349629-1-yeyunfeng@huawei.com> Content-Type: text/plain; charset="UTF-8" User-Agent: Evolution 3.34.4 (3.34.4-1.fc31) MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, 2021-02-05 at 13:45 +0100, Rafael J. Wysocki wrote: > On Sat, Jan 23, 2021 at 11:07 AM Yunfeng Ye > wrote: > > It's not a good way to access phys_proc_id and cpu_die_id directly. > > So using topology_physical_package_id(cpu) and topology_die_id(cpu) > > instead. > > > > Signed-off-by: Yunfeng Ye > > Srinivas, Rui, any concerns? Looks good. Thanks, Srinivas > > > --- > > drivers/powercap/intel_rapl_common.c | 6 +++--- > > 1 file changed, 3 insertions(+), 3 deletions(-) > > > > diff --git a/drivers/powercap/intel_rapl_common.c > > b/drivers/powercap/intel_rapl_common.c > > index c9e57237d778..5f3d39b8212a 100644 > > --- a/drivers/powercap/intel_rapl_common.c > > +++ b/drivers/powercap/intel_rapl_common.c > > @@ -1309,7 +1309,6 @@ struct rapl_package *rapl_add_package(int > > cpu, struct rapl_if_priv *priv) > > { > > int id = topology_logical_die_id(cpu); > > struct rapl_package *rp; > > - struct cpuinfo_x86 *c = &cpu_data(cpu); > > int ret; > > > > if (!rapl_defaults) > > @@ -1326,10 +1325,11 @@ struct rapl_package *rapl_add_package(int > > cpu, struct rapl_if_priv *priv) > > > > if (topology_max_die_per_package() > 1) > > snprintf(rp->name, PACKAGE_DOMAIN_NAME_LENGTH, > > - "package-%d-die-%d", c->phys_proc_id, c- > > >cpu_die_id); > > + "package-%d-die-%d", > > + topology_physical_package_id(cpu), > > topology_die_id(cpu)); > > else > > snprintf(rp->name, PACKAGE_DOMAIN_NAME_LENGTH, > > "package-%d", > > - c->phys_proc_id); > > + topology_physical_package_id(cpu)); > > > > /* check if the package contains valid domains */ > > if (rapl_detect_domains(rp, cpu) || rapl_defaults- > > >check_unit(rp, cpu)) { > > -- > > 2.27.0 > >