From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id DE6F2A0542; Wed, 5 Oct 2022 14:12:01 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 8E71840694; Wed, 5 Oct 2022 14:12:01 +0200 (CEST) Received: from wout4-smtp.messagingengine.com (wout4-smtp.messagingengine.com [64.147.123.20]) by mails.dpdk.org (Postfix) with ESMTP id 7243B40143 for ; Wed, 5 Oct 2022 14:11:59 +0200 (CEST) Received: from compute4.internal (compute4.nyi.internal [10.202.2.44]) by mailout.west.internal (Postfix) with ESMTP id D77B13200910; Wed, 5 Oct 2022 08:11:57 -0400 (EDT) Received: from mailfrontend2 ([10.202.2.163]) by compute4.internal (MEProxy); Wed, 05 Oct 2022 08:11:58 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=monjalon.net; h= cc:cc:content-transfer-encoding:content-type:date:date:from:from :in-reply-to:in-reply-to:message-id:mime-version:references :reply-to:sender:subject:subject:to:to; s=fm2; t=1664971917; x= 1665058317; bh=L/QO8P8LvDBAYji11Ar5Kdcziya43N99HJrXyuQi5Og=; b=R 8PG5QIWJt5TeiZ07+dkVdetBRK+/0IM3LGvcgFNTLOad8or9zRg4pzKuAq/PgAAs yfntRBKlFpVdseA1ZeahIz1FXEo6APsfzI1wvpAthKRUsp8THSnvfnF3GLwSz+4V A/t+l/apz/+FFea119xbJGtAe4NQVa+dQXT4d4zncsxUIYYFmSY4q389AFcvihXt qwmk9gcQn64oeopGQtRIl7/W7yDaVCisuxCdGYW5TpUwjMIrqB00lb6xzAZIqGto Vu1L9iq4RdJQFBUSB80mGjelnwPLIseKAWN/PMLHknPGaeGBznxbFWgXTc5gfEsC 3acZG8HgKyhnIWMCdoNqw== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-transfer-encoding :content-type:date:date:feedback-id:feedback-id:from:from :in-reply-to:in-reply-to:message-id:mime-version:references :reply-to:sender:subject:subject:to:to:x-me-proxy:x-me-proxy :x-me-sender:x-me-sender:x-sasl-enc; s=fm2; t=1664971917; x= 1665058317; bh=L/QO8P8LvDBAYji11Ar5Kdcziya43N99HJrXyuQi5Og=; b=l M1XBfy2LWh9aCGX2tPK95WgXMEVp+qJGyO4wWmksBaZl0JJUtPnyW4823GuJmmd7 kJvlKNCfpD1gtbekX5FqYVDzraKasqIOWOQaLx146u72oUsWiKhY5RIOHzKj6SvU AAUisHYXo9waVJ2grOtYO74KUBwW2XDgDm8s4B2rrHDx2jO7kxFeDdNUm046LjMO zufyTZbsQcj7ocozcUs/SWoesjqtzDhLb4TSHFOI3R2DEKU/zGrHqLYkEWmL60WY xj9QkS4y2gEdX0LDKbA+vUb/zH8o6JUEbshqKatzRJdGGhGaUAEHOUL1GXbbwc5s 2QaiLCpfcSEpwufbPRMMw== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvfedrfeeifedggeejucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhephffvvefufffkjghfggfgtgesthhqredttddtjeenucfhrhhomhepvfhhohhm rghsucfoohhnjhgrlhhonhcuoehthhhomhgrshesmhhonhhjrghlohhnrdhnvghtqeenuc ggtffrrghtthgvrhhnpeegtddtleejjeegffekkeektdejvedtheevtdekiedvueeuvdei uddvleevjeeujeenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfh hrohhmpehthhhomhgrshesmhhonhhjrghlohhnrdhnvght X-ME-Proxy: Feedback-ID: i47234305:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Wed, 5 Oct 2022 08:11:56 -0400 (EDT) From: Thomas Monjalon To: "Kearney, Tadhg" Cc: "dev@dpdk.org" , "Hunt, David" , "Burakov, Anatoly" , "Pattan, Reshma" Subject: Re: [PATCH v7 1/3] power: add uncore frequency control API to the power library Date: Wed, 05 Oct 2022 14:11:55 +0200 Message-ID: <23451635.RjEADstKbi@thomas> In-Reply-To: References: <20220928090636.1580647-1-tadhg.kearney@intel.com> <4956396.e8TTKsaY2g@thomas> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="UTF-8" X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org 05/10/2022 12:50, Kearney, Tadhg: > > -----Original Message----- > > From: Thomas Monjalon > > Sent: Tuesday 4 October 2022 18:09 > > To: Kearney, Tadhg > > Cc: dev@dpdk.org; Hunt, David ; Burakov, Anatoly > > ; Pattan, Reshma > > Subject: Re: [PATCH v7 1/3] power: add uncore frequency control API to = the > > power library > >=20 > > 28/09/2022 15:30, Tadhg Kearney: > > > Add API to allow uncore frequency adjustment. This is done through > > > manipulating related uncore frequency control sysfs entries to adjust > > > the minimum and maximum uncore frequency values. > > > Nine API's are being added that are all public and experimental. > >=20 > > You cannot introduce an API without explaining what it is about. > > Maybe I'm an idiot but I don't know what is "uncore". > > I see it is explained in the documentation, but few words in the commit > > message would not be too much. > > At least you must say it for Linux on Intel, and which feature it is co= ntrolling. > >=20 > > > +Uncore API > > > +---------- > > > + > > > +Abstract > > > +~~~~~~~~ > > > + > > > +Uncore is a term used by Intel to describe the functions of a > > > +microprocessor that are not in the core, but which must be closely > > > +connected to the core to achieve high performance; > > > +L3 cache, on-die memory controller, etc. > > > +Significant power savings can be achieved by reducing the uncore > > frequency to its lowest value. > >=20 > > So this is an Intel thing. >=20 > Yes, so far the uncore kernel implementation covers Intel hardware. >=20 > >=20 > > > + > > > +The Linux kernel provides the driver =E2=80=9Cintel-uncore-frequency= " to > > > +control the uncore frequency limits for x86 platform. The driver is > > available from kernel version 5.6 and above. > > > +Also CONFIG_INTEL_UNCORE_FREQ_CONTROL will need to be enabled in > > the kernel, which was added in 5.6. > > > +This manipulates the contest of MSR 0x620, which sets min/max of the > > uncore for the SKU. > >=20 > > It is correctly named "intel-uncore" in the Linux kernel. > > Why not having "Intel" in the DPDK feature name? > >=20 > > > + > > > + > > > +API Overview for Uncore > > > +~~~~~~~~~~~~~~~~~~~~~~~ > >=20 > > A blank line is missing here. > >=20 > > > +* **Uncore Power Init**: Initialise uncore power, populate frequency > > > +array and record > > > + original min & max for pkg & die. > > > + > > > +* **Uncore Power Exit**: Exit uncore power, restoring original min &= max > > for pkg & die. > > > + > > > +* **Get Uncore Power Freq**: Get current uncore freq index for pkg & > > die. > > > + > > > +* **Set Uncore Power Freq**: Set min & max uncore freq index for pkg= & > > die (min and max will be the same). > > > + > > > +* **Uncore Power Max**: Set max uncore freq index for pkg & die. > > > + > > > +* **Uncore Power Min**: Set min uncore freq index for pkg & die. > > > + > > > +* **Get Num Freqs**: Get the number of frequencies in the index arra= y. > > > + > > > +* **Get Num Pkgs**: Get the number of packages (CPUs) on the system. > > > + > > > +* **Get Num Dies**: Get the number of die's on a given package. > >=20 > > Not sure what you are listing here. Are they functions? > > If you really want to keep a list, I suggest using a definition list av= ailable in RST > > syntax. > > If you want to provide an explanation easy to read, full sentences conn= ecting > > things together would be better. >=20 > Agreed. >=20 > >=20 > > > + > > > References > > > ---------- > > > > > > diff --git a/doc/guides/rel_notes/release_22_11.rst > > > b/doc/guides/rel_notes/release_22_11.rst > > > index cb7677fd3c..5d3f815b54 100644 > > > --- a/doc/guides/rel_notes/release_22_11.rst > > > +++ b/doc/guides/rel_notes/release_22_11.rst > > > @@ -75,6 +75,11 @@ New Features > > > * Added ``rte_event_eth_tx_adapter_instance_get`` to get Tx adapter > > > instance ID for specified ethernet device ID and Tx queue index. > > > > > > +* **Added uncore frequency control API to the power library.** > > > + > > > + Add api to allow uncore frequency adjustment. This is done through > >=20 > > s/api/API/ > >=20 > > > + manipulating related uncore frequency control sysfs entries to > > > + adjust the minimum and maximum uncore frequency values. > >=20 > > It is Linux-only for Intel hardware only. > >=20 > > > --- /dev/null > > > +++ b/lib/power/rte_power_uncore.c > >=20 > > I would add "intel" in the filename. > >=20 > > [...] > > > +#define UNCORE_FREQUENCY_DIR > > "/sys/devices/system/cpu/intel_uncore_frequency" > > > +#define POWER_GOVERNOR_PERF "performance" > > > +#define POWER_UNCORE_SYSFILE_MAX_FREQ \ > > > + > > "/sys/devices/system/cpu/intel_uncore_frequency/package_%02u_ > > die_%02u/max_freq_khz" > > > +#define POWER_UNCORE_SYSFILE_MIN_FREQ \ > > > + > > "/sys/devices/system/cpu/intel_uncore_frequency/package_%02u_ > > die_%02u/min_freq_khz" > > > +#define POWER_UNCORE_SYSFILE_BASE_MAX_FREQ \ > > > + > > "/sys/devices/system/cpu/intel_uncore_frequency/package_%02u_ > > die_%02u/initial_max_freq_khz" > > > +#define POWER_UNCORE_SYSFILE_BASE_MIN_FREQ \ > > > + > > "/sys/devices/system/cpu/intel_uncore_frequency/package_%02u_ > > die_%02u/initial_min_freq_khz" > >=20 > > It is for Intel CPU only, right? >=20 > Currently only Intel CPUs are covered by these sysfs entries, but it is p= ossible that other platforms will be included in the future. No, these sysfs have "intel" in their names. So it will never become something not Intel. At the very minimum, you should name the defines with _INTEL_ > > > + * This function should NOT be called in the fast path. > > > + * > > > + * @param pkg > > > + * Package number. > > > + * @param die > > > + * Die number. > >=20 > > To me it is not clear what they are. > > Is it possible to better explain "pkg" and "die" somewhere? > > Is it related to NUMA nodes? >=20 > Each NUMA node is a package, which can contain 1 or more dies. These dies= are connected in a package together via the UNCORE mesh. > Dies may appear as separate NUMA nodes, or a group of dies on a packages = may appear as a single NUMA node, depending on the BIOS configuration. > Header descriptions will be changed to: > * Package number. Each physical CPU in a system is referred to as a p= ackage. > * Die number. Each package can have several dies connected together v= ia the uncore mesh. OK better, thanks.