From nobody Wed May 8 20:04:10 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=1618295836; cv=none; d=zohomail.com; s=zohoarc; b=KKQiZ4R18jDUVSiFk1qBq2kQ1OLoMrzUf5fHxQwebVJJAGA+jca5RmEVQQVlpFmyHqUoRTRd+Udu7IthII7ob6wWI0zS9nNv16ZxtaWo6UoaLEiiuEyNSS2cFhJKQeR6VHRBTyFZv2KI49qYYu4CxYD0V3WTq/yWNiGgyo43cNQ= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1618295836; h=Content-Type:Content-Transfer-Encoding:Cc: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=2dyP/YTIlgsvYRuCg58c38LyEMTd1fVLmHlKro9zl00=; b=Kz9OQYUF+aqIq0l+YlCuYGKM5BPF+rayfxvLE7V/Y7w/r6wpSiGBQvdZoE9JGVbm8FWD924kcdVGSaRrnWojA9EE6vRvyjVuU9p/FbcpPkTY1lo7qv36oPL0jCeFVcYIXd8SReOR9lt+KUQGhbX67xN4VvoEUuYHWTAoe4XP3vk= 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 1618295836973394.5573765683457; Mon, 12 Apr 2021 23:37:16 -0700 (PDT) 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-487-wi5QZw1rPPqnZ7WfkYSbRw-1; Tue, 13 Apr 2021 02:37:13 -0400 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 572DD1008063; Tue, 13 Apr 2021 06:37:07 +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 2EB77610A8; Tue, 13 Apr 2021 06:37:07 +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 E3AB01806D16; Tue, 13 Apr 2021 06:37:06 +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 13D6aqO5023986 for ; Tue, 13 Apr 2021 02:36:52 -0400 Received: by smtp.corp.redhat.com (Postfix) id 1548721EC5D7; Tue, 13 Apr 2021 06:36:52 +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 0F30921EC5DB for ; Tue, 13 Apr 2021 06:36:49 +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-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 946108027E6 for ; Tue, 13 Apr 2021 06:36:49 +0000 (UTC) Received: from mga11.intel.com (mga11.intel.com [192.55.52.93]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-535-SXLJy5xoNqC6aF5SGTBBng-1; Tue, 13 Apr 2021 02:36:45 -0400 Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by fmsmga102.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 12 Apr 2021 23:36:40 -0700 Received: from luyao-nuc7i7bnh.bj.intel.com ([10.238.154.184]) by fmsmga002.fm.intel.com with ESMTP; 12 Apr 2021 23:36:39 -0700 X-MC-Unique: wi5QZw1rPPqnZ7WfkYSbRw-1 X-MC-Unique: SXLJy5xoNqC6aF5SGTBBng-1 IronPort-SDR: fXlRY0+omEOucKXFm8RbwuICtDwYni23pNK5MnPrbUd/wNNVt/H6eEDtn0jOVZah8sc+qQ/+0e C/OuHYOPZ9gw== X-IronPort-AV: E=McAfee;i="6200,9189,9952"; a="191162432" X-IronPort-AV: E=Sophos;i="5.82,218,1613462400"; d="scan'208";a="191162432" IronPort-SDR: pZjh4nWQlSjt5BHI0JCgUStQacbEtevM82/UkVTgtZMSNt6kz2jRK0kEstqf+xlHvU+68hFJOc nXh8mzxCooJQ== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.82,218,1613462400"; d="scan'208";a="451823435" From: Luyao Zhong To: libvir-list@redhat.com Subject: [libvirt][PATCH v5 1/3] docs: add docs for 'restrictive' option for mode in numatune Date: Tue, 13 Apr 2021 14:38:06 +0800 Message-Id: <20210413063808.333318-2-luyao.zhong@intel.com> In-Reply-To: <20210413063808.333318-1-luyao.zhong@intel.com> References: <20210413063808.333318-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 Cc: mkletzan@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.12 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 29d2e02da1..f32fcf03d5 100644 --- a/docs/formatdomain.rst +++ b/docs/formatdomain.rst @@ -1112,8 +1112,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 Wed May 8 20:04:10 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=1618295822; cv=none; d=zohomail.com; s=zohoarc; b=d+HehRWuHqAJdmdaLv5ab0JqBmm7MKL5ICgiQNbC5F2VOv3v4ViduRawMHJHmtSyvJiuVHwkwlTHqZcWleclJ5aBXkgPvBHOjsiEnweezRiC58wPB53nb+xjT1IXNhD2kVlcO3sp4P7OlJEhYiFbRpA3TnjeN22/fpMJpR48+hI= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1618295822; h=Content-Type:Content-Transfer-Encoding:Cc: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=Z1soeid6CaexQ6kLlUjCbbhkh7TOhyrzzTZewrrKiLc=; b=HaiOE43Ard6gvFIHOdswzcXUgolRCm/uTAiZUc82Zg9I7iF4p/Ow0wtilDATDXVB+iHn+YyHx7NGSAqdDS/gMwTn2TZXJiyAdvEu8Iaa3ucjrwmitcWkTo+U9WWcmWX6lcCkPqO5Gu46Ev1x/PqhaiFqlXNI5+s/1zvnKqPRiYE= 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 16182958228586.393313179120014; Mon, 12 Apr 2021 23:37:02 -0700 (PDT) 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-251-as2k2528Pny61fbNZNu7vA-1; Tue, 13 Apr 2021 02:36:58 -0400 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 094D08189C8; Tue, 13 Apr 2021 06:36:53 +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 D2D0829679; Tue, 13 Apr 2021 06:36:52 +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 0D1FE44A5A; Tue, 13 Apr 2021 06:36:51 +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 13D6aniK023979 for ; Tue, 13 Apr 2021 02:36:49 -0400 Received: by smtp.corp.redhat.com (Postfix) id B75DF6E1DB; Tue, 13 Apr 2021 06:36:49 +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 B18B26E1D7 for ; Tue, 13 Apr 2021 06:36:48 +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-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 09C2E101A531 for ; Tue, 13 Apr 2021 06:36:48 +0000 (UTC) Received: from mga11.intel.com (mga11.intel.com [192.55.52.93]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-427-i6rMS8ZfPpeS2lZHZDswog-1; Tue, 13 Apr 2021 02:36:45 -0400 Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by fmsmga102.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 12 Apr 2021 23:36:43 -0700 Received: from luyao-nuc7i7bnh.bj.intel.com ([10.238.154.184]) by fmsmga002.fm.intel.com with ESMTP; 12 Apr 2021 23:36:41 -0700 X-MC-Unique: as2k2528Pny61fbNZNu7vA-1 X-MC-Unique: i6rMS8ZfPpeS2lZHZDswog-1 IronPort-SDR: H935KXonT3cUJ4xd5QWAGpjDbST6iNxUXes8yn+glJummlzU8Dqpuei8dyhAJ0Iu6Kn+4tOm4W ncdJB1WWWnJQ== X-IronPort-AV: E=McAfee;i="6200,9189,9952"; a="191162436" X-IronPort-AV: E=Sophos;i="5.82,218,1613462400"; d="scan'208";a="191162436" IronPort-SDR: PCpf3QOmq/m88BO+MkVel9KyfA7250Yeci13JgAqAGdalRXOkxRbeUl9R2FKtmW6bfcNQ4Zs7+ A8bYIydvJ7Wg== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.82,218,1613462400"; d="scan'208";a="451823448" From: Luyao Zhong To: libvir-list@redhat.com Subject: [libvirt][PATCH v5 2/3] schema: add 'restrictive' config option for mode in numatune Date: Tue, 13 Apr 2021 14:38:07 +0800 Message-Id: <20210413063808.333318-3-luyao.zhong@intel.com> In-Reply-To: <20210413063808.333318-1-luyao.zhong@intel.com> References: <20210413063808.333318-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.79 on 10.11.54.5 X-loop: libvir-list@redhat.com Cc: mkletzan@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 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 99cd873832..20a43148b1 100644 --- a/docs/schemas/domaincommon.rng +++ b/docs/schemas/domaincommon.rng @@ -1107,6 +1107,7 @@ strict preferred interleave + restrictive @@ -1139,6 +1140,7 @@ strict preferred interleave + restrictive --=20 2.25.4 From nobody Wed May 8 20:04:10 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=1618295834; cv=none; d=zohomail.com; s=zohoarc; b=V5uzVqsOp1wRA7Z72ht3YwqigWiUeERMPATBQC4u8RiVbZ7DmqVW80vTD3jhpEs5mhr2+HkCJ+gSamhWWwJYt+lGHZYs/LtVcrn4keQqFD3DaVKy6W5nkFzFH6lVmXu3PTS9poz5YX6PyRsZga4/YZ6R2MzAvqhN+zAXhIq4gJE= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1618295834; h=Content-Type:Content-Transfer-Encoding:Cc: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=vt/D6Q5hvVwtIyKElchFBDeMpXKNaw320n4V8ESvg9w=; b=kWX5elwIiIc0DmzNhUDtu97cswUVzl1ugpN1TKvEFQPOExl3rfDRzd2sAiO3EUvuYBL345z6OymsuP3z6oXh69+9IAOEoQ/KR6Nta8g6viZcTCWw0GgB0juPZzbC8hwgRuj6bXITEsBLMDaIL+h50uWrpEzWudImX5wtnlpJw8g= 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 1618295834067604.3850421541754; Mon, 12 Apr 2021 23:37:14 -0700 (PDT) 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-588-ijZvwp7HMRGiEgiNNvuQFg-1; Tue, 13 Apr 2021 02:37:11 -0400 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 B935D801814; Tue, 13 Apr 2021 06:37:06 +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 9142529679; Tue, 13 Apr 2021 06:37:06 +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 530C51806D17; Tue, 13 Apr 2021 06:37:06 +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 13D6arGI023997 for ; Tue, 13 Apr 2021 02:36:53 -0400 Received: by smtp.corp.redhat.com (Postfix) id 995F81008E9A; Tue, 13 Apr 2021 06:36:53 +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 94FB3105017B for ; Tue, 13 Apr 2021 06:36:51 +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-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 4B36C85A5AA for ; Tue, 13 Apr 2021 06:36:51 +0000 (UTC) Received: from mga11.intel.com (mga11.intel.com [192.55.52.93]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-535--MAE8FniOQ2NzUf1sSBiwA-2; Tue, 13 Apr 2021 02:36:46 -0400 Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by fmsmga102.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 12 Apr 2021 23:36:45 -0700 Received: from luyao-nuc7i7bnh.bj.intel.com ([10.238.154.184]) by fmsmga002.fm.intel.com with ESMTP; 12 Apr 2021 23:36:43 -0700 X-MC-Unique: ijZvwp7HMRGiEgiNNvuQFg-1 X-MC-Unique: -MAE8FniOQ2NzUf1sSBiwA-2 IronPort-SDR: ZsFrJEi8wHdbeLqRe9D8BUhdG4fKzLaT7rwuzvPtiRJTRlopQTwWzvd1WflSd5vZWLwYTrglSE f6c1q2JeRWVQ== X-IronPort-AV: E=McAfee;i="6200,9189,9952"; a="191162438" X-IronPort-AV: E=Sophos;i="5.82,218,1613462400"; d="scan'208";a="191162438" IronPort-SDR: XMXK2c9rSGKi8T1Uk49E3CN9EmNkw19uHEpf8TbxijIW9Hc/NKhr7Akpj9HFzZMp3mh6vJ4/0x ia+Futi9JqiQ== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.82,218,1613462400"; d="scan'208";a="451823466" From: Luyao Zhong To: libvir-list@redhat.com Subject: [libvirt][PATCH v5 3/3] qemu: add parser and formatter for 'restrictive' mode in numatune Date: Tue, 13 Apr 2021 14:38:08 +0800 Message-Id: <20210413063808.333318-4-luyao.zhong@intel.com> In-Reply-To: <20210413063808.333318-1-luyao.zhong@intel.com> References: <20210413063808.333318-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.3 X-loop: libvir-list@redhat.com Cc: mkletzan@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" Reviewed-by: Daniel Henrique Barboza Signed-off-by: Luyao Zhong --- 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 | 38 +++++++++++++++++ .../numatune-memnode-restrictive-mode.xml | 33 +++++++++++++++ tests/qemuxml2argvtest.c | 2 + ...memnode-restrictive-mode.x86_64-latest.xml | 41 +++++++++++++++++++ tests/qemuxml2xmltest.c | 1 + 12 files changed, 194 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 03c119fe26..e99bfb7654 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 64b93fd7d1..11093531b5 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 45eb0dc976..a6a1717115 100644 --- a/src/qemu/qemu_command.c +++ b/src/qemu/qemu_command.c @@ -175,6 +175,7 @@ VIR_ENUM_IMPL(qemuNumaPolicy, "bind", "preferred", "interleave", + "restricted", ); =20 VIR_ENUM_DECL(qemuAudioDriver); @@ -3300,7 +3301,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 b74afedd07..c887cb35f0 100644 --- a/src/qemu/qemu_process.c +++ b/src/qemu/qemu_process.c @@ -2692,6 +2692,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)) { @@ -2732,6 +2733,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 6c194b54d1..34db746d28 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..6d5e2eb76e --- /dev/null +++ b/tests/qemuxml2argvdata/numatune-memnode-restrictive-mode.x86_64-lates= t.args @@ -0,0 +1,38 @@ +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 \ +/usr/bin/qemu-system-x86_64 \ +-name guest=3DQEMUGuest,debug-threads=3Don \ +-S \ +-object '{"qom-type":"secret","id":"masterKey0","format":"raw","file":"/tm= p/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 '{"qom-type":"memory-backend-ram","id":"ram-node0","size":20971520= }' \ +-numa node,nodeid=3D0,cpus=3D0,memdev=3Dram-node0 \ +-object '{"qom-type":"memory-backend-ram","id":"ram-node1","size":67633152= 0}' \ +-numa node,nodeid=3D1,cpus=3D1-27,cpus=3D29,memdev=3Dram-node1 \ +-object '{"qom-type":"memory-backend-ram","id":"ram-node2","size":24578621= 440}' \ +-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=3Don,wait=3Doff \ +-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 \ +-audiodev id=3Daudio1,driver=3Dnone \ +-device virtio-balloon-pci,id=3Dballoon0,bus=3Dpci.0,addr=3D0x2 \ +-sandbox on,obsolete=3Ddeny,elevateprivileges=3Ddeny,spawn=3Ddeny,resource= control=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 317ee3267d..b6d2e8323d 100644 --- a/tests/qemuxml2argvtest.c +++ b/tests/qemuxml2argvtest.c @@ -2171,6 +2171,8 @@ mymain(void) DO_TEST_PARSE_ERROR("numatune-memnode", NONE); DO_TEST_CAPS_VER("numatune-memnode", "5.2.0"); DO_TEST_CAPS_LATEST("numatune-memnode"); + 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..012c526460 --- /dev/null +++ b/tests/qemuxml2xmloutdata/numatune-memnode-restrictive-mode.x86_64-lat= est.xml @@ -0,0 +1,41 @@ + + QEMUGuest + 9f4b6512-e73a-4a25-93e8-5307802821ce + 24682468 + 24682468 + 32 + + + + + + + hvm + + + + qemu64 + + + + + + + + destroy + restart + destroy + + /usr/bin/qemu-system-x86_64 + +
+ + + + +