From nobody Tue May 14 19:40:43 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 63.128.21.124 as permitted sender) client-ip=63.128.21.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 63.128.21.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=1608081261; cv=none; d=zohomail.com; s=zohoarc; b=kp9ZM9BGh0j+K57AtXvLqsW769qlXKMViWhorhkRS58s0PPzF6nhkgjY8L8uidoeDNG4IJSxl3qpkVEnRgG+IetVd1vhO30Y60EyngofXhtUgP9zmiq173FMGHHW7cFURE9KdOZYntDZze4kPENO9UHX/LfNkM69+ZiKNQyLIHQ= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1608081261; 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=dGaatSZfsMEp9x0ThaQ97INqcVTEEQB8hDKKWtLuhik=; b=gB1YS5zWDI3EpaMvGbGhYvRbfNhfa/ZBK1IuDj/FMPaMK5wIZZ9UDcAJJCgnGYqid83pW3aYLsu1vXYuxXMhQcguRBT7JyORDrjG+dNEbd9zK+cHFVCVM9jJAVdiZvJB3zZzL4JsaNqRaeZoyi38pYrxyEndb2N1FlAYDYITsqE= ARC-Authentication-Results: i=1; mx.zohomail.com; spf=pass (zohomail.com: domain of redhat.com designates 63.128.21.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 [63.128.21.124]) by mx.zohomail.com with SMTPS id 1608081261316662.9575475747333; Tue, 15 Dec 2020 17:14:21 -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-342-154VCeosMHeNYPq4DUrRHA-1; Tue, 15 Dec 2020 20:14:18 -0500 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 8ECFD1E7C4; Wed, 16 Dec 2020 01:14:12 +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 9B1C55D9E3; Wed, 16 Dec 2020 01:14:11 +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 23B9F18095C7; Wed, 16 Dec 2020 01:14:07 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.rdu2.redhat.com [10.11.54.4]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 0BG1E6mM025071 for ; Tue, 15 Dec 2020 20:14:06 -0500 Received: by smtp.corp.redhat.com (Postfix) id AD9282026D15; Wed, 16 Dec 2020 01:14:06 +0000 (UTC) Received: from mimecast-mx02.redhat.com (mimecast02.extmail.prod.ext.rdu2.redhat.com [10.11.55.18]) by smtp.corp.redhat.com (Postfix) with ESMTPS id A8C852026D5D for ; Wed, 16 Dec 2020 01:14:04 +0000 (UTC) Received: from us-smtp-1.mimecast.com (us-smtp-2.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 DFF0980018D for ; Wed, 16 Dec 2020 01:14:04 +0000 (UTC) Received: from mga18.intel.com (mga18.intel.com [134.134.136.126]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-505-u7yn3ni8PnOlEj6L39yQBg-2; Tue, 15 Dec 2020 20:14:02 -0500 Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by orsmga106.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 15 Dec 2020 17:14:01 -0800 Received: from luyao-nuc7i7bnh.bj.intel.com ([10.238.154.184]) by fmsmga002.fm.intel.com with ESMTP; 15 Dec 2020 17:14:01 -0800 X-MC-Unique: 154VCeosMHeNYPq4DUrRHA-1 X-MC-Unique: u7yn3ni8PnOlEj6L39yQBg-2 IronPort-SDR: pwYy4tx/KKtzCUckAfM6TQhrMF67LBqsY0nn3oWkmDDw4XSG3MzEtUOQ6vGToQ3VvJuSPGhYFB CQYTnTZaHYuA== X-IronPort-AV: E=McAfee;i="6000,8403,9836"; a="162728960" X-IronPort-AV: E=Sophos;i="5.78,423,1599548400"; d="scan'208";a="162728960" IronPort-SDR: iEuIOxMiMwI/9xPu1HI4ri9PxPq0ObbJ5dT+uS2Q98XRf171//0bObciJP0P28gpEH6bKqV0Co OaayvU/+zyIg== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.78,423,1599548400"; d="scan'208";a="385804159" From: Luyao Zhong To: libvir-list@redhat.com Subject: [libvirt][PATCH v1 1/3] docs: add docs for 'restrictive' option for mode in numatune Date: Wed, 16 Dec 2020 09:12:59 +0800 Message-Id: <20201216011301.3143844-2-luyao.zhong@intel.com> In-Reply-To: <20201216011301.3143844-1-luyao.zhong@intel.com> References: <20201216011301.3143844-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.4 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.14 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 --- docs/formatdomain.rst | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/docs/formatdomain.rst b/docs/formatdomain.rst index ff64996af2..90abe27d30 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 Tue May 14 19:40:43 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 170.10.133.124 as permitted sender) client-ip=170.10.133.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 170.10.133.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=1608081277; cv=none; d=zohomail.com; s=zohoarc; b=oDTTx0RiGB829ustLe6GFKzL/We4de/+2kMBVlGeX/NpBf+O9uP+cr0yWFFKl1FQkmmDZDggPFcywCmRSaAD5TMsMYBrNSvbcdK3eIlQkS5gL3kHgshVrclgph2yzfijFuP8dSWRjOLJJEIcDVzSpv517yIwDlR4l/+mznH7zKI= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1608081277; 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=RzewfbK2kht6J9g81qvRhALEzaFYQ6AM4bJytszbKF0=; b=YiNmGSo1l+4kxlIn0yFjQ+rViX8iGWofpBQMSC9FKJboVVVSwHCRErsRrLv18aU2lbrEBQIxWNzKFxNZqqTRvIO7TYB8LeTP+NOcZGV0z21rvxAsn84QqA/FNQrnNLh/JwplkVJ15o69JtMYvfO0WayBEALaN5o4R4io6RuVZAg= ARC-Authentication-Results: i=1; mx.zohomail.com; spf=pass (zohomail.com: domain of redhat.com designates 170.10.133.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 [170.10.133.124]) by mx.zohomail.com with SMTPS id 1608081277762397.26254710774697; Tue, 15 Dec 2020 17:14:37 -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-6-wqMYLBcOMGGwCYBxjJStIA-1; Tue, 15 Dec 2020 20:14:34 -0500 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id F315E100C601; Wed, 16 Dec 2020 01:14:28 +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 A77865D9E3; Wed, 16 Dec 2020 01:14:28 +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 3D03B4E58F; Wed, 16 Dec 2020 01:14:27 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.rdu2.redhat.com [10.11.54.4]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 0BG1E9MV025093 for ; Tue, 15 Dec 2020 20:14:09 -0500 Received: by smtp.corp.redhat.com (Postfix) id 3704E2026D48; Wed, 16 Dec 2020 01:14:09 +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 31DD22026D46 for ; Wed, 16 Dec 2020 01:14:09 +0000 (UTC) Received: from us-smtp-1.mimecast.com (us-smtp-2.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 2210E800969 for ; Wed, 16 Dec 2020 01:14:09 +0000 (UTC) Received: from mga18.intel.com (mga18.intel.com [134.134.136.126]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-505-lkCcQr1BPrGwp5qPQPpPsw-3; Tue, 15 Dec 2020 20:14:06 -0500 Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by orsmga106.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 15 Dec 2020 17:14:05 -0800 Received: from luyao-nuc7i7bnh.bj.intel.com ([10.238.154.184]) by fmsmga002.fm.intel.com with ESMTP; 15 Dec 2020 17:14:05 -0800 X-MC-Unique: wqMYLBcOMGGwCYBxjJStIA-1 X-MC-Unique: lkCcQr1BPrGwp5qPQPpPsw-3 IronPort-SDR: kmi19ximWEN9rhJsDlP7kEY95AwaeIpOEfjyS9+DN0w7+ICFD0MeuDPc446131RVkxmGwg2cYq +CZrHOh9Tn+g== X-IronPort-AV: E=McAfee;i="6000,8403,9836"; a="162728965" X-IronPort-AV: E=Sophos;i="5.78,423,1599548400"; d="scan'208";a="162728965" IronPort-SDR: E/KH2KqcGweJ90r0smG5kraPd+oc1no9G+D8YT0tmgG8UZhB7Nq8xvrOWRCgztNhuw8fTv0Xst zRZLeWa7OSwA== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.78,423,1599548400"; d="scan'208";a="385804177" From: Luyao Zhong To: libvir-list@redhat.com Subject: [libvirt][PATCH v1 2/3] schema: add 'restrictive' config option for mode in numatune Date: Wed, 16 Dec 2020 09:13:00 +0800 Message-Id: <20201216011301.3143844-3-luyao.zhong@intel.com> In-Reply-To: <20201216011301.3143844-1-luyao.zhong@intel.com> References: <20201216011301.3143844-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.4 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.14 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 --- docs/schemas/domaincommon.rng | 2 ++ 1 file changed, 2 insertions(+) diff --git a/docs/schemas/domaincommon.rng b/docs/schemas/domaincommon.rng index 795b654feb..bf1c406e37 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 Tue May 14 19:40:43 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=1608081267; cv=none; d=zohomail.com; s=zohoarc; b=B2y3EZv/+bMr4A2trwBg4AVAdwFbliF/T+GjxmoJQEi6/It2QfnZknl5+vecX4hjcpNrymeOKjYJfNjtT2sJCqBKc+YHAyn0PaOiJvAO/vSPN9d0/nmTVH8bKGoz9eAJMAV7r0ZYu/7TEPo1ow9p8l2PHo67WrZLAQERwI9SkAc= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1608081267; 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=FZ4h2IrmS7jLditXjwHad9g+4FOyuKIM7BXRAe0mX7g=; b=oF+TgUb0DssJEw78frfHCQnGly97G2A5C9qmECeOg0R5sWcydzo+8wD1LBGCcsLymEZAbMDFMBGu99LR6ppJdLYafqVRqP7cORtNbZNbKAoR+vtjhRuGhadOyZO6LuPBD9DvvHst0Z75x4F4lwU1Zpkp4YCEmggRlk7ILs6xicg= 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 1608081266649345.76129222465386; Tue, 15 Dec 2020 17:14:26 -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-165-fHI_1advOlmCyEIlTgpU4Q-1; Tue, 15 Dec 2020 20:14:23 -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 DE6EB107ACE4; Wed, 16 Dec 2020 01:14:16 +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 94F7919172; Wed, 16 Dec 2020 01:14:16 +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 5AF974BB7B; Wed, 16 Dec 2020 01:14:16 +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 0BG1EE27025112 for ; Tue, 15 Dec 2020 20:14:15 -0500 Received: by smtp.corp.redhat.com (Postfix) id D495E951D8; Wed, 16 Dec 2020 01:14:14 +0000 (UTC) Received: from mimecast-mx02.redhat.com (mimecast02.extmail.prod.ext.rdu2.redhat.com [10.11.55.18]) by smtp.corp.redhat.com (Postfix) with ESMTPS id CDA50A37AC for ; Wed, 16 Dec 2020 01:14:11 +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 3F420800B3B for ; Wed, 16 Dec 2020 01:14:11 +0000 (UTC) Received: from mga18.intel.com (mga18.intel.com [134.134.136.126]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-505-6vyd_zuyMIqyjgwdhG3LRg-4; Tue, 15 Dec 2020 20:14:08 -0500 Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by orsmga106.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 15 Dec 2020 17:14:08 -0800 Received: from luyao-nuc7i7bnh.bj.intel.com ([10.238.154.184]) by fmsmga002.fm.intel.com with ESMTP; 15 Dec 2020 17:14:07 -0800 X-MC-Unique: fHI_1advOlmCyEIlTgpU4Q-1 X-MC-Unique: 6vyd_zuyMIqyjgwdhG3LRg-4 IronPort-SDR: i/s4Np05wLU4z9wRKaqfJ1RIMVh7q7peW3YSioSFwb0mdmG9/bKA1Q/lhkCH0jbWyO11ZAPBQA iyGStUSH9hdA== X-IronPort-AV: E=McAfee;i="6000,8403,9836"; a="162728969" X-IronPort-AV: E=Sophos;i="5.78,423,1599548400"; d="scan'208";a="162728969" IronPort-SDR: vFvuos6vefQFinP075eyDBdnVRkRw1ppgwDii0AvCgrUmH8chexSNNuFolbkOgKT+vI8Rdi9zG /1xy2rXbL0jw== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.78,423,1599548400"; d="scan'208";a="385804200" From: Luyao Zhong To: libvir-list@redhat.com Subject: [libvirt][PATCH v1 3/3] qemu: add parser and formatter for 'restrictive' mode in numatune Date: Wed, 16 Dec 2020 09:13:01 +0800 Message-Id: <20201216011301.3143844-4-luyao.zhong@intel.com> In-Reply-To: <20201216011301.3143844-1-luyao.zhong@intel.com> References: <20201216011301.3143844-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 --- 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 b929877643..309040bf97 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 479bcc0b0c..c0eff6cb12 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 @@ -3138,7 +3139,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 579b3c3713..8c260883d9 100644 --- a/src/qemu/qemu_process.c +++ b/src/qemu/qemu_process.c @@ -2709,6 +2709,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)) { @@ -2749,6 +2750,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 corresonding + * 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 42d147243e..d2080a82bd 100644 --- a/tests/qemuxml2argvtest.c +++ b/tests/qemuxml2argvtest.c @@ -1992,6 +1992,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 c006719dee..ee6cef2e32 100644 --- a/tests/qemuxml2xmltest.c +++ b/tests/qemuxml2xmltest.c @@ -1096,6 +1096,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