From nobody Mon Aug 24 09:08:42 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of lists.libvirt.org designates 38.145.34.151 as permitted sender) client-ip=38.145.34.151; envelope-from=devel-bounces@lists.libvirt.org; helo=lists.libvirt.org; Authentication-Results: mx.zohomail.com; dkim=pass header.i=@intel.com; spf=pass (zohomail.com: domain of lists.libvirt.org designates 38.145.34.151 as permitted sender) smtp.mailfrom=devel-bounces@lists.libvirt.org; dmarc=pass(p=none dis=none) header.from=intel.com ARC-Seal: i=1; a=rsa-sha256; t=1786029448; cv=none; d=zohomail.com; s=zohoarc; b=EGl0jcaf2PARIADcCMeWB3UVt2mLseV9Ovp2e5PfYo/oHDQWVQw54CB6FyskgEgebIWNmximfAkHKqkMy6SmnJcirL666pSOH5kqnMhtE9wOSbAi6UBqSGKEmOIpju9+oGd75J+rT38dCG/1paXEcKgLKPfaUMbY06MK5if/a7U= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1786029448; h=Content-Type:Content-Transfer-Encoding:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Owner:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Subject:Subject:To:To:Message-Id:Reply-To:Cc; bh=f8fBw///8asjlKt8V0UIdWr1vy7f0sXsEVMX8m0yVdI=; b=ZpqUBrIgvyOBj865xsRaSRGORNbIT8CX3VvkcbvJSrKYs0vNR+9HMfkxJyxn1mw+r3SuJpxKODqsBvjXJzCLpigpx1XO10znIiS/Dt0p9fSONHzwfu3VhQuEODpUg2HTeSeql/hfTei/RYPvWeAS5yeNPbu4HjudWbTiwOLlAhg= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass header.i=@intel.com; spf=pass (zohomail.com: domain of lists.libvirt.org designates 38.145.34.151 as permitted sender) smtp.mailfrom=devel-bounces@lists.libvirt.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.libvirt.org (lists.libvirt.org [38.145.34.151]) by mx.zohomail.com with SMTPS id 1786029448835441.0877183147825; Thu, 6 Aug 2026 08:17:28 -0700 (PDT) Received: by lists.libvirt.org (Postfix, from userid 993) id 9DD963F36C; Thu, 6 Aug 2026 11:17:27 -0400 (EDT) Received: from [172.19.199.10] (unknown [10.16.107.18]) by lists.libvirt.org (Postfix) with ESMTP id 62D7D41B83; Thu, 6 Aug 2026 11:13:46 -0400 (EDT) Received: by lists.libvirt.org (Postfix, from userid 993) id 243BE417CF; Thu, 6 Aug 2026 11:13:24 -0400 (EDT) Received: from mgamail.intel.com (mgamail.intel.com [198.175.65.20]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by lists.libvirt.org (Postfix) with ESMTPS id 8C5843FB96 for ; Thu, 6 Aug 2026 11:13:22 -0400 (EDT) Received: from orviesa001.jf.intel.com ([10.64.159.141]) by orvoesa112.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 06 Aug 2026 08:12:18 -0700 Received: from ubuntu.ger.corp.intel.com ([10.211.96.193]) by orviesa001.jf.intel.com with ESMTP; 06 Aug 2026 08:12:17 -0700 X-Spam-Checker-Version: SpamAssassin 4.0.1 (2024-03-26) on lists.libvirt.org X-Spam-Level: X-Spam-Status: No, score=-5.9 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED,SPF_HELO_NONE autolearn=unavailable autolearn_force=no version=4.0.1 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1786029203; x=1817565203; h=from:to:subject:date:message-id:in-reply-to:references: mime-version:content-transfer-encoding; bh=UcM1jaFvA+yISF89QAyfoQgzCqubfouFzyXk1blxksA=; b=SJDpKYnvoY4hR1HlpYDsugjidftsOYGbEUzH6fHtgnNPfl3JgVBmrrJZ pGiYct6CXq+8vMXDEwocPxcvtPHzUhYb53LKg7/amU4a5omWyzpvGxUj/ UydGpKlNIGZNsrVlmE+3mOAoUEsPlSJGBltVmD1mw7olFsdtff4p/pH0C aMPPOG00unVKkNwn20Lba6yxYGH+xKEjAwewJN4kIjFy1Q4y89Q+e/vca x3BwHi+jqpUmuPJkFU4dU+PAjNmv8DKEUxqeRBVHInSdUplQPaJfGOw0Y XXu2DQ1aKV2i+BOxArWp2feTMo1hcnw12bSLhIKmOWsO1S8gq4TlgQUmq A==; X-CSE-ConnectionGUID: 4uwc+LRvSuiTOiL+DYr72w== X-CSE-MsgGUID: GwZB8JlzTx+XSs0sPLA4XQ== X-IronPort-AV: E=McAfee;i="6800,10657,11867"; a="86391730" X-IronPort-AV: E=Sophos;i="6.25,208,1779174000"; d="scan'208";a="86391730" X-CSE-ConnectionGUID: bDGdi8QhRuGD6oymiUpksQ== X-CSE-MsgGUID: 5kedBFaFSFi83Hq/g0+6+w== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.25,208,1779174000"; d="scan'208";a="300339932" From: Jedrzej Wasiukiewicz To: devel@lists.libvirt.org Subject: [PATCH 1/6] conf: allow omitting vcpus in cachetune/memorytune/energytune Date: Thu, 6 Aug 2026 17:11:36 +0200 Message-ID: <20260806151141.3986850-2-jedrzej.wasiukiewicz@intel.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20260806151141.3986850-1-jedrzej.wasiukiewicz@intel.com> References: <20260806151141.3986850-1-jedrzej.wasiukiewicz@intel.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Message-ID-Hash: 2CG65WNSVULX2SIDMY7TCBTQKE32TSTT X-Message-ID-Hash: 2CG65WNSVULX2SIDMY7TCBTQKE32TSTT X-MailFrom: jedrzej.wasiukiewicz@intel.com X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; loop; banned-address; header-match-devel.lists.libvirt.org-0; emergency; member-moderation; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header X-Mailman-Version: 3.3.10 Precedence: list List-Id: Development discussions about the libvirt library & tools Archived-At: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-ZohoMail-DKIM: pass (identity @intel.com) X-ZM-MESSAGEID: 1786029451379158500 Content-Type: text/plain; charset="utf-8" Make the vcpus attribute optional on cachetune, memorytune and energytune. Not specifying vcpus in the XML makes the allocation/monitoring group affect the whole domain process, relying on the resctrl inheritance mechanism so that all of the process' threads and children end up in the same group. Signed-off-by: Jedrzej Wasiukiewicz --- docs/formatdomain.rst | 57 ++++++++++++++++++------------- src/conf/schemas/domaincommon.rng | 48 ++++++++++++++++---------- 2 files changed, 63 insertions(+), 42 deletions(-) diff --git a/docs/formatdomain.rst b/docs/formatdomain.rst index 28c9170a37..1f8bf378eb 100644 --- a/docs/formatdomain.rst +++ b/docs/formatdomain.rst @@ -1023,10 +1023,13 @@ CPU Tuning Optional ``cachetune`` element can control allocations for CPU caches u= sing the resctrl on the host. Whether or not is this supported can be gather= ed from capabilities where some limitations like minimum size and required - granularity are reported as well. The required attribute ``vcpus`` spec= ifies - to which vCPUs this allocation applies. A vCPU can only be member of one - ``cachetune`` element allocation. The vCPUs specified by cachetune can = be - identical with those in memorytune, however they are not allowed to ove= rlap. + granularity are reported as well. The optional attribute ``vcpus`` spec= ifies + to which vCPUs this allocation applies. If ``vcpus`` is omitted the all= ocation + applies to the whole emulator process; the resctrl group is then inheri= ted by + all its threads and child processes. A vCPU can only be member of one + ``cachetune`` element allocation. The scope specified by cachetune + can be identical with those in memorytune, however they are not + allowed to overlap. The optional, output only ``id`` attribute identifies cache uniquely. Supported subelements are: =20 @@ -1053,23 +1056,26 @@ CPU Tuning specified, defaults to bytes. =20 ``monitor`` :since:`Since 4.10.0` - The optional element ``monitor`` creates the cache monitor(s) for cu= rrent - cache allocation and has the following required attributes: + The optional element ``monitor`` creates the cache monitor(s) for + the enclosing ``cachetune`` allocation. It has the following attribu= tes: =20 ``level`` - Host cache level the monitor belongs to. + Required. Host cache level the monitor belongs to. ``vcpus`` - vCPU list the monitor applies to. A monitor's vCPU list can only = be the - member(s) of the vCPU list of the associated allocation. The defa= ult - monitor has the same vCPU list as the associated allocation. For - non-default monitors, overlapping vCPUs are not permitted. + Optional. The vCPUs to monitor. Must be a subset of the enclosing + allocation's vCPUs and must not overlap another cache monitor of = the + same allocation. A monitor covering the allocation's full vCPU li= st + reports the allocation as a whole. Omit ``vcpus`` to inherit the + enclosing allocation's scope. =20 ``memorytune`` :since:`Since 4.7.0` Optional ``memorytune`` element can control allocations for memory band= width using the resctrl on the host. Whether or not is this supported can be gathered from capabilities where some limitations like minimum bandwidt= h and - required granularity are reported as well. The required attribute ``vcp= us`` - specifies to which vCPUs this allocation applies. A vCPU can only be me= mber + required granularity are reported as well. The optional attribute ``vcp= us`` + specifies to which vCPUs this allocation applies. If ``vcpus`` is omitt= ed the + allocation applies to the whole emulator process; the resctrl group is = then + inherited by all its threads and child processes. A vCPU can only be me= mber of one ``memorytune`` element allocation. The ``vcpus`` specified by ``memorytune`` can be identical to those specified by ``cachetune``. Ho= wever they are not allowed to overlap each other. Supported subelements are: @@ -1088,21 +1094,24 @@ CPU Tuning configuration. =20 ``energytune`` :since:`Since 12.4.0` - Optional ``energytune`` element allows to monitor energy consumption us= ing the - resctrl filesystem on the host. Whether or not is this supported can be - gathered from capabilities where number of monitors and available featu= res are - reported. The required attribute ``vcpus`` specifies to which allocatio= n group - this monitor belongs. A vCPU can only be member of one allocation group= and monitor - group. The ``vcpus`` specified by ``energytune`` can be identical to th= ose - specified by ``cachetune`` or ``memorytune``. However they are not allo= wed to - overlap each other. Supported subelements are: + Optional ``energytune`` element defines a group for energy consumption + monitoring using the resctrl filesystem on the host. Whether or not is = this + supported can be gathered from capabilities where number of monitors and + available features are reported. The optional attribute ``vcpus`` speci= fies + which vCPUs form this group. If ``vcpus`` is omitted the group covers t= he whole + emulator process; the resctrl group is then inherited by all its thread= s and + child processes. A vCPU can only be member of one ``energytune`` group.= The + ``vcpus`` specified by ``energytune`` can be identical to those specifi= ed by + ``cachetune`` or ``memorytune``. However they are not allowed to overla= p each + other. Supported subelements are: =20 ``monitor`` - The optional element ``monitor`` creates the energy monitor for - this allocation group and has the following required attribute: + The optional element creates the energy monitor for the + enclosing ``energytune`` group. It has the following attribute: =20 ``vcpus`` - vCPU list the monitor applies to. + Optional. The vCPUs to monitor. Omit ``vcpus`` to inherit the enc= losing + group's scope. =20 =20 Memory Allocation diff --git a/src/conf/schemas/domaincommon.rng b/src/conf/schemas/domaincom= mon.rng index 81ffbfc2fa..aa51429964 100644 --- a/src/conf/schemas/domaincommon.rng +++ b/src/conf/schemas/domaincommon.rng @@ -1224,9 +1224,11 @@ - - - + + + + + @@ -1261,9 +1263,11 @@ - - - + + + + + @@ -1271,9 +1275,11 @@ - - - + + + + + @@ -1285,9 +1291,11 @@ - - - + + + + + @@ -1295,9 +1303,11 @@ - - - + + + + + @@ -1305,9 +1315,11 @@ - - - + + + + + --=20 2.43.0 --------------------------------------------------------------------- Intel Technology Poland sp. z o.o. ul. Slowackiego 173 | 80-298 Gdansk | Sad Rejonowy Gdansk Polnoc | VII Wydz= ial Gospodarczy Krajowego Rejestru Sadowego - KRS 101882 | NIP 957-07-52-31= 6 | Kapital zakladowy 200.000 PLN. Spolka oswiadcza, ze posiada status duzego przedsiebiorcy w rozumieniu usta= wy z dnia 8 marca 2013 r. o przeciwdzialaniu nadmiernym opoznieniom w trans= akcjach handlowych. Ta wiadomosc wraz z zalacznikami jest przeznaczona dla okreslonego adresata= i moze zawierac informacje poufne. W razie przypadkowego otrzymania tej wi= adomosci, prosimy o powiadomienie nadawcy oraz trwale jej usuniecie; jakiek= olwiek przegladanie lub rozpowszechnianie jest zabronione. This e-mail and any attachments may contain confidential material for the s= ole use of the intended recipient(s). If you are not the intended recipient= , please contact the sender and delete all copies; any review or distributi= on by others is strictly prohibited. From nobody Mon Aug 24 09:08:42 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of lists.libvirt.org designates 38.145.34.151 as permitted sender) client-ip=38.145.34.151; envelope-from=devel-bounces@lists.libvirt.org; helo=lists.libvirt.org; Authentication-Results: mx.zohomail.com; dkim=pass header.i=@intel.com; spf=pass (zohomail.com: domain of lists.libvirt.org designates 38.145.34.151 as permitted sender) smtp.mailfrom=devel-bounces@lists.libvirt.org; dmarc=pass(p=none dis=none) header.from=intel.com ARC-Seal: i=1; a=rsa-sha256; t=1786030081; cv=none; d=zohomail.com; s=zohoarc; b=lA2nHVYioYcRxHh8Oxzex2e/Czvl32lQufDDU01fr1mWeqzzMD282TtnJJQyMh6niHhHlJzubHUaUO/OXH5XbbwNddJmmCPKOL3OFPRLPojGDmlzr90EBY+F+WxNLmOb6ch4CxfhCQ3sJ8V00+Sx4myHqozEoifDqh6Kh5uuwVY= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1786030081; h=Content-Type:Content-Transfer-Encoding:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Owner:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Subject:Subject:To:To:Message-Id:Reply-To:Cc; bh=DD4WoqqwDUY1KH4dQHoUoN69/P0h7Af5OMcRGMiQJcY=; b=IS7Ww4JD6CPn+SLoMgj+9DJqqs30dNJckNdhJJXfmqmsSZVQxPNrK585J9pUQn7fPxgyXX7u/V0TLtwEVQ4Qa9aMwQPt9T3s4srAMFrk8Tz7C6O9OrInaa6NWQ5VL4IMYC0NIh7wu/PHTqeqgdO6LNBBqs3u5YUC0ILY+7qKH7E= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass header.i=@intel.com; spf=pass (zohomail.com: domain of lists.libvirt.org designates 38.145.34.151 as permitted sender) smtp.mailfrom=devel-bounces@lists.libvirt.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.libvirt.org (lists.libvirt.org [38.145.34.151]) by mx.zohomail.com with SMTPS id 1786030081303356.7936102842385; Thu, 6 Aug 2026 08:28:01 -0700 (PDT) Received: by lists.libvirt.org (Postfix, from userid 993) id E5F8E40473; Thu, 6 Aug 2026 11:27:59 -0400 (EDT) Received: from [172.19.199.10] (unknown [10.16.107.18]) by lists.libvirt.org (Postfix) with ESMTP id B630941DB8; Thu, 6 Aug 2026 11:14:17 -0400 (EDT) Received: by lists.libvirt.org (Postfix, from userid 993) id 1A04E3FA5C; Thu, 6 Aug 2026 11:13:28 -0400 (EDT) Received: from mgamail.intel.com (mgamail.intel.com [198.175.65.20]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by lists.libvirt.org (Postfix) with ESMTPS id 0D3F33FCA7 for ; Thu, 6 Aug 2026 11:13:22 -0400 (EDT) Received: from orviesa001.jf.intel.com ([10.64.159.141]) by orvoesa112.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 06 Aug 2026 08:12:19 -0700 Received: from ubuntu.ger.corp.intel.com ([10.211.96.193]) by orviesa001.jf.intel.com with ESMTP; 06 Aug 2026 08:12:18 -0700 X-Spam-Checker-Version: SpamAssassin 4.0.1 (2024-03-26) on lists.libvirt.org X-Spam-Level: X-Spam-Status: No, score=-5.9 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED,SPF_HELO_NONE autolearn=unavailable autolearn_force=no version=4.0.1 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1786029203; x=1817565203; h=from:to:subject:date:message-id:in-reply-to:references: mime-version:content-transfer-encoding; bh=jnxfaov279n+NxUymlJqeYS5lIHiETMrxUpRlY2f6wA=; b=FCLi4IoRDSW1bPnpL/6QsZuTocqzsD+gFMfn5EC+efNdtAcozopvc/tz sbg5KwPqqCFVpspZBoiNREY1bLl2wV7do3SUTE2L5Y9ogB6LNoAGuWYg2 DNb4UmfatCNHrSlI0uPXMJocdwaornKUHLKcn0hPZ0Mc4fKx8Iep/rEKp 7OGpo1Ch79SX2sE0gS+nVFfR6c2yvcjmrAf+dUifhEcy3XFdljaFj1ipl WWCpV4Lbzs6ZV6UeitIPjx5CoxnAKPaHITWJgLo3lqFPahfsj3uPXeeua EIputcLBnULgRnmlR7iVIvaARZp56seA1SH4j/eBm0shsjYulnG9fJ33V g==; X-CSE-ConnectionGUID: yQpanNSCRR2bXBqcytjg5A== X-CSE-MsgGUID: zjzPm8fBTAGF+vKYV1hR+g== X-IronPort-AV: E=McAfee;i="6800,10657,11867"; a="86391733" X-IronPort-AV: E=Sophos;i="6.25,208,1779174000"; d="scan'208";a="86391733" X-CSE-ConnectionGUID: UmaITW0uSN6v83HyhTSmPA== X-CSE-MsgGUID: ws33P9VDSoyA8jQQtgjWcQ== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.25,208,1779174000"; d="scan'208";a="300339934" From: Jedrzej Wasiukiewicz To: devel@lists.libvirt.org Subject: [PATCH 2/6] conf: implement whole-process resctrl scope Date: Thu, 6 Aug 2026 17:11:37 +0200 Message-ID: <20260806151141.3986850-3-jedrzej.wasiukiewicz@intel.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20260806151141.3986850-1-jedrzej.wasiukiewicz@intel.com> References: <20260806151141.3986850-1-jedrzej.wasiukiewicz@intel.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Message-ID-Hash: WICYBZQAMYW6KIMD2QB7P4AZCOCHYM2Z X-Message-ID-Hash: WICYBZQAMYW6KIMD2QB7P4AZCOCHYM2Z X-MailFrom: jedrzej.wasiukiewicz@intel.com X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; loop; banned-address; header-match-devel.lists.libvirt.org-0; emergency; member-moderation; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header X-Mailman-Version: 3.3.10 Precedence: list List-Id: Development discussions about the libvirt library & tools Archived-At: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-ZohoMail-DKIM: pass (identity @intel.com) X-ZM-MESSAGEID: 1786030083125158500 Content-Type: text/plain; charset="utf-8" Treat vCPU attribute absence as a request to place the whole emulator process in one resctrl group for both allocation and monitoring. Parsing such XML failed until now. A whole-process group has no vcpu list and no id. It formats back as a bare cachetune, memorytune, energytune or monitor element. Track the scope with a whole_process flag and enforce the rules beside the existing monitor checks. A domain's allocations are either all whole-process or all per-vCPU. A whole-process monitor needs a whole-process allocation, does not mix with explicit monitors and is unique per resource type. A whole-process allocation may still carry explicit per-vCPU monitors, as it already spans every thread. Monitors that omit vcpus inside an explicit allocation inherit the allocation's vcpu scope instead of covering the whole process. This behavior represents the resctrl dependency between allocation and monitoring. Out of range and empty vcpus attributes still remain silently dropped. Signed-off-by: Jedrzej Wasiukiewicz --- src/conf/domain_conf.c | 231 ++++++++++++------ src/conf/domain_conf.h | 2 + .../cachetune-monitor-empty-vcpus.xml | 30 +++ .../cachetune-monitor-inherit-alloc.xml | 30 +++ .../cachetune-wholeprocess-duplicate.xml | 32 +++ ...chetune-wholeprocess-monitor-duplicate.xml | 31 +++ .../cachetune-wholeprocess-monitors.xml | 31 +++ .../energytune-colliding-monitor.xml | 30 +++ .../energytune-wholeprocess.xml | 29 +++ .../memorytune-wholeprocess.xml | 29 +++ .../resctrl-wholeprocess-alloc-monitor.xml | 32 +++ .../resctrl-wholeprocess-layering.xml | 32 +++ .../resctrl-wholeprocess-monitors.xml | 33 +++ .../cachetune-monitor-inherit-alloc.xml | 30 +++ tests/genericxml2xmltest.c | 11 + 15 files changed, 545 insertions(+), 68 deletions(-) create mode 100644 tests/genericxml2xmlindata/cachetune-monitor-empty-vcpu= s.xml create mode 100644 tests/genericxml2xmlindata/cachetune-monitor-inherit-al= loc.xml create mode 100644 tests/genericxml2xmlindata/cachetune-wholeprocess-dupli= cate.xml create mode 100644 tests/genericxml2xmlindata/cachetune-wholeprocess-monit= or-duplicate.xml create mode 100644 tests/genericxml2xmlindata/cachetune-wholeprocess-monit= ors.xml create mode 100644 tests/genericxml2xmlindata/energytune-colliding-monitor= .xml create mode 100644 tests/genericxml2xmlindata/energytune-wholeprocess.xml create mode 100644 tests/genericxml2xmlindata/memorytune-wholeprocess.xml create mode 100644 tests/genericxml2xmlindata/resctrl-wholeprocess-alloc-m= onitor.xml create mode 100644 tests/genericxml2xmlindata/resctrl-wholeprocess-layerin= g.xml create mode 100644 tests/genericxml2xmlindata/resctrl-wholeprocess-monitor= s.xml create mode 100644 tests/genericxml2xmloutdata/cachetune-monitor-inherit-a= lloc.xml diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c index 45235d74bc..5e8f7ea429 100644 --- a/src/conf/domain_conf.c +++ b/src/conf/domain_conf.c @@ -18771,15 +18771,17 @@ virDomainDefParseBootOptions(virDomainDef *def, static int virDomainResctrlParseVcpus(virDomainDef *def, xmlNodePtr node, - virBitmap **vcpus) + virBitmap **vcpus, + bool *whole_process) { g_autofree char *vcpus_str =3D NULL; + *vcpus =3D NULL; =20 vcpus_str =3D virXMLPropString(node, "vcpus"); - if (!vcpus_str) { - virReportError(VIR_ERR_XML_ERROR, _("Missing %1$s attribute 'vcpus= '"), - node->name); - return -1; + *whole_process =3D !vcpus_str; + if (*whole_process) { + *vcpus =3D virBitmapNew(0); + return 0; } if (virBitmapParse(vcpus_str, vcpus, VIR_DOMAIN_CPUMASK_LEN) < 0) { virReportError(VIR_ERR_XML_ERROR, @@ -18859,6 +18861,9 @@ virDomainCachetuneDefParseCache(xmlXPathContextPtr = ctxt, /* Checking if the monitor's vcpus and tag is conflicted with existing * allocation and monitors. * + * A whole-process monitor must not be mixed with explicit monitors and may + * cover each resource type only once. + * * Returns 1 if @monitor->vcpus equals to @resctrl->vcpus, then the monitor * will share the underlying resctrl group with @resctrl->alloc. Returns -1 * if any conflict found. Returns 0 if no conflict and @monitor->vcpus is @@ -18875,17 +18880,40 @@ virDomainResctrlValidateMonitor(virDomainResctrlD= ef *resctrl, bool vcpus_overlap_no_resctrl =3D false; bool default_alloc_monitor =3D virResctrlAllocIsEmpty(resctrl->alloc); =20 + if (resctrl->nmonitors > 0 && + resctrl->monitors[0]->whole_process !=3D monitor->whole_process) { + virReportError(VIR_ERR_XML_ERROR, "%s", + _("Whole-process and explicit monitors cannot be mi= xed")); + return -1; + } + + if (monitor->whole_process) { + for (i =3D 0; i < resctrl->nmonitors; i++) { + if (resctrl->monitors[i]->tag =3D=3D monitor->tag) { + virReportError(VIR_ERR_XML_ERROR, "%s", + _("Duplicate whole-process monitor of the s= ame resource type")); + return -1; + } + } + + return 0; + } + if (virBitmapIsAllClear(monitor->vcpus)) { virReportError(VIR_ERR_INVALID_ARG, "%s", _("vcpus is empty")); return -1; } =20 - while ((vcpu =3D virBitmapNextSetBit(monitor->vcpus, vcpu)) >=3D 0) { - if (!virBitmapIsBitSet(resctrl->vcpus, vcpu)) { - virReportError(VIR_ERR_INVALID_ARG, "%s", - _("Monitor vcpus conflicts with allocation")); - return -1; + /* A whole-process allocation covers every thread, so it does not cons= train + * an explicit monitor's vcpus. */ + if (!resctrl->whole_process) { + while ((vcpu =3D virBitmapNextSetBit(monitor->vcpus, vcpu)) >=3D 0= ) { + if (!virBitmapIsBitSet(resctrl->vcpus, vcpu)) { + virReportError(VIR_ERR_INVALID_ARG, "%s", + _("Monitor vcpus conflicts with allocation"= )); + return -1; + } } } =20 @@ -18952,6 +18980,7 @@ virDomainResctrlMonDefParse(virDomainDef *def, =20 for (i =3D 0; i < n; i++) { g_autofree char *id =3D NULL; + bool whole_process =3D false; =20 domresmon =3D g_new0(virDomainResctrlMonDef, 1); =20 @@ -18977,27 +19006,41 @@ virDomainResctrlMonDefParse(virDomainDef *def, } } =20 - if (virDomainResctrlParseVcpus(def, nodes[i], &domresmon->vcpus) <= 0) + if (virDomainResctrlParseVcpus(def, nodes[i], &domresmon->vcpus, + &whole_process) < 0) goto cleanup; =20 + /* A monitor that omits vcpus inside an explicit allocation inheri= ts + * the allocation's vcpu scope instead of covering the whole proce= ss. */ + if (whole_process && !resctrl->whole_process) { + virBitmapFree(domresmon->vcpus); + domresmon->vcpus =3D virBitmapNewCopy(resctrl->vcpus); + whole_process =3D false; + } + + domresmon->whole_process =3D whole_process; + rv =3D virDomainResctrlValidateMonitor(resctrl, domresmon); if (rv < 0) goto cleanup; =20 - /* If monitor's vcpu list is identical to the vcpu list of the - * associated allocation, set monitor's id to the same value - * as the allocation. */ - if (rv =3D=3D 1) { - id =3D g_strdup(virResctrlAllocGetID(resctrl->alloc)); - } else { - g_autofree char *tmp =3D virBitmapFormat(domresmon->vcpus); + /* A whole-process monitor keeps its id unset, which selects the b= are + * machine name. Otherwise, if the monitor's vcpu list is identica= l to + * the vcpu list of the associated allocation, share the allocatio= n's + * id. */ + if (!whole_process) { + if (rv =3D=3D 1) { + id =3D g_strdup(virResctrlAllocGetID(resctrl->alloc)); + } else { + g_autofree char *tmp =3D virBitmapFormat(domresmon->vcpus); =20 - id =3D g_strdup_printf("vcpus_%s", tmp); + id =3D g_strdup_printf("vcpus_%s", tmp); + } } =20 virResctrlMonitorSetAlloc(domresmon->instance, resctrl->alloc); =20 - if (virResctrlMonitorSetID(domresmon->instance, id) < 0) + if (id && virResctrlMonitorSetID(domresmon->instance, id) < 0) goto cleanup; =20 VIR_APPEND_ELEMENT(resctrl->monitors, resctrl->nmonitors, domresmo= n); @@ -19014,39 +19057,64 @@ static virDomainResctrlDef * virDomainResctrlNew(xmlNodePtr node, virResctrlAlloc *alloc, virBitmap *vcpus, + bool whole_process, unsigned int flags) { virDomainResctrlDef *resctrl =3D NULL; g_autofree char *vcpus_str =3D NULL; g_autofree char *alloc_id =3D NULL; =20 - /* We need to format it back because we need to be consistent in the n= aming - * even when users specify some "sub-optimal" string there. */ - vcpus_str =3D virBitmapFormat(vcpus); + /* A whole-process group omits the "vcpus" suffix. */ + if (!whole_process) { + /* We need to format it back because we need to be consistent in t= he naming + * even when users specify some "sub-optimal" string there. */ + vcpus_str =3D virBitmapFormat(vcpus); =20 - if (!(flags & VIR_DOMAIN_DEF_PARSE_INACTIVE)) - alloc_id =3D virXMLPropString(node, "id"); + if (!(flags & VIR_DOMAIN_DEF_PARSE_INACTIVE)) + alloc_id =3D virXMLPropString(node, "id"); =20 - if (!alloc_id) { - /* The number of allocations is limited and the directory structur= e is flat, - * not hierarchical, so we need to have all same allocations in one - * directory, so it's nice to have it named appropriately. For no= w it's - * 'vcpus_...' but it's designed in order for it to be changeable = in the - * future (it's part of the status XML). */ - alloc_id =3D g_strdup_printf("vcpus_%s", vcpus_str); - } + if (!alloc_id) { + /* The number of allocations is limited and the directory stru= cture is flat, + * not hierarchical, so we need to have all same allocations i= n one + * directory, so it's nice to have it named appropriately. Fo= r now it's + * 'vcpus_...' but it's designed in order for it to be changea= ble in the + * future (it's part of the status XML). */ + alloc_id =3D g_strdup_printf("vcpus_%s", vcpus_str); + } =20 - if (virResctrlAllocSetID(alloc, alloc_id) < 0) - return NULL; + if (virResctrlAllocSetID(alloc, alloc_id) < 0) + return NULL; + } =20 resctrl =3D g_new0(virDomainResctrlDef, 1); resctrl->vcpus =3D virBitmapNewCopy(vcpus); + resctrl->whole_process =3D whole_process; resctrl->alloc =3D virObjectRef(alloc); =20 return resctrl; } =20 =20 +/* Whole-process and per-vcpu allocations cannot be mixed: assigning expli= cit + * vCPUs to their own group would pull them out of the whole-process group= . */ +static int +virDomainResctrlValidateScope(virDomainDef *def, + bool whole_process) +{ + size_t i; + + for (i =3D 0; i < def->nresctrls; i++) { + if (def->resctrls[i]->whole_process !=3D whole_process) { + virReportError(VIR_ERR_XML_ERROR, "%s", + _("Whole-process and per-vcpu resctrl allocatio= ns cannot be mixed")); + return -1; + } + } + + return 0; +} + + static int virDomainCachetuneDefParse(virDomainDef *def, xmlXPathContextPtr ctxt, @@ -19058,16 +19126,17 @@ virDomainCachetuneDefParse(virDomainDef *def, ssize_t i =3D 0; int n; int ret =3D -1; + bool whole_process =3D false; g_autoptr(virBitmap) vcpus =3D NULL; g_autofree xmlNodePtr *nodes =3D NULL; g_autoptr(virResctrlAlloc) alloc =3D NULL; =20 ctxt->node =3D node; =20 - if (virDomainResctrlParseVcpus(def, node, &vcpus) < 0) + if (virDomainResctrlParseVcpus(def, node, &vcpus, &whole_process) < 0) return -1; =20 - if (virBitmapIsAllClear(vcpus)) + if (!whole_process && virBitmapIsAllClear(vcpus)) return 0; =20 if ((n =3D virXPathNodeSet("./cache", ctxt, &nodes)) < 0) @@ -19082,6 +19151,9 @@ virDomainCachetuneDefParse(virDomainDef *def, return -1; } =20 + if (virDomainResctrlValidateScope(def, whole_process) < 0) + return -1; + if (!(alloc =3D virResctrlAllocNew())) return -1; =20 @@ -19090,7 +19162,7 @@ virDomainCachetuneDefParse(virDomainDef *def, return -1; } =20 - if (!(resctrl =3D virDomainResctrlNew(node, alloc, vcpus, flags))) + if (!(resctrl =3D virDomainResctrlNew(node, alloc, vcpus, whole_proces= s, flags))) return -1; =20 if (virDomainResctrlMonDefParse(def, ctxt, node, @@ -19426,15 +19498,16 @@ virDomainMemorytuneDefParse(virDomainDef *def, ssize_t i =3D 0; size_t nmons =3D 0; size_t ret =3D -1; + bool whole_process =3D false; =20 int n; =20 ctxt->node =3D node; =20 - if (virDomainResctrlParseVcpus(def, node, &vcpus) < 0) + if (virDomainResctrlParseVcpus(def, node, &vcpus, &whole_process) < 0) return -1; =20 - if (virBitmapIsAllClear(vcpus)) + if (!whole_process && virBitmapIsAllClear(vcpus)) return 0; =20 if ((n =3D virXPathNodeSet("./node", ctxt, &nodes)) < 0) @@ -19446,6 +19519,8 @@ virDomainMemorytuneDefParse(virDomainDef *def, if (resctrl) { alloc =3D virObjectRef(resctrl->alloc); } else { + if (virDomainResctrlValidateScope(def, whole_process) < 0) + return -1; if (!(alloc =3D virResctrlAllocNew())) return -1; } @@ -19461,7 +19536,8 @@ virDomainMemorytuneDefParse(virDomainDef *def, * just update the existing alloc information, which is done in above * virDomainMemorytuneDefParseMemory */ if (!resctrl) { - if (!(newresctrl =3D virDomainResctrlNew(node, alloc, vcpus, flags= ))) + if (!(newresctrl =3D virDomainResctrlNew(node, alloc, vcpus, + whole_process, flags))) return -1; =20 resctrl =3D newresctrl; @@ -19501,15 +19577,16 @@ virDomainEnergytuneDefParse(virDomainDef *def, virDomainResctrlDef *newresctrl =3D NULL; g_autoptr(virBitmap) vcpus =3D NULL; g_autoptr(virResctrlAlloc) alloc =3D NULL; + bool whole_process =3D false; size_t nmons; int ret =3D -1; =20 ctxt->node =3D node; =20 - if (virDomainResctrlParseVcpus(def, node, &vcpus) < 0) + if (virDomainResctrlParseVcpus(def, node, &vcpus, &whole_process) < 0) return -1; =20 - if (virBitmapIsAllClear(vcpus)) + if (!whole_process && virBitmapIsAllClear(vcpus)) return 0; =20 if (virDomainResctrlVcpuMatch(def, vcpus, &resctrl) < 0) @@ -19518,9 +19595,12 @@ virDomainEnergytuneDefParse(virDomainDef *def, if (resctrl) { alloc =3D virObjectRef(resctrl->alloc); } else { + if (virDomainResctrlValidateScope(def, whole_process) < 0) + return -1; if (!(alloc =3D virResctrlAllocNew())) return -1; - if (!(newresctrl =3D virDomainResctrlNew(node, alloc, vcpus, flags= ))) + if (!(newresctrl =3D virDomainResctrlNew(node, alloc, vcpus, + whole_process, flags))) return -1; resctrl =3D newresctrl; } @@ -28701,16 +28781,22 @@ virDomainResctrlMonDefFormatHelper(virDomainResct= rlMonDef *domresmon, if (domresmon->tag !=3D tag) return 0; =20 - virBufferAddLit(buf, "whole_process) { + virBufferAddLit(buf, "/>\n"); + return 0; + } + vcpus =3D virBitmapFormat(domresmon->vcpus); =20 - virBufferAsprintf(buf, "vcpus=3D'%s'/>\n", vcpus); + virBufferAsprintf(buf, " vcpus=3D'%s'/>\n", vcpus); =20 return 0; } @@ -28741,16 +28827,19 @@ virDomainCachetuneDefFormat(virBuffer *buf, if (!virBufferUse(&childrenBuf)) return 0; =20 - vcpus =3D virBitmapFormat(resctrl->vcpus); + /* A whole-process group has no vcpus and no id to format. */ + if (!resctrl->whole_process) { + vcpus =3D virBitmapFormat(resctrl->vcpus); =20 - virBufferAsprintf(&attrBuf, " vcpus=3D'%s'", vcpus); + virBufferAsprintf(&attrBuf, " vcpus=3D'%s'", vcpus); =20 - if (!(flags & VIR_DOMAIN_DEF_FORMAT_INACTIVE)) { - const char *alloc_id =3D virResctrlAllocGetID(resctrl->alloc); - if (!alloc_id) - return -1; + if (!(flags & VIR_DOMAIN_DEF_FORMAT_INACTIVE)) { + const char *alloc_id =3D virResctrlAllocGetID(resctrl->alloc); + if (!alloc_id) + return -1; =20 - virBufferAsprintf(&attrBuf, " id=3D'%s'", alloc_id); + virBufferAsprintf(&attrBuf, " id=3D'%s'", alloc_id); + } } =20 virXMLFormatElement(buf, "cachetune", &attrBuf, &childrenBuf); @@ -28798,16 +28887,19 @@ virDomainMemorytuneDefFormat(virBuffer *buf, if (!virBufferUse(&childrenBuf)) return 0; =20 - vcpus =3D virBitmapFormat(resctrl->vcpus); + /* A whole-process group has no vcpus and no id to format. */ + if (!resctrl->whole_process) { + vcpus =3D virBitmapFormat(resctrl->vcpus); =20 - virBufferAsprintf(&attrBuf, " vcpus=3D'%s'", vcpus); + virBufferAsprintf(&attrBuf, " vcpus=3D'%s'", vcpus); =20 - if (!(flags & VIR_DOMAIN_DEF_FORMAT_INACTIVE)) { - const char *alloc_id =3D virResctrlAllocGetID(resctrl->alloc); - if (!alloc_id) - return -1; + if (!(flags & VIR_DOMAIN_DEF_FORMAT_INACTIVE)) { + const char *alloc_id =3D virResctrlAllocGetID(resctrl->alloc); + if (!alloc_id) + return -1; =20 - virBufferAsprintf(&attrBuf, " id=3D'%s'", alloc_id); + virBufferAsprintf(&attrBuf, " id=3D'%s'", alloc_id); + } } =20 virXMLFormatElement(buf, "memorytune", &attrBuf, &childrenBuf); @@ -28836,15 +28928,18 @@ virDomainEnergytuneDefFormat(virBuffer *buf, if (!virBufferUse(&childrenBuf)) return 0; =20 - vcpus =3D virBitmapFormat(resctrl->vcpus); - virBufferAsprintf(&attrBuf, " vcpus=3D'%s'", vcpus); + /* A whole-process group has no vcpus and no id to format. */ + if (!resctrl->whole_process) { + vcpus =3D virBitmapFormat(resctrl->vcpus); + virBufferAsprintf(&attrBuf, " vcpus=3D'%s'", vcpus); =20 - if (!(flags & VIR_DOMAIN_DEF_FORMAT_INACTIVE)) { - const char *alloc_id =3D virResctrlAllocGetID(resctrl->alloc); - if (!alloc_id) - return -1; + if (!(flags & VIR_DOMAIN_DEF_FORMAT_INACTIVE)) { + const char *alloc_id =3D virResctrlAllocGetID(resctrl->alloc); + if (!alloc_id) + return -1; =20 - virBufferAsprintf(&attrBuf, " id=3D'%s'", alloc_id); + virBufferAsprintf(&attrBuf, " id=3D'%s'", alloc_id); + } } =20 virXMLFormatElement(buf, "energytune", &attrBuf, &childrenBuf); diff --git a/src/conf/domain_conf.h b/src/conf/domain_conf.h index 91f57de0f1..ed1c2ae8b0 100644 --- a/src/conf/domain_conf.h +++ b/src/conf/domain_conf.h @@ -2935,12 +2935,14 @@ struct _virDomainCputune { =20 struct _virDomainResctrlMonDef { virBitmap *vcpus; + bool whole_process; virResctrlMonitorType tag; virResctrlMonitor *instance; }; =20 struct _virDomainResctrlDef { virBitmap *vcpus; + bool whole_process; virResctrlAlloc *alloc; =20 virDomainResctrlMonDef **monitors; diff --git a/tests/genericxml2xmlindata/cachetune-monitor-empty-vcpus.xml b= /tests/genericxml2xmlindata/cachetune-monitor-empty-vcpus.xml new file mode 100644 index 0000000000..a79ad71635 --- /dev/null +++ b/tests/genericxml2xmlindata/cachetune-monitor-empty-vcpus.xml @@ -0,0 +1,30 @@ + + QEMUGuest1 + c7a5fdbd-edaf-9455-926a-d65c16db1809 + 219136 + 219136 + 4 + + + + + + + + hvm + + + + destroy + restart + destroy + + /usr/bin/qemu-system-i386 + + + + + + + + diff --git a/tests/genericxml2xmlindata/cachetune-monitor-inherit-alloc.xml= b/tests/genericxml2xmlindata/cachetune-monitor-inherit-alloc.xml new file mode 100644 index 0000000000..b8b0460d1f --- /dev/null +++ b/tests/genericxml2xmlindata/cachetune-monitor-inherit-alloc.xml @@ -0,0 +1,30 @@ + + QEMUGuest1 + c7a5fdbd-edaf-9455-926a-d65c16db1809 + 219136 + 219136 + 4 + + + + + + + + hvm + + + + destroy + restart + destroy + + /usr/bin/qemu-system-i386 + + + + + + + + diff --git a/tests/genericxml2xmlindata/cachetune-wholeprocess-duplicate.xm= l b/tests/genericxml2xmlindata/cachetune-wholeprocess-duplicate.xml new file mode 100644 index 0000000000..c828b659f7 --- /dev/null +++ b/tests/genericxml2xmlindata/cachetune-wholeprocess-duplicate.xml @@ -0,0 +1,32 @@ + + QEMUGuest1 + c7a5fdbd-edaf-9455-926a-d65c16db1809 + 219136 + 219136 + 4 + + + + + + + + + + hvm + + + + destroy + restart + destroy + + /usr/bin/qemu-system-i386 + + + + + + + + diff --git a/tests/genericxml2xmlindata/cachetune-wholeprocess-monitor-dupl= icate.xml b/tests/genericxml2xmlindata/cachetune-wholeprocess-monitor-dupli= cate.xml new file mode 100644 index 0000000000..898a51de87 --- /dev/null +++ b/tests/genericxml2xmlindata/cachetune-wholeprocess-monitor-duplicate.x= ml @@ -0,0 +1,31 @@ + + QEMUGuest1 + c7a5fdbd-edaf-9455-926a-d65c16db1809 + 219136 + 219136 + 4 + + + + + + + + + hvm + + + + destroy + restart + destroy + + /usr/bin/qemu-system-i386 + + + + + + + + diff --git a/tests/genericxml2xmlindata/cachetune-wholeprocess-monitors.xml= b/tests/genericxml2xmlindata/cachetune-wholeprocess-monitors.xml new file mode 100644 index 0000000000..550ae2df31 --- /dev/null +++ b/tests/genericxml2xmlindata/cachetune-wholeprocess-monitors.xml @@ -0,0 +1,31 @@ + + QEMUGuest1 + c7a5fdbd-edaf-9455-926a-d65c16db1809 + 219136 + 219136 + 4 + + + + + + + + + hvm + + + + destroy + restart + destroy + + /usr/bin/qemu-system-i386 + + + + + + + + diff --git a/tests/genericxml2xmlindata/energytune-colliding-monitor.xml b/= tests/genericxml2xmlindata/energytune-colliding-monitor.xml new file mode 100644 index 0000000000..f07da2620f --- /dev/null +++ b/tests/genericxml2xmlindata/energytune-colliding-monitor.xml @@ -0,0 +1,30 @@ + + QEMUGuest1 + c7a5fdbd-edaf-9455-926a-d65c16db1809 + 219136 + 219136 + 4 + + + + + + + + hvm + + + + destroy + restart + destroy + + /usr/bin/qemu-system-i386 + + + + + + + + diff --git a/tests/genericxml2xmlindata/energytune-wholeprocess.xml b/tests= /genericxml2xmlindata/energytune-wholeprocess.xml new file mode 100644 index 0000000000..ebac5e9bc9 --- /dev/null +++ b/tests/genericxml2xmlindata/energytune-wholeprocess.xml @@ -0,0 +1,29 @@ + + QEMUGuest1 + c7a5fdbd-edaf-9455-926a-d65c16db1809 + 219136 + 219136 + 4 + + + + + + + hvm + + + + destroy + restart + destroy + + /usr/bin/qemu-system-i386 + + + + + + + + diff --git a/tests/genericxml2xmlindata/memorytune-wholeprocess.xml b/tests= /genericxml2xmlindata/memorytune-wholeprocess.xml new file mode 100644 index 0000000000..496fccc7e6 --- /dev/null +++ b/tests/genericxml2xmlindata/memorytune-wholeprocess.xml @@ -0,0 +1,29 @@ + + QEMUGuest1 + c7a5fdbd-edaf-9455-926a-d65c16db1809 + 219136 + 219136 + 4 + + + + + + + hvm + + + + destroy + restart + destroy + + /usr/bin/qemu-system-i386 + + + + + + + + diff --git a/tests/genericxml2xmlindata/resctrl-wholeprocess-alloc-monitor.= xml b/tests/genericxml2xmlindata/resctrl-wholeprocess-alloc-monitor.xml new file mode 100644 index 0000000000..ad0a904dc7 --- /dev/null +++ b/tests/genericxml2xmlindata/resctrl-wholeprocess-alloc-monitor.xml @@ -0,0 +1,32 @@ + + QEMUGuest1 + c7a5fdbd-edaf-9455-926a-d65c16db1809 + 219136 + 219136 + 4 + + + + + + + + + + hvm + + + + destroy + restart + destroy + + /usr/bin/qemu-system-i386 + + + + + + + + diff --git a/tests/genericxml2xmlindata/resctrl-wholeprocess-layering.xml b= /tests/genericxml2xmlindata/resctrl-wholeprocess-layering.xml new file mode 100644 index 0000000000..aebd613d78 --- /dev/null +++ b/tests/genericxml2xmlindata/resctrl-wholeprocess-layering.xml @@ -0,0 +1,32 @@ + + QEMUGuest1 + c7a5fdbd-edaf-9455-926a-d65c16db1809 + 219136 + 219136 + 4 + + + + + + + + + + hvm + + + + destroy + restart + destroy + + /usr/bin/qemu-system-i386 + + + + + + + + diff --git a/tests/genericxml2xmlindata/resctrl-wholeprocess-monitors.xml b= /tests/genericxml2xmlindata/resctrl-wholeprocess-monitors.xml new file mode 100644 index 0000000000..35f20c6c11 --- /dev/null +++ b/tests/genericxml2xmlindata/resctrl-wholeprocess-monitors.xml @@ -0,0 +1,33 @@ + + QEMUGuest1 + c7a5fdbd-edaf-9455-926a-d65c16db1809 + 219136 + 219136 + 4 + + + + + + + + + + + hvm + + + + destroy + restart + destroy + + /usr/bin/qemu-system-i386 + + + + + + + + diff --git a/tests/genericxml2xmloutdata/cachetune-monitor-inherit-alloc.xm= l b/tests/genericxml2xmloutdata/cachetune-monitor-inherit-alloc.xml new file mode 100644 index 0000000000..70dcf39285 --- /dev/null +++ b/tests/genericxml2xmloutdata/cachetune-monitor-inherit-alloc.xml @@ -0,0 +1,30 @@ + + QEMUGuest1 + c7a5fdbd-edaf-9455-926a-d65c16db1809 + 219136 + 219136 + 4 + + + + + + + + hvm + + + + destroy + restart + destroy + + /usr/bin/qemu-system-i386 + + + + + + + + diff --git a/tests/genericxml2xmltest.c b/tests/genericxml2xmltest.c index 169c71efa3..8492a6266e 100644 --- a/tests/genericxml2xmltest.c +++ b/tests/genericxml2xmltest.c @@ -211,6 +211,17 @@ mymain(void) DO_TEST("cachetune-cdp"); DO_TEST("cachetune"); DO_TEST("energytune"); + DO_TEST("energytune-wholeprocess"); + DO_TEST("memorytune-wholeprocess"); + DO_TEST("cachetune-wholeprocess-monitors"); + DO_TEST("resctrl-wholeprocess-monitors"); + DO_TEST("resctrl-wholeprocess-alloc-monitor"); + DO_TEST_FAIL_INACTIVE("resctrl-wholeprocess-layering"); + DO_TEST_FAIL_INACTIVE("cachetune-wholeprocess-duplicate"); + DO_TEST_FAIL_INACTIVE("cachetune-wholeprocess-monitor-duplicate"); + DO_TEST_DIFFERENT("cachetune-monitor-inherit-alloc"); + DO_TEST_FAIL_INACTIVE("energytune-colliding-monitor"); + DO_TEST_FAIL_INACTIVE("cachetune-monitor-empty-vcpus"); DO_TEST_DIFFERENT("cachetune-extra-tunes"); DO_TEST_FAIL_INACTIVE("cachetune-colliding-allocs"); DO_TEST_FAIL_INACTIVE("cachetune-colliding-tunes"); --=20 2.43.0 --------------------------------------------------------------------- Intel Technology Poland sp. z o.o. ul. Slowackiego 173 | 80-298 Gdansk | Sad Rejonowy Gdansk Polnoc | VII Wydz= ial Gospodarczy Krajowego Rejestru Sadowego - KRS 101882 | NIP 957-07-52-31= 6 | Kapital zakladowy 200.000 PLN. Spolka oswiadcza, ze posiada status duzego przedsiebiorcy w rozumieniu usta= wy z dnia 8 marca 2013 r. o przeciwdzialaniu nadmiernym opoznieniom w trans= akcjach handlowych. Ta wiadomosc wraz z zalacznikami jest przeznaczona dla okreslonego adresata= i moze zawierac informacje poufne. W razie przypadkowego otrzymania tej wi= adomosci, prosimy o powiadomienie nadawcy oraz trwale jej usuniecie; jakiek= olwiek przegladanie lub rozpowszechnianie jest zabronione. This e-mail and any attachments may contain confidential material for the s= ole use of the intended recipient(s). If you are not the intended recipient= , please contact the sender and delete all copies; any review or distributi= on by others is strictly prohibited. From nobody Mon Aug 24 09:08:42 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of lists.libvirt.org designates 38.145.34.151 as permitted sender) client-ip=38.145.34.151; envelope-from=devel-bounces@lists.libvirt.org; helo=lists.libvirt.org; Authentication-Results: mx.zohomail.com; dkim=pass header.i=@intel.com; spf=pass (zohomail.com: domain of lists.libvirt.org designates 38.145.34.151 as permitted sender) smtp.mailfrom=devel-bounces@lists.libvirt.org; dmarc=pass(p=none dis=none) header.from=intel.com ARC-Seal: i=1; a=rsa-sha256; t=1786029623; cv=none; d=zohomail.com; s=zohoarc; b=QEuunFHDrb0GZS8FiadHWYwLPhJ02lIhvf0S1KCLb9Fbxp4N8mGluzm7KIQU0hf2LW3Da0+eTq/D2wsTJbzCa09AgqTt/dKIdtp6R73BxfuePNECbXIllbdcXfOXupY0EQIv9ypqrzs3mtlDdj7xyc+1bGBaoOEViDIjXlWaxSQ= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1786029623; h=Content-Type:Content-Transfer-Encoding:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Owner:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Subject:Subject:To:To:Message-Id:Reply-To:Cc; bh=wls5Qew/82CIEyUKjqyEfreVEP8ojFoTHL2ie2fcxeM=; b=eiT7CAgY1o+R2eKoqBRKePMfWgqTl2LGtSg/DdmiVuHL3kCjX6XmfIpOjKF9pnNkEATNuyQhapecYyUWZisLvckNUnc8b7R+aI+vkbTnXPjE7+n9w+uGLDx6ZZmjb3Vxgr445qPlNKiWi5GiA97DxDYOG9WAjDjEG91zmfHuyGk= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass header.i=@intel.com; spf=pass (zohomail.com: domain of lists.libvirt.org designates 38.145.34.151 as permitted sender) smtp.mailfrom=devel-bounces@lists.libvirt.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.libvirt.org (lists.libvirt.org [38.145.34.151]) by mx.zohomail.com with SMTPS id 1786029623154434.9267325539398; Thu, 6 Aug 2026 08:20:23 -0700 (PDT) Received: by lists.libvirt.org (Postfix, from userid 993) id 040373F875; Thu, 6 Aug 2026 11:20:22 -0400 (EDT) Received: from [172.19.199.10] (unknown [10.16.107.18]) by lists.libvirt.org (Postfix) with ESMTP id D3CDF418F0; Thu, 6 Aug 2026 11:13:59 -0400 (EDT) Received: by lists.libvirt.org (Postfix, from userid 993) id 77B273F96A; Thu, 6 Aug 2026 11:13:25 -0400 (EDT) Received: from mgamail.intel.com (mgamail.intel.com [198.175.65.20]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by lists.libvirt.org (Postfix) with ESMTPS id 38AF140473 for ; Thu, 6 Aug 2026 11:13:23 -0400 (EDT) Received: from orviesa001.jf.intel.com ([10.64.159.141]) by orvoesa112.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 06 Aug 2026 08:12:20 -0700 Received: from ubuntu.ger.corp.intel.com ([10.211.96.193]) by orviesa001.jf.intel.com with ESMTP; 06 Aug 2026 08:12:19 -0700 X-Spam-Checker-Version: SpamAssassin 4.0.1 (2024-03-26) on lists.libvirt.org X-Spam-Level: X-Spam-Status: No, score=-5.9 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED,SPF_HELO_NONE autolearn=unavailable autolearn_force=no version=4.0.1 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1786029203; x=1817565203; h=from:to:subject:date:message-id:in-reply-to:references: mime-version:content-transfer-encoding; bh=Ld+F+Ee5fiZD5uROQIj7ERjK99alp1Y4tcSjf8vm0hw=; b=W2Y5klJq7kQgTELS4HtGvoXXpemrVJx6ci44lUGoC1iSqn96F9mkzw/p KY8Ohac8jNm4OBLJaPsPChIb0/GrJ4oy2zREwCyT/Cjy/yW3OQwTDPCTn rMU7YggxOewoGmCWVdmWsiJPEC7zZUtf1fROu2hvMjXm8mF8GcpqO0Svm Wmj1SJ5YDgD0qiEk+wG/vAL75tH67RVgFoQt4o11IadlvgoZhoqA0HVgW usvcaSMyiSZka8Ez1sxSaEJKhA5s2rJM2kIEdnIF9tl7gBVbABpT2LSdW Qxmo/Za7Z0pibSAljvPmFg8m9LuHPmx+p7xaN1Yo82SmO7cNCHSpJ2GCO A==; X-CSE-ConnectionGUID: jS35c4NrSOeD7J0vPobcog== X-CSE-MsgGUID: OaRfag9gT7uhBXfMrhA3zQ== X-IronPort-AV: E=McAfee;i="6800,10657,11867"; a="86391739" X-IronPort-AV: E=Sophos;i="6.25,208,1779174000"; d="scan'208";a="86391739" X-CSE-ConnectionGUID: 843rS3kdSL+eYZv2GQROlw== X-CSE-MsgGUID: vxxfOc7gR4iQ4iMx9AeWzg== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.25,208,1779174000"; d="scan'208";a="300339936" From: Jedrzej Wasiukiewicz To: devel@lists.libvirt.org Subject: [PATCH 3/6] qemu: assign whole-process resctrl groups at domain start Date: Thu, 6 Aug 2026 17:11:38 +0200 Message-ID: <20260806151141.3986850-4-jedrzej.wasiukiewicz@intel.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20260806151141.3986850-1-jedrzej.wasiukiewicz@intel.com> References: <20260806151141.3986850-1-jedrzej.wasiukiewicz@intel.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Message-ID-Hash: ABJZ2G35VGTH5BK4P43XAXZSA6AFKK4X X-Message-ID-Hash: ABJZ2G35VGTH5BK4P43XAXZSA6AFKK4X X-MailFrom: jedrzej.wasiukiewicz@intel.com X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; loop; banned-address; header-match-devel.lists.libvirt.org-0; emergency; member-moderation; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header X-Mailman-Version: 3.3.10 Precedence: list List-Id: Development discussions about the libvirt library & tools Archived-At: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-ZohoMail-DKIM: pass (identity @intel.com) X-ZM-MESSAGEID: 1786029623950158500 Content-Type: text/plain; charset="utf-8" A whole-process resctrl group (allocation or monitor declared without vcpus) covers the entire emulator process rather than a set of vCPU threads. Assign the emulator PID to such groups during the pre-exec handshake in qemuProcessResctrlCreate, so every thread the QEMU process later spawns - vCPUs, iothreads, workers... - inherits the group. virResctrlDeterminePath now treats a NULL id as a whole-process group, resolving to the bare machine name with no id suffix. Signed-off-by: Jedrzej Wasiukiewicz --- src/qemu/qemu_process.c | 40 +++++++++++++++++++++++++++++++++++++--- src/util/virresctrl.c | 10 ++++------ 2 files changed, 41 insertions(+), 9 deletions(-) diff --git a/src/qemu/qemu_process.c b/src/qemu/qemu_process.c index b2506edce0..8907f4f0ec 100644 --- a/src/qemu/qemu_process.c +++ b/src/qemu/qemu_process.c @@ -2909,18 +2909,33 @@ qemuProcessResctrlCreate(virQEMUDriver *driver, =20 for (i =3D 0; i < vm->def->nresctrls; i++) { size_t j =3D 0; + virDomainResctrlDef *resctrl =3D vm->def->resctrls[i]; + if (virResctrlAllocCreate(caps->host.resctrl, - vm->def->resctrls[i]->alloc, + resctrl->alloc, priv->machineName) < 0) return -1; =20 - for (j =3D 0; j < vm->def->resctrls[i]->nmonitors; j++) { + /* A whole-process group covers every emulator thread. + * Assign the emulator PID now, while still in the pre-exec handsh= ake + * window, so the resctrl group is inherited by every thread the Q= EMU + * process subsequently spawns (vCPUs, iothreads, workers etc.). */ + if (resctrl->whole_process && + !virResctrlAllocIsEmpty(resctrl->alloc) && + virResctrlAllocAddPID(resctrl->alloc, vm->pid) < 0) + return -1; + + for (j =3D 0; j < resctrl->nmonitors; j++) { virDomainResctrlMonDef *mon =3D NULL; =20 - mon =3D vm->def->resctrls[i]->monitors[j]; + mon =3D resctrl->monitors[j]; if (virResctrlMonitorCreate(mon->instance, priv->machineName) < 0) return -1; + + if (mon->whole_process && + virResctrlMonitorAddPID(mon->instance, vm->pid) < 0) + return -1; } } =20 @@ -6265,6 +6280,25 @@ qemuProcessSetupVcpu(virDomainObj *vm, size_t j =3D 0; virDomainResctrlDef *ct =3D vm->def->resctrls[i]; =20 + /* A whole-process allocation covers every thread: its control gro= up is + * assigned the emulator PID once at startup and inherited by every + * thread, so per-vCPU threads need no allocation assignment here. + * Per-vCPU monitors underneath it, however, still need each vCPU'= s PID + * to carve out their own mon_group. */ + if (ct->whole_process) { + for (j =3D 0; j < ct->nmonitors; j++) { + mon =3D ct->monitors[j]; + + if (virBitmapIsBitSet(mon->vcpus, vcpuid)) { + if (virResctrlMonitorAddPID(mon->instance, vcpupid) < = 0) + return -1; + break; + } + } + + continue; + } + if (virBitmapIsBitSet(ct->vcpus, vcpuid)) { if (virResctrlAllocAddPID(ct->alloc, vcpupid) < 0) return -1; diff --git a/src/util/virresctrl.c b/src/util/virresctrl.c index 66df44fb58..d4728d2e7c 100644 --- a/src/util/virresctrl.c +++ b/src/util/virresctrl.c @@ -2287,12 +2287,10 @@ virResctrlDeterminePath(const char *parentpath, const char *prefix, const char *id) { - if (!id) { - virReportError(VIR_ERR_INTERNAL_ERROR, - _("Resctrl ID must be set before determining resctr= l parentpath=3D'%1$s' prefix=3D'%2$s'"), - parentpath, prefix); - return NULL; - } + /* A NULL id denotes a whole-process group, which uses the bare machine + * name with no id suffix. */ + if (!id) + return g_strdup_printf("%s/%s", parentpath, prefix); =20 return g_strdup_printf("%s/%s-%s", parentpath, prefix, id); } --=20 2.43.0 --------------------------------------------------------------------- Intel Technology Poland sp. z o.o. ul. Slowackiego 173 | 80-298 Gdansk | Sad Rejonowy Gdansk Polnoc | VII Wydz= ial Gospodarczy Krajowego Rejestru Sadowego - KRS 101882 | NIP 957-07-52-31= 6 | Kapital zakladowy 200.000 PLN. Spolka oswiadcza, ze posiada status duzego przedsiebiorcy w rozumieniu usta= wy z dnia 8 marca 2013 r. o przeciwdzialaniu nadmiernym opoznieniom w trans= akcjach handlowych. Ta wiadomosc wraz z zalacznikami jest przeznaczona dla okreslonego adresata= i moze zawierac informacje poufne. W razie przypadkowego otrzymania tej wi= adomosci, prosimy o powiadomienie nadawcy oraz trwale jej usuniecie; jakiek= olwiek przegladanie lub rozpowszechnianie jest zabronione. This e-mail and any attachments may contain confidential material for the s= ole use of the intended recipient(s). If you are not the intended recipient= , please contact the sender and delete all copies; any review or distributi= on by others is strictly prohibited. From nobody Mon Aug 24 09:08:42 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of lists.libvirt.org designates 38.145.34.151 as permitted sender) client-ip=38.145.34.151; envelope-from=devel-bounces@lists.libvirt.org; helo=lists.libvirt.org; Authentication-Results: mx.zohomail.com; dkim=pass header.i=@intel.com; spf=pass (zohomail.com: domain of lists.libvirt.org designates 38.145.34.151 as permitted sender) smtp.mailfrom=devel-bounces@lists.libvirt.org; dmarc=pass(p=none dis=none) header.from=intel.com ARC-Seal: i=1; a=rsa-sha256; t=1786029719; cv=none; d=zohomail.com; s=zohoarc; b=XHSU5uuPBYtZbeXToc8CJQ+c9SeOLMpjEVQUC6TK9/VA5TZaDEBe1A2o31Qfp2HWf6pt+pciuzMmpG1HsMsOxKtGudQ0u7oJ7gDrjDzpGOeUi6EyJy4mpEyz/zQmmIPnPg2M+wxxjtK8mUM6YlXtaUNXpEwKSeGb8Mh+6XvBWuU= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1786029719; h=Content-Type:Content-Transfer-Encoding:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Owner:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Subject:Subject:To:To:Message-Id:Reply-To:Cc; bh=WUkVU9Gxqy4bvdTUmEUizUmymS8m5W5TWswtVmBbnGY=; b=CAFFjYkNmDrbqmYAejTjPu0atvF02plkt16aVA4qDQQrWaecsgThEVaZo6JUBZUo+OQb6Fkr//rReg+/JdUylAqwlJPETleIeGvDOCyf/JQS0myAdgf2YfaE9gPbY985hxqn5AAOCZMFM6HC67MJm6s3+/xDBO8bi3b5Qqdaptg= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass header.i=@intel.com; spf=pass (zohomail.com: domain of lists.libvirt.org designates 38.145.34.151 as permitted sender) smtp.mailfrom=devel-bounces@lists.libvirt.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.libvirt.org (lists.libvirt.org [38.145.34.151]) by mx.zohomail.com with SMTPS id 1786029719524924.4206103771103; Thu, 6 Aug 2026 08:21:59 -0700 (PDT) Received: by lists.libvirt.org (Postfix, from userid 993) id 5E6B4418D3; Thu, 6 Aug 2026 11:21:58 -0400 (EDT) Received: from [172.19.199.10] (unknown [10.16.107.18]) by lists.libvirt.org (Postfix) with ESMTP id 58B9241D02; Thu, 6 Aug 2026 11:14:05 -0400 (EDT) Received: by lists.libvirt.org (Postfix, from userid 993) id DEFA53F96A; Thu, 6 Aug 2026 11:13:25 -0400 (EDT) Received: from mgamail.intel.com (mgamail.intel.com [198.175.65.20]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by lists.libvirt.org (Postfix) with ESMTPS id A7614417D7 for ; Thu, 6 Aug 2026 11:13:23 -0400 (EDT) Received: from orviesa001.jf.intel.com ([10.64.159.141]) by orvoesa112.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 06 Aug 2026 08:12:21 -0700 Received: from ubuntu.ger.corp.intel.com ([10.211.96.193]) by orviesa001.jf.intel.com with ESMTP; 06 Aug 2026 08:12:20 -0700 X-Spam-Checker-Version: SpamAssassin 4.0.1 (2024-03-26) on lists.libvirt.org X-Spam-Level: X-Spam-Status: No, score=-5.9 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED,SPF_HELO_NONE autolearn=unavailable autolearn_force=no version=4.0.1 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1786029204; x=1817565204; h=from:to:subject:date:message-id:in-reply-to:references: mime-version:content-transfer-encoding; bh=GMpKNnlW+nx3dUyS0XniYIIWGBx27A9muU5soNC378Q=; b=dNbvI+u7VdIvxKomp+LRGy2tbM0p4LaDhKwtmpaTcNHPnmw8QZ6EUNhl SwWTBB1BWfASvA/NkluAIkv7uGw9nZULIrvBFRdj7sEAtw/NJ2OxC5zsJ zIi3vaTNx5Z441qtR2hsDlga5g7GfNMQmMBmzijZDBhaKddTKr1JzjVux 6YAnax3JV1wnq4vyi3F4KzB2b2lwF6mi0w6Pf2kyNzznSN/lp8K660yGk XpYAb4tvQyRua2H0F94+7Y1BhvlTrdct9lyLWQh6j6uPcH6SNrqHxhG7x mMSkIZEraPvOKwkyE7giZNbgtCO9hUxnvBk94yrvJqePryXsPXzw2qGc6 w==; X-CSE-ConnectionGUID: TEr0FTfPRKGCBcDZ/eCW3Q== X-CSE-MsgGUID: aP2L4HqtQlyhCc9Fhnwb2g== X-IronPort-AV: E=McAfee;i="6800,10657,11867"; a="86391742" X-IronPort-AV: E=Sophos;i="6.25,208,1779174000"; d="scan'208";a="86391742" X-CSE-ConnectionGUID: mxT9dRkeSC2HGfaQIPQiqg== X-CSE-MsgGUID: wbpv+1fSTP28uB78mOuQZQ== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.25,208,1779174000"; d="scan'208";a="300339938" From: Jedrzej Wasiukiewicz To: devel@lists.libvirt.org Subject: [PATCH 4/6] qemu: fix resctrl monitor stats reporting the wrong group name Date: Thu, 6 Aug 2026 17:11:39 +0200 Message-ID: <20260806151141.3986850-5-jedrzej.wasiukiewicz@intel.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20260806151141.3986850-1-jedrzej.wasiukiewicz@intel.com> References: <20260806151141.3986850-1-jedrzej.wasiukiewicz@intel.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Message-ID-Hash: QLEIL7NVUZWYHF6HZZR4WBONNBFANIAH X-Message-ID-Hash: QLEIL7NVUZWYHF6HZZR4WBONNBFANIAH X-MailFrom: jedrzej.wasiukiewicz@intel.com X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; loop; banned-address; header-match-devel.lists.libvirt.org-0; emergency; member-moderation; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header X-Mailman-Version: 3.3.10 Precedence: list List-Id: Development discussions about the libvirt library & tools Archived-At: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-ZohoMail-DKIM: pass (identity @intel.com) X-ZM-MESSAGEID: 1786029720478158500 Content-Type: text/plain; charset="utf-8" qemuDomainGetResctrlMonData filled the monitor's reported name from virResctrlMonitorGetID(), the bare id parsed from the domain XML (e.g. "vcpus_0-1"). That is a bug and a duplicate: the id is only a fragment of the real resctrl group name and vcpus are already reported with the vcpus attribute. The group actually lives at mon_groups/-. Add virResctrlMonitorGetName(), which returns the basename of the monitor's resctrl path. The stats name now maps 1:1 to the mon_group directory backing the monitor. Signed-off-by: Jedrzej Wasiukiewicz --- src/libvirt_private.syms | 1 + src/qemu/qemu_driver.c | 2 +- src/util/virresctrl.c | 10 ++++++++++ src/util/virresctrl.h | 3 +++ 4 files changed, 15 insertions(+), 1 deletion(-) diff --git a/src/libvirt_private.syms b/src/libvirt_private.syms index c76e5cb08a..5f0f0951b5 100644 --- a/src/libvirt_private.syms +++ b/src/libvirt_private.syms @@ -3390,6 +3390,7 @@ virResctrlMonitorAddPID; virResctrlMonitorCreate; virResctrlMonitorDeterminePath; virResctrlMonitorGetID; +virResctrlMonitorGetName; virResctrlMonitorGetStats; virResctrlMonitorNew; virResctrlMonitorRemove; diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c index 44b41726fb..689456fd8b 100644 --- a/src/qemu/qemu_driver.c +++ b/src/qemu/qemu_driver.c @@ -17214,7 +17214,7 @@ qemuDomainGetResctrlMonData(virQEMUDriver *driver, * let this newly allocated memory buffer to be freed along wi= th * the free of 'res' */ res->vcpus =3D virBitmapFormat(domresmon->vcpus); - res->name =3D g_strdup(virResctrlMonitorGetID(monitor)); + res->name =3D virResctrlMonitorGetName(monitor); =20 if (virResctrlMonitorGetStats(monitor, (const char **)features, &res->stats, &res->nstats) < 0) diff --git a/src/util/virresctrl.c b/src/util/virresctrl.c index d4728d2e7c..80de5997fa 100644 --- a/src/util/virresctrl.c +++ b/src/util/virresctrl.c @@ -2585,6 +2585,16 @@ virResctrlMonitorGetID(virResctrlMonitor *monitor) } =20 =20 +char * +virResctrlMonitorGetName(virResctrlMonitor *monitor) +{ + if (!monitor->path) + return NULL; + + return g_path_get_basename(monitor->path); +} + + void virResctrlMonitorSetAlloc(virResctrlMonitor *monitor, virResctrlAlloc *alloc) diff --git a/src/util/virresctrl.h b/src/util/virresctrl.h index 2818b6e8cc..c12b521621 100644 --- a/src/util/virresctrl.h +++ b/src/util/virresctrl.h @@ -233,6 +233,9 @@ virResctrlMonitorSetID(virResctrlMonitor *monitor, const char * virResctrlMonitorGetID(virResctrlMonitor *monitor); =20 +char * +virResctrlMonitorGetName(virResctrlMonitor *monitor); + void virResctrlMonitorSetAlloc(virResctrlMonitor *monitor, virResctrlAlloc *alloc); --=20 2.43.0 --------------------------------------------------------------------- Intel Technology Poland sp. z o.o. ul. Slowackiego 173 | 80-298 Gdansk | Sad Rejonowy Gdansk Polnoc | VII Wydz= ial Gospodarczy Krajowego Rejestru Sadowego - KRS 101882 | NIP 957-07-52-31= 6 | Kapital zakladowy 200.000 PLN. Spolka oswiadcza, ze posiada status duzego przedsiebiorcy w rozumieniu usta= wy z dnia 8 marca 2013 r. o przeciwdzialaniu nadmiernym opoznieniom w trans= akcjach handlowych. Ta wiadomosc wraz z zalacznikami jest przeznaczona dla okreslonego adresata= i moze zawierac informacje poufne. W razie przypadkowego otrzymania tej wi= adomosci, prosimy o powiadomienie nadawcy oraz trwale jej usuniecie; jakiek= olwiek przegladanie lub rozpowszechnianie jest zabronione. This e-mail and any attachments may contain confidential material for the s= ole use of the intended recipient(s). If you are not the intended recipient= , please contact the sender and delete all copies; any review or distributi= on by others is strictly prohibited. From nobody Mon Aug 24 09:08:42 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of lists.libvirt.org designates 38.145.34.151 as permitted sender) client-ip=38.145.34.151; envelope-from=devel-bounces@lists.libvirt.org; helo=lists.libvirt.org; Authentication-Results: mx.zohomail.com; dkim=pass header.i=@intel.com; spf=pass (zohomail.com: domain of lists.libvirt.org designates 38.145.34.151 as permitted sender) smtp.mailfrom=devel-bounces@lists.libvirt.org; dmarc=pass(p=none dis=none) header.from=intel.com ARC-Seal: i=1; a=rsa-sha256; t=1786029550; cv=none; d=zohomail.com; s=zohoarc; b=YD6uFK3yQY4ydWuwhQH204i67+/naMnfFcyWE51Bvl4NReNSd8Fwx4OoUGg50LqmuphS8+TIaYTMCNlpktJcssipSqNp3JNt26YbHgYBP93sjjm9vmP6RfAqfdo4H5WJcxzpr9V2pWqX/gi+/l1bfLi9Yycwndc2bPTrK9nmrkk= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1786029550; h=Content-Type:Content-Transfer-Encoding:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Owner:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Subject:Subject:To:To:Message-Id:Reply-To:Cc; bh=EOr30V3g6dcYs+WiMm1MT/7c455L1mZJ73ikYb3fw2A=; b=A9q1iUpgcQjHSPdxHU4e8EQdq+jF+XbBO+zSO0LdfVB1u6cwSDS2YFyAcRjtJCPtXDbHG/5z+8woY0lOYa9p9+JUl+8nI53rfj0ebinmMeUR5R8Gv5dTIni9cXfrZ9WP2WGXma4DLMqkR1SsJyeWKEdv/noOCn/7rgvjXOed1uY= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass header.i=@intel.com; spf=pass (zohomail.com: domain of lists.libvirt.org designates 38.145.34.151 as permitted sender) smtp.mailfrom=devel-bounces@lists.libvirt.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.libvirt.org (lists.libvirt.org [38.145.34.151]) by mx.zohomail.com with SMTPS id 1786029550911348.2626219694149; Thu, 6 Aug 2026 08:19:10 -0700 (PDT) Received: by lists.libvirt.org (Postfix, from userid 993) id AB0A6417D0; Thu, 6 Aug 2026 11:19:09 -0400 (EDT) Received: from [172.19.199.10] (unknown [10.16.107.18]) by lists.libvirt.org (Postfix) with ESMTP id A42C341C20; Thu, 6 Aug 2026 11:13:53 -0400 (EDT) Received: by lists.libvirt.org (Postfix, from userid 993) id 5AFEA417D1; Thu, 6 Aug 2026 11:13:25 -0400 (EDT) Received: from mgamail.intel.com (mgamail.intel.com [198.175.65.20]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by lists.libvirt.org (Postfix) with ESMTPS id A751E417D2 for ; Thu, 6 Aug 2026 11:13:23 -0400 (EDT) Received: from orviesa001.jf.intel.com ([10.64.159.141]) by orvoesa112.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 06 Aug 2026 08:12:22 -0700 Received: from ubuntu.ger.corp.intel.com ([10.211.96.193]) by orviesa001.jf.intel.com with ESMTP; 06 Aug 2026 08:12:21 -0700 X-Spam-Checker-Version: SpamAssassin 4.0.1 (2024-03-26) on lists.libvirt.org X-Spam-Level: X-Spam-Status: No, score=-5.9 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED,SPF_HELO_NONE autolearn=unavailable autolearn_force=no version=4.0.1 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1786029204; x=1817565204; h=from:to:subject:date:message-id:in-reply-to:references: mime-version:content-transfer-encoding; bh=5ttFTTjAdi+kMiGkoxFpzKlBNiG8m+lVQRts2S9m4n4=; b=izhg/sLM5UWAsM7/bcUkNfxVoDcIvL7do1iACC2u9WWsmFG7p6rkPZ3Z 9I3h8BedGqYXqiNk8qHH8Sa5lP5W25dZA6MsgpcJm6xPBqynf3dgoanT6 8evVEaI4WZlVxLdgCVLs5qD/zGm5M94wCvOb9H+vlQWQ1pazMvzhDYc5H l3WLn7deBKTWXC0yDoAnsBoCy6qZLyizk0SOGgD13l30grsxtoOeQcYV/ U1xL0W/sNJMFZXy35p97BcPL+wNU+MFxVFrOafV6D4f5Nra5u+/k1JM6L f1vwYLp7geriQkmCUfUAJcacFLxUuvzqVCWskyLK0PxB9BKh3TeNI6gOj A==; X-CSE-ConnectionGUID: k5xaulUnTgeCLY3bRdvl5Q== X-CSE-MsgGUID: plNHv2fgTCGCWYVipK3CcQ== X-IronPort-AV: E=McAfee;i="6800,10657,11867"; a="86391745" X-IronPort-AV: E=Sophos;i="6.25,208,1779174000"; d="scan'208";a="86391745" X-CSE-ConnectionGUID: ZYrx6DDrQiKExb7nY0eMEg== X-CSE-MsgGUID: 27lH+jPeSJW/BEUQM6fdzA== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.25,208,1779174000"; d="scan'208";a="300339940" From: Jedrzej Wasiukiewicz To: devel@lists.libvirt.org Subject: [PATCH 5/6] qemu: clean up resctrl monitor domstats Date: Thu, 6 Aug 2026 17:11:40 +0200 Message-ID: <20260806151141.3986850-6-jedrzej.wasiukiewicz@intel.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20260806151141.3986850-1-jedrzej.wasiukiewicz@intel.com> References: <20260806151141.3986850-1-jedrzej.wasiukiewicz@intel.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Message-ID-Hash: 4F7EDMFSBR4UILTJVCJCNIBBRSIM42BO X-Message-ID-Hash: 4F7EDMFSBR4UILTJVCJCNIBBRSIM42BO X-MailFrom: jedrzej.wasiukiewicz@intel.com X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; loop; banned-address; header-match-devel.lists.libvirt.org-0; emergency; member-moderation; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header X-Mailman-Version: 3.3.10 Precedence: list List-Id: Development discussions about the libvirt library & tools Archived-At: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-ZohoMail-DKIM: pass (identity @intel.com) X-ZM-MESSAGEID: 1786029551619158500 Content-Type: text/plain; charset="utf-8" A whole-process monitor has no vcpu list, so omit the 'vcpus' field entirely for cache, memory bandwidth and energy monitors rather than reporting it as an empty string. Return early from the cache collector when there are no monitors, so that a monitor count is not reported when there is no data, matching the memory bandwidth and energy collectors. Signed-off-by: Jedrzej Wasiukiewicz --- src/qemu/qemu_driver.c | 27 +++++++++++++++++++-------- 1 file changed, 19 insertions(+), 8 deletions(-) diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c index 689456fd8b..3d1d7b8cb9 100644 --- a/src/qemu/qemu_driver.c +++ b/src/qemu/qemu_driver.c @@ -17212,8 +17212,10 @@ qemuDomainGetResctrlMonData(virQEMUDriver *driver, /* If virBitmapFormat successfully returns an vcpu string, then * res.vcpus is assigned with an memory space holding it, * let this newly allocated memory buffer to be freed along wi= th - * the free of 'res' */ - res->vcpus =3D virBitmapFormat(domresmon->vcpus); + * the free of 'res'. Leave vcpus as NULL to signal a whole-pr= ocess + * monitor. */ + if (!domresmon->whole_process) + res->vcpus =3D virBitmapFormat(domresmon->vcpus); res->name =3D virResctrlMonitorGetName(monitor); =20 if (virResctrlMonitorGetStats(monitor, (const char **)features, @@ -17263,8 +17265,10 @@ qemuDomainGetStatsMemoryBandwidth(virQEMUDriver *d= river, for (i =3D 0; i < nresdata; i++) { virTypedParamListAddString(params, resdata[i]->name, VIR_DOMAIN_STATS_MEMORY_BANDWIDTH_MONIT= OR_PREFIX "%zu" VIR_DOMAIN_STATS_MEMORY_BANDWIDTH_MONITOR_SUFFIX_NAME, i); - virTypedParamListAddString(params, resdata[i]->vcpus, - VIR_DOMAIN_STATS_MEMORY_BANDWIDTH_MONIT= OR_PREFIX "%zu" VIR_DOMAIN_STATS_MEMORY_BANDWIDTH_MONITOR_SUFFIX_VCPUS, i); + /* A whole-process monitor has no vcpu list; omit the field entire= ly. */ + if (resdata[i]->vcpus) + virTypedParamListAddString(params, resdata[i]->vcpus, + VIR_DOMAIN_STATS_MEMORY_BANDWIDTH_M= ONITOR_PREFIX "%zu" VIR_DOMAIN_STATS_MEMORY_BANDWIDTH_MONITOR_SUFFIX_VCPUS,= i); virTypedParamListAddUInt(params, resdata[i]->nstats, VIR_DOMAIN_STATS_MEMORY_BANDWIDTH_MONITOR= _PREFIX "%zu" VIR_DOMAIN_STATS_MEMORY_BANDWIDTH_MONITOR_SUFFIX_NODE_COUNT, = i); =20 @@ -17328,8 +17332,10 @@ qemuDomainGetStatsEnergy(virQEMUDriver *driver, =20 virTypedParamListAddString(params, resdata[i]->name, VIR_DOMAIN_STATS_CPU_ENERGY_MONITOR_PRE= FIX "%zu" VIR_DOMAIN_STATS_CPU_ENERGY_MONITOR_SUFFIX_NAME, i); - virTypedParamListAddString(params, resdata[i]->vcpus, - VIR_DOMAIN_STATS_CPU_ENERGY_MONITOR_PRE= FIX "%zu" VIR_DOMAIN_STATS_CPU_ENERGY_MONITOR_SUFFIX_VCPUS, i); + /* A whole-process monitor has no vcpu list; omit the field entire= ly. */ + if (resdata[i]->vcpus) + virTypedParamListAddString(params, resdata[i]->vcpus, + VIR_DOMAIN_STATS_CPU_ENERGY_MONITOR= _PREFIX "%zu" VIR_DOMAIN_STATS_CPU_ENERGY_MONITOR_SUFFIX_VCPUS, i); virTypedParamListAddUInt(params, resdata[i]->nstats, VIR_DOMAIN_STATS_CPU_ENERGY_MONITOR_PREFI= X "%zu" VIR_DOMAIN_STATS_CPU_ENERGY_MONITOR_SUFFIX_PKG_COUNT, i); =20 @@ -17376,14 +17382,19 @@ qemuDomainGetStatsCpuCache(virQEMUDriver *driver, return; } =20 + if (nresdata =3D=3D 0) + return; + virTypedParamListAddUInt(params, nresdata, VIR_DOMAIN_STATS_CPU_CACHE_MONITOR_COUNT); =20 for (i =3D 0; i < nresdata; i++) { virTypedParamListAddString(params, resdata[i]->name, VIR_DOMAIN_STATS_CPU_CACHE_MONITOR_PREF= IX "%zu" VIR_DOMAIN_STATS_CPU_CACHE_MONITOR_SUFFIX_NAME, i); - virTypedParamListAddString(params, resdata[i]->vcpus, - VIR_DOMAIN_STATS_CPU_CACHE_MONITOR_PREF= IX "%zu" VIR_DOMAIN_STATS_CPU_CACHE_MONITOR_SUFFIX_VCPUS, i); + /* A whole-process monitor has no vcpu list; omit the field entire= ly. */ + if (resdata[i]->vcpus) + virTypedParamListAddString(params, resdata[i]->vcpus, + VIR_DOMAIN_STATS_CPU_CACHE_MONITOR_= PREFIX "%zu" VIR_DOMAIN_STATS_CPU_CACHE_MONITOR_SUFFIX_VCPUS, i); virTypedParamListAddUInt(params, resdata[i]->nstats, VIR_DOMAIN_STATS_CPU_CACHE_MONITOR_PREFIX= "%zu" VIR_DOMAIN_STATS_CPU_CACHE_MONITOR_SUFFIX_BANK_COUNT, i); =20 --=20 2.43.0 --------------------------------------------------------------------- Intel Technology Poland sp. z o.o. ul. Slowackiego 173 | 80-298 Gdansk | Sad Rejonowy Gdansk Polnoc | VII Wydz= ial Gospodarczy Krajowego Rejestru Sadowego - KRS 101882 | NIP 957-07-52-31= 6 | Kapital zakladowy 200.000 PLN. Spolka oswiadcza, ze posiada status duzego przedsiebiorcy w rozumieniu usta= wy z dnia 8 marca 2013 r. o przeciwdzialaniu nadmiernym opoznieniom w trans= akcjach handlowych. Ta wiadomosc wraz z zalacznikami jest przeznaczona dla okreslonego adresata= i moze zawierac informacje poufne. W razie przypadkowego otrzymania tej wi= adomosci, prosimy o powiadomienie nadawcy oraz trwale jej usuniecie; jakiek= olwiek przegladanie lub rozpowszechnianie jest zabronione. This e-mail and any attachments may contain confidential material for the s= ole use of the intended recipient(s). If you are not the intended recipient= , please contact the sender and delete all copies; any review or distributi= on by others is strictly prohibited. From nobody Mon Aug 24 09:08:42 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of lists.libvirt.org designates 38.145.34.151 as permitted sender) client-ip=38.145.34.151; envelope-from=devel-bounces@lists.libvirt.org; helo=lists.libvirt.org; Authentication-Results: mx.zohomail.com; dkim=pass header.i=@intel.com; spf=pass (zohomail.com: domain of lists.libvirt.org designates 38.145.34.151 as permitted sender) smtp.mailfrom=devel-bounces@lists.libvirt.org; dmarc=pass(p=none dis=none) header.from=intel.com ARC-Seal: i=1; a=rsa-sha256; t=1786029771; cv=none; d=zohomail.com; s=zohoarc; b=LkTtaWj+rq/u/+pZQjvbRyEQiakCQ6QIo0iHLsdIKuDVaz6n01ioRmoNhdJxemVmcPkUFrLaGn7+W+ZlcCaHkwLSXNBkuwHiAn1yTkg2iGQwCO/4hbcybl3Yw573EXvEqAB0s4GKU9WURaOvRVBtNvzCGwE+r0qzpA+E7rJ5nuI= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1786029771; h=Content-Type:Content-Transfer-Encoding:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Owner:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Subject:Subject:To:To:Message-Id:Reply-To:Cc; bh=OYMScchmiJShAtOlpN29F5VjebA39bCgy/TbWhUlJ7c=; b=nP49pJmAXVz/it05iGOsJ/bsDg1JvRExnTIe4LZMSQnnlB5x5kW2vPn/b7gOi2Z2UvhJhAW/N1lI7nlqEMYHtsXgUpdZxsLvWRDp19Uj30UC0Vx7/UT9zf3N6xwAjNGamri4gGphw1VD7KHmBhv9XIx4Ti0pZJqSpuL1M2XLHK4= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass header.i=@intel.com; spf=pass (zohomail.com: domain of lists.libvirt.org designates 38.145.34.151 as permitted sender) smtp.mailfrom=devel-bounces@lists.libvirt.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.libvirt.org (lists.libvirt.org [38.145.34.151]) by mx.zohomail.com with SMTPS id 178602977147418.35699160900549; Thu, 6 Aug 2026 08:22:51 -0700 (PDT) Received: by lists.libvirt.org (Postfix, from userid 993) id 5F3CF418A6; Thu, 6 Aug 2026 11:22:50 -0400 (EDT) Received: from [172.19.199.10] (unknown [10.16.107.18]) by lists.libvirt.org (Postfix) with ESMTP id 66C4F41995; Thu, 6 Aug 2026 11:14:10 -0400 (EDT) Received: by lists.libvirt.org (Postfix, from userid 993) id 61E313FAF5; Thu, 6 Aug 2026 11:13:26 -0400 (EDT) Received: from mgamail.intel.com (mgamail.intel.com [198.175.65.20]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by lists.libvirt.org (Postfix) with ESMTPS id D45D03FA5C for ; Thu, 6 Aug 2026 11:13:24 -0400 (EDT) Received: from orviesa001.jf.intel.com ([10.64.159.141]) by orvoesa112.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 06 Aug 2026 08:12:23 -0700 Received: from ubuntu.ger.corp.intel.com ([10.211.96.193]) by orviesa001.jf.intel.com with ESMTP; 06 Aug 2026 08:12:22 -0700 X-Spam-Checker-Version: SpamAssassin 4.0.1 (2024-03-26) on lists.libvirt.org X-Spam-Level: X-Spam-Status: No, score=-5.9 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED,SPF_HELO_NONE autolearn=unavailable autolearn_force=no version=4.0.1 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1786029205; x=1817565205; h=from:to:subject:date:message-id:in-reply-to:references: mime-version:content-transfer-encoding; bh=z9he1t5RtIsJpR/ZWNxGnkFJSbB08EXORCRKIu2qllQ=; b=ljWNQCeQy9Hrwbo1aCAUaCRmYYwwqZLrp/M7KA4+azr93wO/c76R6zg5 XBqbzf2hSZopqaLejJr/wHkD97SdXZAyGjXcsn9eyxZAdsP6lg1iikK6R 0nU24cynoRuYsey/LlWquw3NArek26nmareRaKVUk9Sb/6DCvsN0MFTyc b6GV4prZXphioktxuBn1OJHP5v9FHzi7egMnCfMROB+dlQYa3D0Bql3XA 0NGECqwmcCo2bOJk5QhOMUsDpihf203IwOEGxWzJ/mBjEDciDdyWRM8jK 74at3eZ6ugnNvECNIcjDDMq5ndmx/Kgvsjbod+Fd2AHD0xtqZP4oWtE4q w==; X-CSE-ConnectionGUID: b/1UWFiYQbiB6Ta6rdMjbA== X-CSE-MsgGUID: fkEvSVm1Q8GWhsmyLyHoVQ== X-IronPort-AV: E=McAfee;i="6800,10657,11867"; a="86391748" X-IronPort-AV: E=Sophos;i="6.25,208,1779174000"; d="scan'208";a="86391748" X-CSE-ConnectionGUID: SSuCimVeRlS70fKTaWt+Lw== X-CSE-MsgGUID: LCMpD2KHSQ+K27Tzy+/sDQ== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.25,208,1779174000"; d="scan'208";a="300339941" From: Jedrzej Wasiukiewicz To: devel@lists.libvirt.org Subject: [PATCH 6/6] NEWS: Document whole-process resctrl support Date: Thu, 6 Aug 2026 17:11:41 +0200 Message-ID: <20260806151141.3986850-7-jedrzej.wasiukiewicz@intel.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20260806151141.3986850-1-jedrzej.wasiukiewicz@intel.com> References: <20260806151141.3986850-1-jedrzej.wasiukiewicz@intel.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Message-ID-Hash: UAH3DYY3TYU26JVQMOBPOMQZDGRHQFAG X-Message-ID-Hash: UAH3DYY3TYU26JVQMOBPOMQZDGRHQFAG X-MailFrom: jedrzej.wasiukiewicz@intel.com X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; loop; banned-address; header-match-devel.lists.libvirt.org-0; emergency; member-moderation; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header X-Mailman-Version: 3.3.10 Precedence: list List-Id: Development discussions about the libvirt library & tools Archived-At: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-ZohoMail-DKIM: pass (identity @intel.com) X-ZM-MESSAGEID: 1786029772717158500 Content-Type: text/plain; charset="utf-8" Signed-off-by: Jedrzej Wasiukiewicz --- NEWS.rst | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/NEWS.rst b/NEWS.rst index ae4d8c18a5..f3f2869b92 100644 --- a/NEWS.rst +++ b/NEWS.rst @@ -17,10 +17,21 @@ v12.7.0 (unreleased) =20 * **New features** =20 + * resctrl: Support whole-process allocations and monitoring + + The ``vcpus`` attribute of ``cachetune``, ``memorytune``, + ``energytune`` and ``monitor`` elements is now optional. When + omitted, the allocation or monitor applies to the entire QEMU + emulator process through resctrl inheritance mechanism. + * **Improvements** =20 * **Bug fixes** =20 + * qemu: Fix resctrl monitor reporting + + The resctrl monitor stats no longer reports cache monitor data when no + cache monitors are configured and uses correct monitor group names. =20 v12.6.0 (2026-08-03) =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --=20 2.43.0 --------------------------------------------------------------------- Intel Technology Poland sp. z o.o. ul. Slowackiego 173 | 80-298 Gdansk | Sad Rejonowy Gdansk Polnoc | VII Wydz= ial Gospodarczy Krajowego Rejestru Sadowego - KRS 101882 | NIP 957-07-52-31= 6 | Kapital zakladowy 200.000 PLN. Spolka oswiadcza, ze posiada status duzego przedsiebiorcy w rozumieniu usta= wy z dnia 8 marca 2013 r. o przeciwdzialaniu nadmiernym opoznieniom w trans= akcjach handlowych. Ta wiadomosc wraz z zalacznikami jest przeznaczona dla okreslonego adresata= i moze zawierac informacje poufne. W razie przypadkowego otrzymania tej wi= adomosci, prosimy o powiadomienie nadawcy oraz trwale jej usuniecie; jakiek= olwiek przegladanie lub rozpowszechnianie jest zabronione. This e-mail and any attachments may contain confidential material for the s= ole use of the intended recipient(s). If you are not the intended recipient= , please contact the sender and delete all copies; any review or distributi= on by others is strictly prohibited.