From nobody Sat May 11 05:05:09 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 216.205.24.124 as permitted sender) client-ip=216.205.24.124; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-delivery-124.mimecast.com; Authentication-Results: mx.zohomail.com; spf=pass (zohomail.com: domain of redhat.com designates 216.205.24.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=fail(p=none dis=none) header.from=intel.com ARC-Seal: i=1; a=rsa-sha256; t=1609917382; cv=none; d=zohomail.com; s=zohoarc; b=LvQ37+znB1E370vPOz5J0ERPpB9tMW0xQR6ELrSyPsJMuljbK3F7KbpP/VFc95WiWjq6Bu8foOeXBGIxi/ljJ62Jv7wUFOm+JUKeNH8sl2xQWZjlrMMhXHGpYmEOAa2OPqm1+Uy6oNCOCswAReUOEVxJ8D7w80kFN5mxsHy2ohw= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1609917382; h=Content-Type:Content-Transfer-Encoding:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=woMrpAcza3ys/KKqjtMIxVJdTiWJbEttJk2V8OgXHLo=; b=BVOAVkgKpmwnNZyVa0zxRAG2RhRliFjbcXMX5ODMbEKDxN9VFiryNy+T7YhRRYZHBKU3VGOK/ALGVYfKjM+RZeXK49inidyLs1fV4JRSfsZw4h47GbvJNn0RHQugoEid/ZEJ7619nHyNwQTz//B0eEqrId+kBidam/rlswl2ajg= ARC-Authentication-Results: i=1; mx.zohomail.com; spf=pass (zohomail.com: domain of redhat.com designates 216.205.24.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [216.205.24.124]) by mx.zohomail.com with SMTPS id 1609917382099873.3374677090728; Tue, 5 Jan 2021 23:16:22 -0800 (PST) Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-143-WYNCDCMhPGm-1-jQZTxgIw-1; Wed, 06 Jan 2021 02:16:17 -0500 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 3C8C3107ACF8; Wed, 6 Jan 2021 07:16:10 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.20]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 1B62071D6D; Wed, 6 Jan 2021 07:16:10 +0000 (UTC) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by colo-mx.corp.redhat.com (Postfix) with ESMTP id B1D5C1809CA2; Wed, 6 Jan 2021 07:16:09 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.rdu2.redhat.com [10.11.54.6]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 1067Fua9016723 for ; Wed, 6 Jan 2021 02:15:56 -0500 Received: by smtp.corp.redhat.com (Postfix) id 3D9B92166B29; Wed, 6 Jan 2021 07:15:56 +0000 (UTC) Received: from mimecast-mx02.redhat.com (mimecast06.extmail.prod.ext.rdu2.redhat.com [10.11.55.22]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 387752166B2D for ; Wed, 6 Jan 2021 07:15:53 +0000 (UTC) Received: from us-smtp-1.mimecast.com (us-smtp-delivery-1.mimecast.com [207.211.31.120]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-SHA384 (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id ACED9185A794 for ; Wed, 6 Jan 2021 07:15:53 +0000 (UTC) Received: from mga06.intel.com (mga06.intel.com [134.134.136.31]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-119-SPTz9M73Nd6zO-SscijCIQ-2; Wed, 06 Jan 2021 02:15:50 -0500 Received: from orsmga008.jf.intel.com ([10.7.209.65]) by orsmga104.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 05 Jan 2021 23:15:50 -0800 Received: from luyao-nuc7i7bnh.bj.intel.com ([10.238.154.184]) by orsmga008.jf.intel.com with ESMTP; 05 Jan 2021 23:15:49 -0800 X-MC-Unique: WYNCDCMhPGm-1-jQZTxgIw-1 X-MC-Unique: SPTz9M73Nd6zO-SscijCIQ-2 IronPort-SDR: k+5NtfZbEfZhD8zEhCsHkNXr9++LI7licM9YSeMHyG4fjgqYgfhXcBp0zSCmv7aGCmNih5+QbE plxZSvgAWpIA== X-IronPort-AV: E=McAfee;i="6000,8403,9855"; a="238790737" X-IronPort-AV: E=Sophos;i="5.78,479,1599548400"; d="scan'208";a="238790737" IronPort-SDR: 2rHV3x2GS3ZUbcZWkaoWK4FFAWDnhj9+yiyDJeAraUVWBmdgXYoUdSj00O4ja2pWE7DARMuFbE gSi8RSUNqHAw== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.78,479,1599548400"; d="scan'208";a="379183484" From: Luyao Zhong To: libvir-list@redhat.com Subject: [libvirt][PATCH v3 1/3] docs: add docs for 'restrictive' option for mode in numatune Date: Wed, 6 Jan 2021 15:14:24 +0800 Message-Id: <20210106071426.4092905-2-luyao.zhong@intel.com> In-Reply-To: <20210106071426.4092905-1-luyao.zhong@intel.com> References: <20210106071426.4092905-1-luyao.zhong@intel.com> MIME-Version: 1.0 X-Mimecast-Impersonation-Protect: Policy=CLT - Impersonation Protection Definition; Similar Internal Domain=false; Similar Monitored External Domain=false; Custom External Domain=false; Mimecast External Domain=false; Newly Observed Domain=false; Internal User Name=false; Custom Display Name List=false; Reply-to Address Mismatch=false; Targeted Threat Dictionary=false; Mimecast Threat Dictionary=false; Custom Threat Dictionary=false X-Scanned-By: MIMEDefang 2.78 on 10.11.54.6 X-loop: libvir-list@redhat.com X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=libvir-list-bounces@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" When user would like use cgroups to restrict the allowed memory nodes, and require not setting any specific memory policy, then 'restrictive' mode is useful. Reviewed-by: Daniel Henrique Barboza Signed-off-by: Luyao Zhong --- docs/formatdomain.rst | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/docs/formatdomain.rst b/docs/formatdomain.rst index 512939679b..3b6d71219a 100644 --- a/docs/formatdomain.rst +++ b/docs/formatdomain.rst @@ -1086,8 +1086,11 @@ NUMA Node Tuning ``memory`` The optional ``memory`` element specifies how to allocate memory for the domain process on a NUMA host. It contains several optional attributes. - Attribute ``mode`` is either 'interleave', 'strict', or 'preferred', de= faults - to 'strict'. Attribute ``nodeset`` specifies the NUMA nodes, using the = same + Attribute ``mode`` is either 'interleave', 'strict', 'preferred' or + 'restrictive', defaults to 'strict'. The value 'restrictive' specifies + using system default policy and only cgroups is used to restrict the + memory nodes, and it requires setting mode to 'restrictive' in ``memnod= e`` + elements. Attribute ``nodeset`` specifies the NUMA nodes, using the same syntax as attribute ``cpuset`` of element ``vcpu``. Attribute ``placeme= nt`` ( :since:`since 0.9.12` ) can be used to indicate the memory placement mo= de for domain process, its value can be either "static" or "auto", defaults to --=20 2.25.4 From nobody Sat May 11 05:05:09 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 216.205.24.124 as permitted sender) client-ip=216.205.24.124; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-delivery-124.mimecast.com; Authentication-Results: mx.zohomail.com; spf=pass (zohomail.com: domain of redhat.com designates 216.205.24.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=fail(p=none dis=none) header.from=intel.com ARC-Seal: i=1; a=rsa-sha256; t=1609917373; cv=none; d=zohomail.com; s=zohoarc; b=B5aY42AUEJ6CH7Kj60oJsgMkc5pNn5BlZxCyflqGVRTRLDMNKWWyIAazBxdawuZ/RTFRwtw2OqyTReEo3cHNqpMHSP/XfBpSf+mieEmh9H+lBLXONvxcB8Rr64lmsNnbHhsairY5ih0eO2pHLiQMX9pA7Nh0gSkdXMRfovHGteU= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1609917373; h=Content-Type:Content-Transfer-Encoding:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=QHqiSjQd8cE/udsjCe+2HeP50vuuo7XAzif8AiAidAQ=; b=hBuCMfWhZ6MK9cgfFqeEQ8PXOnhOzHFztCJ2rmjzXYabKQxoZNI7DHeWDkOUG8Aj+rVFWcoa4qgImMeutIo/jYeqheMNOym99LZU0jqt7Pch9HIB1q1IqEKu1KBIIGdwNmm7ou2B84ib7njumJB76klwYPSKnSbkAy6/Y+0P1fo= ARC-Authentication-Results: i=1; mx.zohomail.com; spf=pass (zohomail.com: domain of redhat.com designates 216.205.24.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [216.205.24.124]) by mx.zohomail.com with SMTPS id 1609917373788457.97905657703006; Tue, 5 Jan 2021 23:16:13 -0800 (PST) Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-533-hJWDEICXPQ-__TZWAKjKvQ-1; Wed, 06 Jan 2021 02:16:10 -0500 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 1D103801B12; Wed, 6 Jan 2021 07:16:04 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.21]) by smtp.corp.redhat.com (Postfix) with ESMTPS id BD2991971E; Wed, 6 Jan 2021 07:16:03 +0000 (UTC) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by colo-mx.corp.redhat.com (Postfix) with ESMTP id 82EA44BB7B; Wed, 6 Jan 2021 07:16:03 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.rdu2.redhat.com [10.11.54.3]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 1067FwZS016738 for ; Wed, 6 Jan 2021 02:15:58 -0500 Received: by smtp.corp.redhat.com (Postfix) id 619F9110F739; Wed, 6 Jan 2021 07:15:58 +0000 (UTC) Received: from mimecast-mx02.redhat.com (mimecast05.extmail.prod.ext.rdu2.redhat.com [10.11.55.21]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 5B489110F73B for ; Wed, 6 Jan 2021 07:15:55 +0000 (UTC) Received: from us-smtp-1.mimecast.com (us-smtp-delivery-1.mimecast.com [207.211.31.120]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-SHA384 (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id C52A88039DD for ; Wed, 6 Jan 2021 07:15:55 +0000 (UTC) Received: from mga06.intel.com (mga06.intel.com [134.134.136.31]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-119-nPXGQ54qN9mXK1qoLeLkRA-3; Wed, 06 Jan 2021 02:15:53 -0500 Received: from orsmga008.jf.intel.com ([10.7.209.65]) by orsmga104.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 05 Jan 2021 23:15:52 -0800 Received: from luyao-nuc7i7bnh.bj.intel.com ([10.238.154.184]) by orsmga008.jf.intel.com with ESMTP; 05 Jan 2021 23:15:51 -0800 X-MC-Unique: hJWDEICXPQ-__TZWAKjKvQ-1 X-MC-Unique: nPXGQ54qN9mXK1qoLeLkRA-3 IronPort-SDR: b0d+9SiVt2d5g5V4iOD6e8UddrqJ5ObSTRREQ9zVypoRBfUgZs5qTuzVkjM+CuaKbVTpbS0DD3 heAUSESZEL4w== X-IronPort-AV: E=McAfee;i="6000,8403,9855"; a="238790740" X-IronPort-AV: E=Sophos;i="5.78,479,1599548400"; d="scan'208";a="238790740" IronPort-SDR: pY5W5sa+jBzvBcAUvORcP0j2Zx0Kbq44y5kPz0+AySyzdpaD0Toj6RSPUn3xIoc7wqTDI05p0K aaIsrjI3gQ5Q== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.78,479,1599548400"; d="scan'208";a="379183490" From: Luyao Zhong To: libvir-list@redhat.com Subject: [libvirt][PATCH v3 2/3] schema: add 'restrictive' config option for mode in numatune Date: Wed, 6 Jan 2021 15:14:25 +0800 Message-Id: <20210106071426.4092905-3-luyao.zhong@intel.com> In-Reply-To: <20210106071426.4092905-1-luyao.zhong@intel.com> References: <20210106071426.4092905-1-luyao.zhong@intel.com> MIME-Version: 1.0 X-Mimecast-Impersonation-Protect: Policy=CLT - Impersonation Protection Definition; Similar Internal Domain=false; Similar Monitored External Domain=false; Custom External Domain=false; Mimecast External Domain=false; Newly Observed Domain=false; Internal User Name=false; Custom Display Name List=false; Reply-to Address Mismatch=false; Targeted Threat Dictionary=false; Mimecast Threat Dictionary=false; Custom Threat Dictionary=false X-Mimecast-Bulk-Signature: yes X-Mimecast-Spam-Signature: bulk X-Scanned-By: MIMEDefang 2.78 on 10.11.54.3 X-loop: libvir-list@redhat.com X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=libvir-list-bounces@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" support 'restrictive' mode in memory element and memnode element in numatune: ... ... Reviewed-by: Daniel Henrique Barboza Signed-off-by: Luyao Zhong --- docs/schemas/domaincommon.rng | 2 ++ 1 file changed, 2 insertions(+) diff --git a/docs/schemas/domaincommon.rng b/docs/schemas/domaincommon.rng index 17e25f14f2..aaec402658 100644 --- a/docs/schemas/domaincommon.rng +++ b/docs/schemas/domaincommon.rng @@ -1097,6 +1097,7 @@ strict preferred interleave + restrictive @@ -1129,6 +1130,7 @@ strict preferred interleave + restrictive --=20 2.25.4 From nobody Sat May 11 05:05:09 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 216.205.24.124 as permitted sender) client-ip=216.205.24.124; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-delivery-124.mimecast.com; Authentication-Results: mx.zohomail.com; spf=pass (zohomail.com: domain of redhat.com designates 216.205.24.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=fail(p=none dis=none) header.from=intel.com ARC-Seal: i=1; a=rsa-sha256; t=1609917382; cv=none; d=zohomail.com; s=zohoarc; b=Gjr2WqnXa6e0w2t0wbRgWWkEgf6FuNlemBGyV/Hn95EL1Qosx8qLtiDRWRU3bJo4cCpp54jpyzd/r5avWC8URIZzYf+bk/1BVcY7XgEej97/Y4YesCHMgERtKR22+6BBPu/UZep0v1bUK1KIfptLRQROzr8h8Yvw29lShlvsVng= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1609917382; h=Content-Type:Content-Transfer-Encoding:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=oznVE/XWQvO/KJVsOJuBQa/Of8MMYXcJAhh6u2aK21c=; b=V794eIaJsaeKV4VonP60OMRb82Y/B2Tq6PLUFIIeID7yyUny6/VvzMgt6QhICxqw8m3Y5I47zTf+ulw61t9hbrytc6g1tQqUEk6wOxtPiq+FEbGg/87Ht6lfIqvDtGTZbNICPuTY8MJv0mJXMJ2nuzO5m4bHxMwJ1RKZB7Nq7qU= ARC-Authentication-Results: i=1; mx.zohomail.com; spf=pass (zohomail.com: domain of redhat.com designates 216.205.24.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [216.205.24.124]) by mx.zohomail.com with SMTPS id 16099173827621009.5147800891008; Tue, 5 Jan 2021 23:16:22 -0800 (PST) Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-173-iST__bxgNbmlvQZqEe62UA-1; Wed, 06 Jan 2021 02:16:18 -0500 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id E4B7FE746; Wed, 6 Jan 2021 07:16:12 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.21]) by smtp.corp.redhat.com (Postfix) with ESMTPS id C16FB7216D; Wed, 6 Jan 2021 07:16:12 +0000 (UTC) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by colo-mx.corp.redhat.com (Postfix) with ESMTP id 8DB854E590; Wed, 6 Jan 2021 07:16:12 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.rdu2.redhat.com [10.11.54.5]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 1067G0uw016748 for ; Wed, 6 Jan 2021 02:16:01 -0500 Received: by smtp.corp.redhat.com (Postfix) id D9BAA94596; Wed, 6 Jan 2021 07:16:00 +0000 (UTC) Received: from mimecast-mx02.redhat.com (mimecast06.extmail.prod.ext.rdu2.redhat.com [10.11.55.22]) by smtp.corp.redhat.com (Postfix) with ESMTPS id D45BA946BA for ; Wed, 6 Jan 2021 07:15:58 +0000 (UTC) Received: from us-smtp-1.mimecast.com (us-smtp-1.mimecast.com [207.211.31.81]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-SHA384 (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 548F0185A7BC for ; Wed, 6 Jan 2021 07:15:58 +0000 (UTC) Received: from mga06.intel.com (mga06.intel.com [134.134.136.31]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-119-QQYn8HzaNoyd_RsbzEPPBw-4; Wed, 06 Jan 2021 02:15:55 -0500 Received: from orsmga008.jf.intel.com ([10.7.209.65]) by orsmga104.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 05 Jan 2021 23:15:55 -0800 Received: from luyao-nuc7i7bnh.bj.intel.com ([10.238.154.184]) by orsmga008.jf.intel.com with ESMTP; 05 Jan 2021 23:15:54 -0800 X-MC-Unique: iST__bxgNbmlvQZqEe62UA-1 X-MC-Unique: QQYn8HzaNoyd_RsbzEPPBw-4 IronPort-SDR: rlgjZmCjCYdwZo+ymKVveLVdHD5AWCX/13WzZ51fIQYFE2BaKVWblqihDWLKjTfUXN16kro6FU lq7tSxLEQHnQ== X-IronPort-AV: E=McAfee;i="6000,8403,9855"; a="238790745" X-IronPort-AV: E=Sophos;i="5.78,479,1599548400"; d="scan'208";a="238790745" IronPort-SDR: y4YEbGDzZjnf7EtRIhX1dmGkn/4NRtcS+LQDS8iuYqrh4ayQQs/aMvwfRDgW4dG0aM/kUTCbU0 bSnGTDbSm/Hg== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.78,479,1599548400"; d="scan'208";a="379183501" From: Luyao Zhong To: libvir-list@redhat.com Subject: [libvirt][PATCH v3 3/3] qemu: add parser and formatter for 'restrictive' mode in numatune Date: Wed, 6 Jan 2021 15:14:26 +0800 Message-Id: <20210106071426.4092905-4-luyao.zhong@intel.com> In-Reply-To: <20210106071426.4092905-1-luyao.zhong@intel.com> References: <20210106071426.4092905-1-luyao.zhong@intel.com> MIME-Version: 1.0 X-Mimecast-Impersonation-Protect: Policy=CLT - Impersonation Protection Definition; Similar Internal Domain=false; Similar Monitored External Domain=false; Custom External Domain=false; Mimecast External Domain=false; Newly Observed Domain=false; Internal User Name=false; Custom Display Name List=false; Reply-to Address Mismatch=false; Targeted Threat Dictionary=false; Mimecast Threat Dictionary=false; Custom Threat Dictionary=false X-Scanned-By: MIMEDefang 2.79 on 10.11.54.5 X-loop: libvir-list@redhat.com X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=libvir-list-bounces@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Reviewed-by: Daniel Henrique Barboza Signed-off-by: Luyao Zhong Tested-by: Meina Li --- include/libvirt/libvirt-domain.h | 1 + src/conf/numa_conf.c | 9 +++++ src/qemu/qemu_command.c | 6 ++- src/qemu/qemu_process.c | 27 +++++++++++++ src/util/virnuma.c | 3 ++ .../numatune-memnode-invalid-mode.err | 1 + .../numatune-memnode-invalid-mode.xml | 33 +++++++++++++++ ...emnode-restrictive-mode.x86_64-latest.args | 40 +++++++++++++++++++ .../numatune-memnode-restrictive-mode.xml | 33 +++++++++++++++ tests/qemuxml2argvtest.c | 2 + ...memnode-restrictive-mode.x86_64-latest.xml | 40 +++++++++++++++++++ tests/qemuxml2xmltest.c | 1 + 12 files changed, 195 insertions(+), 1 deletion(-) create mode 100644 tests/qemuxml2argvdata/numatune-memnode-invalid-mode.err create mode 100644 tests/qemuxml2argvdata/numatune-memnode-invalid-mode.xml create mode 100644 tests/qemuxml2argvdata/numatune-memnode-restrictive-mod= e.x86_64-latest.args create mode 100644 tests/qemuxml2argvdata/numatune-memnode-restrictive-mod= e.xml create mode 100644 tests/qemuxml2xmloutdata/numatune-memnode-restrictive-m= ode.x86_64-latest.xml diff --git a/include/libvirt/libvirt-domain.h b/include/libvirt/libvirt-dom= ain.h index de2456812c..eabb3c091b 100644 --- a/include/libvirt/libvirt-domain.h +++ b/include/libvirt/libvirt-domain.h @@ -1527,6 +1527,7 @@ typedef enum { VIR_DOMAIN_NUMATUNE_MEM_STRICT =3D 0, VIR_DOMAIN_NUMATUNE_MEM_PREFERRED =3D 1, VIR_DOMAIN_NUMATUNE_MEM_INTERLEAVE =3D 2, + VIR_DOMAIN_NUMATUNE_MEM_RESTRICTIVE =3D 3, =20 # ifdef VIR_ENUM_SENTINELS VIR_DOMAIN_NUMATUNE_MEM_LAST /* This constant is subject to change */ diff --git a/src/conf/numa_conf.c b/src/conf/numa_conf.c index f8a7a01ac9..df888a8dfb 100644 --- a/src/conf/numa_conf.c +++ b/src/conf/numa_conf.c @@ -43,6 +43,7 @@ VIR_ENUM_IMPL(virDomainNumatuneMemMode, "strict", "preferred", "interleave", + "restrictive", ); =20 VIR_ENUM_IMPL(virDomainNumatunePlacement, @@ -234,6 +235,14 @@ virDomainNumatuneNodeParseXML(virDomainNumaPtr numa, _("Invalid mode attribute in memnode elemen= t")); goto cleanup; } + + if (numa->memory.mode =3D=3D VIR_DOMAIN_NUMATUNE_MEM_RESTRICTI= VE && + mode !=3D VIR_DOMAIN_NUMATUNE_MEM_RESTRICTIVE) { + virReportError(VIR_ERR_XML_ERROR, "%s", + _("'restrictive' mode is required in memnod= e element " + "when mode is 'restrictive' in memory ele= ment")); + goto cleanup; + } VIR_FREE(tmp); mem_node->mode =3D mode; } diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c index b06a086e18..9bf2cc8ae8 100644 --- a/src/qemu/qemu_command.c +++ b/src/qemu/qemu_command.c @@ -174,6 +174,7 @@ VIR_ENUM_IMPL(qemuNumaPolicy, "bind", "preferred", "interleave", + "restricted", ); =20 =20 @@ -3159,7 +3160,10 @@ qemuBuildMemoryBackendProps(virJSONValuePtr *backend= Props, return -1; } =20 - if (nodemask) { + /* If mode is "restrictive", we should only use cgroups setting allowe= d memory + * nodes, and skip passing the host-nodes and policy parameters to QEM= U command + * line which means we will use system default memory policy. */ + if (nodemask && mode !=3D VIR_DOMAIN_NUMATUNE_MEM_RESTRICTIVE) { if (!virNumaNodesetIsAvailable(nodemask)) return -1; if (virJSONValueObjectAdd(props, diff --git a/src/qemu/qemu_process.c b/src/qemu/qemu_process.c index e7421b415f..0080985dd7 100644 --- a/src/qemu/qemu_process.c +++ b/src/qemu/qemu_process.c @@ -2713,6 +2713,7 @@ qemuProcessSetupPid(virDomainObjPtr vm, g_autoptr(virBitmap) hostcpumap =3D NULL; g_autofree char *mem_mask =3D NULL; int ret =3D -1; + size_t i; =20 if ((period || quota) && !virCgroupHasController(priv->cgroup, VIR_CGROUP_CONTROLLER_CPU)) { @@ -2753,6 +2754,32 @@ qemuProcessSetupPid(virDomainObjPtr vm, &mem_mask, -1) < 0) goto cleanup; =20 + /* For vCPU threads, mem_mask is different among cells and mem_mask + * is used to set cgroups cpuset.mems for vcpu threads. If we spec= ify + * 'restrictive' mode, that means we will set system default memory + * policy and only use cgroups to restrict allowed memory nodes. */ + if (nameval =3D=3D VIR_CGROUP_THREAD_VCPU) { + virDomainNumaPtr numatune =3D vm->def->numa; + virBitmapPtr numanode_cpumask =3D NULL; + for (i =3D 0; i < virDomainNumaGetNodeCount(numatune); i++) { + numanode_cpumask =3D virDomainNumaGetNodeCpumask(numatune,= i); + /* 'i' indicates the cell id, if the vCPU id is in this ce= ll + * and mode is 'restrictive', we need get the corresponding + * nodeset. */ + if (virBitmapIsBitSet(numanode_cpumask, id) && + virDomainNumatuneGetMode(numatune, i, &mem_mode) =3D= =3D 0 && + mem_mode =3D=3D VIR_DOMAIN_NUMATUNE_MEM_RESTRICTIVE) { + if (virDomainNumatuneMaybeFormatNodeset(numatune, + priv->autoNode= set, + &mem_mask, i) = < 0) { + goto cleanup; + } else { + break; + } + } + } + } + if (virCgroupNewThread(priv->cgroup, nameval, id, true, &cgroup) <= 0) goto cleanup; =20 diff --git a/src/util/virnuma.c b/src/util/virnuma.c index a05e4ac72c..ef912492c6 100644 --- a/src/util/virnuma.c +++ b/src/util/virnuma.c @@ -152,6 +152,9 @@ virNumaSetupMemoryPolicy(virDomainNumatuneMemMode mode, numa_set_interleave_mask(&mask); break; =20 + case VIR_DOMAIN_NUMATUNE_MEM_RESTRICTIVE: + break; + case VIR_DOMAIN_NUMATUNE_MEM_LAST: break; } diff --git a/tests/qemuxml2argvdata/numatune-memnode-invalid-mode.err b/tes= ts/qemuxml2argvdata/numatune-memnode-invalid-mode.err new file mode 100644 index 0000000000..180e64d1d8 --- /dev/null +++ b/tests/qemuxml2argvdata/numatune-memnode-invalid-mode.err @@ -0,0 +1 @@ +XML error: 'restrictive' mode is required in memnode element when mode is = 'restrictive' in memory element diff --git a/tests/qemuxml2argvdata/numatune-memnode-invalid-mode.xml b/tes= ts/qemuxml2argvdata/numatune-memnode-invalid-mode.xml new file mode 100644 index 0000000000..a7c18d4d50 --- /dev/null +++ b/tests/qemuxml2argvdata/numatune-memnode-invalid-mode.xml @@ -0,0 +1,33 @@ + + QEMUGuest + 9f4b6512-e73a-4a25-93e8-5307802821ce + 24682468 + 24682468 + 32 + + + + + + + hvm + + + + + + + + + + + destroy + restart + destroy + + /usr/bin/qemu-system-x86_64 + + + + + diff --git a/tests/qemuxml2argvdata/numatune-memnode-restrictive-mode.x86_6= 4-latest.args b/tests/qemuxml2argvdata/numatune-memnode-restrictive-mode.x8= 6_64-latest.args new file mode 100644 index 0000000000..1f15c4396e --- /dev/null +++ b/tests/qemuxml2argvdata/numatune-memnode-restrictive-mode.x86_64-lates= t.args @@ -0,0 +1,40 @@ +LC_ALL=3DC \ +PATH=3D/bin \ +HOME=3D/tmp/lib/domain--1-QEMUGuest \ +USER=3Dtest \ +LOGNAME=3Dtest \ +XDG_DATA_HOME=3D/tmp/lib/domain--1-QEMUGuest/.local/share \ +XDG_CACHE_HOME=3D/tmp/lib/domain--1-QEMUGuest/.cache \ +XDG_CONFIG_HOME=3D/tmp/lib/domain--1-QEMUGuest/.config \ +QEMU_AUDIO_DRV=3Dnone \ +/usr/bin/qemu-system-x86_64 \ +-name guest=3DQEMUGuest,debug-threads=3Don \ +-S \ +-object secret,id=3DmasterKey0,format=3Draw,\ +file=3D/tmp/lib/domain--1-QEMUGuest/master-key.aes \ +-machine pc,accel=3Dtcg,usb=3Doff,dump-guest-core=3Doff \ +-cpu qemu64 \ +-m 24105 \ +-overcommit mem-lock=3Doff \ +-smp 32,sockets=3D32,cores=3D1,threads=3D1 \ +-object memory-backend-ram,id=3Dram-node0,size=3D20971520 \ +-numa node,nodeid=3D0,cpus=3D0,memdev=3Dram-node0 \ +-object memory-backend-ram,id=3Dram-node1,size=3D676331520 \ +-numa node,nodeid=3D1,cpus=3D1-27,cpus=3D29,memdev=3Dram-node1 \ +-object memory-backend-ram,id=3Dram-node2,size=3D24578621440 \ +-numa node,nodeid=3D2,cpus=3D28,cpus=3D30-31,memdev=3Dram-node2 \ +-uuid 9f4b6512-e73a-4a25-93e8-5307802821ce \ +-display none \ +-no-user-config \ +-nodefaults \ +-chardev socket,id=3Dcharmonitor,fd=3D1729,server,nowait \ +-mon chardev=3Dcharmonitor,id=3Dmonitor,mode=3Dcontrol \ +-rtc base=3Dutc \ +-no-shutdown \ +-no-acpi \ +-boot strict=3Don \ +-device piix3-usb-uhci,id=3Dusb,bus=3Dpci.0,addr=3D0x1.0x2 \ +-device virtio-balloon-pci,id=3Dballoon0,bus=3Dpci.0,addr=3D0x2 \ +-sandbox on,obsolete=3Ddeny,elevateprivileges=3Ddeny,spawn=3Ddeny,\ +resourcecontrol=3Ddeny \ +-msg timestamp=3Don diff --git a/tests/qemuxml2argvdata/numatune-memnode-restrictive-mode.xml b= /tests/qemuxml2argvdata/numatune-memnode-restrictive-mode.xml new file mode 100644 index 0000000000..72949b0657 --- /dev/null +++ b/tests/qemuxml2argvdata/numatune-memnode-restrictive-mode.xml @@ -0,0 +1,33 @@ + + QEMUGuest + 9f4b6512-e73a-4a25-93e8-5307802821ce + 24682468 + 24682468 + 32 + + + + + + + hvm + + + + + + + + + + + destroy + restart + destroy + + /usr/bin/qemu-system-x86_64 + + + + + diff --git a/tests/qemuxml2argvtest.c b/tests/qemuxml2argvtest.c index 96a2b95331..e26197a30b 100644 --- a/tests/qemuxml2argvtest.c +++ b/tests/qemuxml2argvtest.c @@ -1994,6 +1994,8 @@ mymain(void) QEMU_CAPS_NUMA, QEMU_CAPS_OBJECT_MEMORY_RAM); DO_TEST_PARSE_ERROR("numatune-memnode", NONE); + DO_TEST_CAPS_LATEST("numatune-memnode-restrictive-mode"); + DO_TEST_PARSE_ERROR("numatune-memnode-invalid-mode", NONE); =20 DO_TEST("numatune-memnode-no-memory", QEMU_CAPS_NUMA, diff --git a/tests/qemuxml2xmloutdata/numatune-memnode-restrictive-mode.x86= _64-latest.xml b/tests/qemuxml2xmloutdata/numatune-memnode-restrictive-mode= .x86_64-latest.xml new file mode 100644 index 0000000000..e54b2483b1 --- /dev/null +++ b/tests/qemuxml2xmloutdata/numatune-memnode-restrictive-mode.x86_64-lat= est.xml @@ -0,0 +1,40 @@ + + QEMUGuest + 9f4b6512-e73a-4a25-93e8-5307802821ce + 24682468 + 24682468 + 32 + + + + + + + hvm + + + + qemu64 + + + + + + + + destroy + restart + destroy + + /usr/bin/qemu-system-x86_64 + +
+ + + + + +
+ + + diff --git a/tests/qemuxml2xmltest.c b/tests/qemuxml2xmltest.c index 1968be6782..dea11c2e5f 100644 --- a/tests/qemuxml2xmltest.c +++ b/tests/qemuxml2xmltest.c @@ -1098,6 +1098,7 @@ mymain(void) DO_TEST("numatune-distances", QEMU_CAPS_NUMA, QEMU_CAPS_NUMA_DIST); DO_TEST("numatune-no-vcpu", QEMU_CAPS_NUMA); DO_TEST("numatune-hmat", QEMU_CAPS_NUMA_HMAT, QEMU_CAPS_OBJECT_MEMORY_= RAM); + DO_TEST_CAPS_LATEST("numatune-memnode-restrictive-mode"); =20 DO_TEST("bios-nvram", NONE); DO_TEST("bios-nvram-os-interleave", NONE); --=20 2.25.4