From nobody Mon May 13 22:58:40 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=1609670583; cv=none; d=zohomail.com; s=zohoarc; b=PYQPDK+x4nMML242PYj/zBUVCeUrJ+rBCPyDQYZvRrae95BWVhNrz5JjItbM8aDISTsO+Ip+x1rDPqHvSuVsv8O85KljxE5AjPdew4G9mVM3kQDK7culeblSBo6fa1mRXW+gljINuwkvVph9E84gfWufVonDA2xZgL5qKoJ39Mo= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1609670583; 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=uXT4uQr62qZeblTSeZF8zM59fFCNgC6WgB2a8ieIQ3U=; b=K7EthrHedLfI6o/3ru78UeTA46seLTG1tg1XdpTo3ryTeUUg0xh/R0dM7Af5vwh0zHOEUC1nXOhCpg1CaDM7uUH9UIWXTFHn/X0nq69ijs/0+x+XejumVaZk8zdYjaTbMFQHz5tUZkTE0Lqk3HVv90bBKrS0vk250D4wF7zslMk= 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 1609670583467343.05863517642945; Sun, 3 Jan 2021 02:43:03 -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-229-vtTvOAHaMI2QdzNuokZBmg-1; Sun, 03 Jan 2021 05:42:00 -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 621478015A4; Sun, 3 Jan 2021 10:41:54 +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 B77135F9AC; Sun, 3 Jan 2021 10:41:53 +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 9BD251809C9F; Sun, 3 Jan 2021 10:41:49 +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 103AfldV001037 for ; Sun, 3 Jan 2021 05:41:48 -0500 Received: by smtp.corp.redhat.com (Postfix) id D25482166B2A; Sun, 3 Jan 2021 10:41:47 +0000 (UTC) Received: from mimecast-mx02.redhat.com (mimecast01.extmail.prod.ext.rdu2.redhat.com [10.11.55.17]) by smtp.corp.redhat.com (Postfix) with ESMTPS id CD19D2166B27 for ; Sun, 3 Jan 2021 10:41:43 +0000 (UTC) Received: from us-smtp-1.mimecast.com (us-smtp-1.mimecast.com [205.139.110.61]) (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 C4686858EEC for ; Sun, 3 Jan 2021 10:41:43 +0000 (UTC) Received: from mga04.intel.com (mga04.intel.com [192.55.52.120]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-416-PxXruRuqNxK7N5qq3bx2fg-2; Sun, 03 Jan 2021 05:41:41 -0500 Received: from orsmga008.jf.intel.com ([10.7.209.65]) by fmsmga104.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 03 Jan 2021 02:40:38 -0800 Received: from luyao-nuc7i7bnh.bj.intel.com ([10.238.154.184]) by orsmga008.jf.intel.com with ESMTP; 03 Jan 2021 02:40:38 -0800 X-MC-Unique: vtTvOAHaMI2QdzNuokZBmg-1 X-MC-Unique: PxXruRuqNxK7N5qq3bx2fg-2 IronPort-SDR: U8d3+O0BfxNH3TePB5pnWjSby7FgFP470840DgzElAXVqlZGgJAYs8X3Rl97Ir7ezOXfDN3bNW hWOlPjzfBQFw== X-IronPort-AV: E=McAfee;i="6000,8403,9852"; a="174284100" X-IronPort-AV: E=Sophos;i="5.78,471,1599548400"; d="scan'208";a="174284100" IronPort-SDR: k72sfOzvxVMzokQT2gtLdco5wQnDezHssS8f6MO7KUCTQjzoHmStSOAJh5zUhcbSApYFkpdEx4 VNv4wint2pXA== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.78,471,1599548400"; d="scan'208";a="377967858" From: Luyao Zhong To: libvir-list@redhat.com Subject: [libvirt][PATCH v2 1/3] docs: add docs for 'restrictive' option for mode in numatune Date: Sun, 3 Jan 2021 18:39:15 +0800 Message-Id: <20210103103917.3931266-2-luyao.zhong@intel.com> In-Reply-To: <20210103103917.3931266-1-luyao.zhong@intel.com> References: <20210103103917.3931266-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 --- 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 Mon May 13 22:58:40 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=1609670550; cv=none; d=zohomail.com; s=zohoarc; b=VC4ft6R0RhQPR5OQEkEYAdo7mx8cpLfXBZWT88YZMD00+p6Dxzj/B/D2bdvuEtnKu1EwfGX+RGEJI6hXHNE3i7aTmQ95B6vn4jxoyys7SQU6H7/v4KWrdnTcU7Gl1sq46T735UgMZHtJOSwLhBDW5mto6WyAgzr9xBiQkZB8zLo= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1609670550; 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=5uoJNySy5ix/OMc+/CnApvSg8gQ39fj2u4TTtlp7Kls=; b=NKbQehEmXbq36xMkVxGHtLsZWJRKrW//KjbqqdOMWodUTXRwkKXbHjI3BGJzsMc8OptDF8aNxNB2+wt8A7EKGPlrRY1fyYTURwr4NFilmG16ML8+ltpIGGT6sUNRG48CXFF79JfC+CnxW+Kvopn3oaSLe9iwtXrLKaL9L938V2E= 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 1609670550543958.2458071356299; Sun, 3 Jan 2021 02:42:30 -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-521-POLq73bCPm6_9Ge51LjQRA-1; Sun, 03 Jan 2021 05:42:27 -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 A77B2180A097; Sun, 3 Jan 2021 10:42:21 +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 660881C956; Sun, 3 Jan 2021 10:42:21 +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 330481809CA0; Sun, 3 Jan 2021 10:42:21 +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 103AfmB5001043 for ; Sun, 3 Jan 2021 05:41:49 -0500 Received: by smtp.corp.redhat.com (Postfix) id D5602112C077; Sun, 3 Jan 2021 10:41:48 +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 D14C8112C076 for ; Sun, 3 Jan 2021 10:41:44 +0000 (UTC) Received: from us-smtp-1.mimecast.com (us-smtp-2.mimecast.com [205.139.110.61]) (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 DBD388007DF for ; Sun, 3 Jan 2021 10:41:44 +0000 (UTC) Received: from mga04.intel.com (mga04.intel.com [192.55.52.120]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-416-M6GOVNpIN56rYsIrQAseYQ-3; Sun, 03 Jan 2021 05:41:42 -0500 Received: from orsmga008.jf.intel.com ([10.7.209.65]) by fmsmga104.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 03 Jan 2021 02:40:40 -0800 Received: from luyao-nuc7i7bnh.bj.intel.com ([10.238.154.184]) by orsmga008.jf.intel.com with ESMTP; 03 Jan 2021 02:40:39 -0800 X-MC-Unique: POLq73bCPm6_9Ge51LjQRA-1 X-MC-Unique: M6GOVNpIN56rYsIrQAseYQ-3 IronPort-SDR: LLUbLVUd6sn4oiNkXjulPA4IaDibxlzctV0T1y0jypRM5F2heLnUG21So1aoJCWezn5a+1cs+r TJLKQ98aS96A== X-IronPort-AV: E=McAfee;i="6000,8403,9852"; a="174284102" X-IronPort-AV: E=Sophos;i="5.78,471,1599548400"; d="scan'208";a="174284102" IronPort-SDR: vc69tVd2GpqAyRIcskp6t7Q6PutphzFPlRf8nD0Zy2fRr19ucUFfCkBfABloKpdEo6lB4kLitt jJZucwttirrw== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.78,471,1599548400"; d="scan'208";a="377967867" From: Luyao Zhong To: libvir-list@redhat.com Subject: [libvirt][PATCH v2 2/3] schema: add 'restrictive' config option for mode in numatune Date: Sun, 3 Jan 2021 18:39:16 +0800 Message-Id: <20210103103917.3931266-3-luyao.zhong@intel.com> In-Reply-To: <20210103103917.3931266-1-luyao.zhong@intel.com> References: <20210103103917.3931266-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 --- 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 Mon May 13 22:58:40 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=1609670524; cv=none; d=zohomail.com; s=zohoarc; b=ZlmBxokdAqcBl7yzbhi3Juoq6bZhW0hjHRHrEhNFSRjeVjmwv3SLcLbmqSWBZyHjdNKLIilOigc+leeHAN590aFIcHHq23aQReg+ZDTJIhRtHV0ESBWFi7SPnauupL5HW8G4dKaLpS7H+JrseYDg5FNqvXUperk7aH89F1783Kc= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1609670524; 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=YZurkPB9SdbGp3tl2Gbw+AwTXLUS378CiT+5/nLooSA=; b=dk6dCfc8u5U5LOeYJG5ulQr4y3N34HMgWyedFhBYWyNc/3MmlnYelnumffnxcfQRCoJT7EGMxW6EmpFXsLXqif7BdqlchfPr1JpSyCN+z53oiYe8etGD5NTRwZbJ1O1DuWVOqdp3UAt1f04xfmQzs3Cgt+ujLUaqY3Vg61aUrcA= 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 1609670524070570.1740409684903; Sun, 3 Jan 2021 02:42:04 -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-229-rna-UlXSPEW66Wcunz7ydQ-1; Sun, 03 Jan 2021 05:41:59 -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 5B825800D55; Sun, 3 Jan 2021 10:41:54 +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 0D05D1346D; Sun, 3 Jan 2021 10:41:54 +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 905FD4BB7B; Sun, 3 Jan 2021 10:41:50 +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 103AfmcR001042 for ; Sun, 3 Jan 2021 05:41:49 -0500 Received: by smtp.corp.redhat.com (Postfix) id 996AC2026D3C; Sun, 3 Jan 2021 10:41:48 +0000 (UTC) Received: from mimecast-mx02.redhat.com (mimecast04.extmail.prod.ext.rdu2.redhat.com [10.11.55.20]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 946DE2026D46 for ; Sun, 3 Jan 2021 10:41:48 +0000 (UTC) Received: from us-smtp-1.mimecast.com (us-smtp-delivery-1.mimecast.com [205.139.110.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 7B80D101A53F for ; Sun, 3 Jan 2021 10:41:48 +0000 (UTC) Received: from mga04.intel.com (mga04.intel.com [192.55.52.120]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-416-AyGeV2QCMH24Sc-lM3lCCg-4; Sun, 03 Jan 2021 05:41:46 -0500 Received: from orsmga008.jf.intel.com ([10.7.209.65]) by fmsmga104.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 03 Jan 2021 02:40:43 -0800 Received: from luyao-nuc7i7bnh.bj.intel.com ([10.238.154.184]) by orsmga008.jf.intel.com with ESMTP; 03 Jan 2021 02:40:42 -0800 X-MC-Unique: rna-UlXSPEW66Wcunz7ydQ-1 X-MC-Unique: AyGeV2QCMH24Sc-lM3lCCg-4 IronPort-SDR: a2EEW+z+tU9hM66ZPgBvuIWl5Mi0t65Ms58LLLbdg+XQblkcNP2UgOYWOZdPDTveNOwxKUjImO Idd1mKrVqGaQ== X-IronPort-AV: E=McAfee;i="6000,8403,9852"; a="174284105" X-IronPort-AV: E=Sophos;i="5.78,471,1599548400"; d="scan'208";a="174284105" IronPort-SDR: G165DCUBzTPKHRa0KyKaC5GhY9qYYSrCTXrnoejzfDSq0S0UgpPCVJ8P4cyfBRO2GT82NDTSBB YeaOEikSIVkg== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.78,471,1599548400"; d="scan'208";a="377967872" From: Luyao Zhong To: libvir-list@redhat.com Subject: [libvirt][PATCH v2 3/3] qemu: add parser and formatter for 'restrictive' mode in numatune Date: Sun, 3 Jan 2021 18:39:17 +0800 Message-Id: <20210103103917.3931266-4-luyao.zhong@intel.com> In-Reply-To: <20210103103917.3931266-1-luyao.zhong@intel.com> References: <20210103103917.3931266-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.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 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