From nobody Sun May 5 20:18:13 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=1616468354; cv=none; d=zohomail.com; s=zohoarc; b=QF+watgi6GpxVTbjkOvANuFJly/3bUm6LUivINwp+guAnensgmvcnU/yGAi4EQ9+EbVhfYFAt17OGN6NWZ0QUu/fUji9LP83ZKuQYzOZwCJtmFMs8wjsS4ryefTHiXBa+U20aWVHkxDVSKWdu/y6Y50UJ8yKKYmH5jXGr2phBHA= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1616468354; 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=OJKO9fWJdw299Mbp6HhtLiMxrJ1IXZyx9OcMT0wM4Pw=; b=oAwFnLJxDF8xqOyS7V/dvmTIa4Ch6mUHWzuC6JCM3Q2zqiDcNJNu6b+cyaYRaHnM3JxboGntlCVJ6hT5W3kkqE9S4K5ZfDgcRhsu4tEKJE3rqf/mQCpMKubQH3AIEDqUMUdafFr++0pbl2sIZ7g/6Yz334e12UYgSd773kJqUgA= 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 1616468354494622.3883490254295; Mon, 22 Mar 2021 19:59: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-566-Hm8mwlbePWa3A7ZaC_sfHw-1; Mon, 22 Mar 2021 22:59:11 -0400 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id BE172881276; Tue, 23 Mar 2021 02:59:05 +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 295CA10023B0; Tue, 23 Mar 2021 02:59:05 +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 C50BE1809C83; Tue, 23 Mar 2021 02:59:00 +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 12N2wxsS009648 for ; Mon, 22 Mar 2021 22:58:59 -0400 Received: by smtp.corp.redhat.com (Postfix) id 1023D63A5E; Tue, 23 Mar 2021 02:58:59 +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 0880763ABE for ; Tue, 23 Mar 2021 02:58:56 +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 60F5B80006E for ; Tue, 23 Mar 2021 02:58:56 +0000 (UTC) Received: from mga14.intel.com (mga14.intel.com [192.55.52.115]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-281-2xm-jhuaPwW-FZf4GNZvcQ-2; Mon, 22 Mar 2021 22:58:53 -0400 Received: from orsmga001.jf.intel.com ([10.7.209.18]) by fmsmga103.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 22 Mar 2021 19:57:50 -0700 Received: from luyao-nuc7i7bnh.bj.intel.com ([10.238.154.184]) by orsmga001.jf.intel.com with ESMTP; 22 Mar 2021 19:57:49 -0700 X-MC-Unique: Hm8mwlbePWa3A7ZaC_sfHw-1 X-MC-Unique: 2xm-jhuaPwW-FZf4GNZvcQ-2 IronPort-SDR: NtYLA5efp3IhRsSA6ml+sG58vRV5eICr5+A5ULLiLoCnGUAMm4tOWCaSahm98W3WtkqCzwDY+B pWqm5q2XQe8A== X-IronPort-AV: E=McAfee;i="6000,8403,9931"; a="189792034" X-IronPort-AV: E=Sophos;i="5.81,270,1610438400"; d="scan'208";a="189792034" IronPort-SDR: FFWbiG6fWeLsIrzRoplv3wk677mEoYqkaAlwDnu46Cn2BZPu2s+5H9riuZ51Y4X4ekIXY250mg eGMiKzS1pFkg== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.81,270,1610438400"; d="scan'208";a="451956835" From: Luyao Zhong To: libvir-list@redhat.com Subject: [libvirt][PATCH v4 1/3] docs: add docs for 'restrictive' option for mode in numatune Date: Tue, 23 Mar 2021 10:59:03 +0800 Message-Id: <20210323025905.573299-2-luyao.zhong@intel.com> In-Reply-To: <20210323025905.573299-1-luyao.zhong@intel.com> References: <20210323025905.573299-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.84 on 10.5.11.22 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 9392c80113..08d3c727be 100644 --- a/docs/formatdomain.rst +++ b/docs/formatdomain.rst @@ -1120,8 +1120,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 Sun May 5 20:18:13 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=1616468370; cv=none; d=zohomail.com; s=zohoarc; b=YI+qpe3b+7bTuj+VK/6dpKHTbgU15ExkcNlAugY00FRlU79cyhrkDsgkpbqlBhiruC1jcHelnHYHIt6YHVs5qy7etiiSz39n9FAtB5YbwH0KRVjGeAh3/sv73Uars0t8DgTS5idl/eRZ31RNLipFdDzPCUqDYCXCQB9S0KW+lNE= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1616468370; 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=s834Z0thAD62tvVrewbGnlBKJP2Jbj3mw3sXv4nkoFM=; b=farOPnQLoN9GLF/eItqUNbz7RqFjCrwGtjo6eF3RXw/Gf/QzKLIImo4zoEprPfGvvORmGVWhtosLLOSAHxea606w8EiRTVcAcL7fr75V2AYo8tDcZdIFFNGRLg4ddE5nJq4uPYNizPT/LLblJrGP9i6asBrW25ksveZ2ZP0GrnI= 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 1616468370185125.15447371316895; Mon, 22 Mar 2021 19:59:30 -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-452-WKs1uzcBNpS_IE2ms-RakQ-1; Mon, 22 Mar 2021 22:59:27 -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 B2FBC180FCA1; Tue, 23 Mar 2021 02:59:20 +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 87E7860BE5; Tue, 23 Mar 2021 02:59:20 +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 3DB06180B451; Tue, 23 Mar 2021 02:59:20 +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 12N2wxv8009653 for ; Mon, 22 Mar 2021 22:59:00 -0400 Received: by smtp.corp.redhat.com (Postfix) id D4BA21004026; Tue, 23 Mar 2021 02:58:59 +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 D0A061004149 for ; Tue, 23 Mar 2021 02:58:57 +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 78D8680B90D for ; Tue, 23 Mar 2021 02:58:57 +0000 (UTC) Received: from mga14.intel.com (mga14.intel.com [192.55.52.115]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-281-673VnPHJNdq4afhVOkGKjQ-3; Mon, 22 Mar 2021 22:58:55 -0400 Received: from orsmga001.jf.intel.com ([10.7.209.18]) by fmsmga103.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 22 Mar 2021 19:57:52 -0700 Received: from luyao-nuc7i7bnh.bj.intel.com ([10.238.154.184]) by orsmga001.jf.intel.com with ESMTP; 22 Mar 2021 19:57:51 -0700 X-MC-Unique: WKs1uzcBNpS_IE2ms-RakQ-1 X-MC-Unique: 673VnPHJNdq4afhVOkGKjQ-3 IronPort-SDR: c9E8aYDawInEXzaF3a2CgrEdmJhH2822Ar6k+u8UIqX9sKfTqbFwncOX6ZQcDhynC1DF+hRmix pDHJiKKJk2og== X-IronPort-AV: E=McAfee;i="6000,8403,9931"; a="189792045" X-IronPort-AV: E=Sophos;i="5.81,270,1610438400"; d="scan'208";a="189792045" IronPort-SDR: 1O5MUhU3Y8cmG+NMHaPTdMnBNoxavpxW0+QB7BsbmWAcUeWBnE/cQB1R9/bJAoRg8v816n9drZ T/LLJH2Oix/w== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.81,270,1610438400"; d="scan'208";a="451956847" From: Luyao Zhong To: libvir-list@redhat.com Subject: [libvirt][PATCH v4 2/3] schema: add 'restrictive' config option for mode in numatune Date: Tue, 23 Mar 2021 10:59:04 +0800 Message-Id: <20210323025905.573299-3-luyao.zhong@intel.com> In-Reply-To: <20210323025905.573299-1-luyao.zhong@intel.com> References: <20210323025905.573299-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.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" 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 1dbfc68f18..14ff3005d0 100644 --- a/docs/schemas/domaincommon.rng +++ b/docs/schemas/domaincommon.rng @@ -1110,6 +1110,7 @@ strict preferred interleave + restrictive @@ -1142,6 +1143,7 @@ strict preferred interleave + restrictive --=20 2.25.4 From nobody Sun May 5 20:18:13 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=1616468354; cv=none; d=zohomail.com; s=zohoarc; b=Xm18MRFZuominsdAtcz0xMDAlHzq4y8orsHAKHZbfQSZZjDegnA+DYNA8NI1SPkW34gFsDwZPk8AqEkboGD24/+BV5viYl5hA93zed2VGJnvIPArAIqkOT3RCGyYbVk5CJrJqV++YROvyLSwxPicFhnzg+5OCycSEEKDrw+jDH0= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1616468354; 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=gzeuh+RAX1KWw8JzLyq+5E7msbIvug4ksvdmO4teWfY=; b=XY6VMQWgT66LZaNEkHCl93pKRobbfyYUqLqa4DUSUn25X+4afr3ZGHE57LPbQyIMngeaIMGLyF5Gbrgu6MNMZfg3L4tthB+6xE5uKGI2xHzhjcZgwKZw94WnS6NGy+WYQmNc5umg3p5NQMGCoJY5aKIXyRWWZZl3wBnWYzWThCY= 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 1616468354838975.4732040222783; Mon, 22 Mar 2021 19:59: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-96-W29dwYW8NnKHs3xVMNnd2Q-1; Mon, 22 Mar 2021 22:59:11 -0400 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 0848A10082F3; Tue, 23 Mar 2021 02:59: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 ADDF319C87; Tue, 23 Mar 2021 02:59:05 +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 6A43A1809C84; Tue, 23 Mar 2021 02:59:04 +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 12N2wxca009654 for ; Mon, 22 Mar 2021 22:59:00 -0400 Received: by smtp.corp.redhat.com (Postfix) id CECCB2157F23; Tue, 23 Mar 2021 02:58:59 +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 C8F0D2166B44 for ; Tue, 23 Mar 2021 02:58:59 +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 AB58780B926 for ; Tue, 23 Mar 2021 02:58:59 +0000 (UTC) Received: from mga14.intel.com (mga14.intel.com [192.55.52.115]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-281-036tx7qmOkahT_AFaEBh7A-4; Mon, 22 Mar 2021 22:58:56 -0400 Received: from orsmga001.jf.intel.com ([10.7.209.18]) by fmsmga103.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 22 Mar 2021 19:57:55 -0700 Received: from luyao-nuc7i7bnh.bj.intel.com ([10.238.154.184]) by orsmga001.jf.intel.com with ESMTP; 22 Mar 2021 19:57:53 -0700 X-MC-Unique: W29dwYW8NnKHs3xVMNnd2Q-1 X-MC-Unique: 036tx7qmOkahT_AFaEBh7A-4 IronPort-SDR: gRGS3bFa23W/DJ8SU/SZTaZpVCnkEc0GCeCeYDwJvdXuvy8wwSL/4bllVNCIuszFEI30U7iRBm 4qOECTvSvNAA== X-IronPort-AV: E=McAfee;i="6000,8403,9931"; a="189792064" X-IronPort-AV: E=Sophos;i="5.81,270,1610438400"; d="scan'208";a="189792064" IronPort-SDR: pd16bYaBgDyG+q4WCpk1kITQVqZ9lkzOIEGD+7pjd7TCQtLxvv1apjlYCiBFmREvf2PYRgffwD EYaUPR53Y2+g== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.81,270,1610438400"; d="scan'208";a="451956865" From: Luyao Zhong To: libvir-list@redhat.com Subject: [libvirt][PATCH v4 3/3] qemu: add parser and formatter for 'restrictive' mode in numatune Date: Tue, 23 Mar 2021 10:59:05 +0800 Message-Id: <20210323025905.573299-4-luyao.zhong@intel.com> In-Reply-To: <20210323025905.573299-1-luyao.zhong@intel.com> References: <20210323025905.573299-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.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 --- 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 | 41 +++++++++++++++++++ tests/qemuxml2xmltest.c | 1 + 12 files changed, 196 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 5717f7b98d..8e4cf5ea46 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); @@ -3239,7 +3240,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 fedd1f56b1..8f59609192 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..b37cb93bba --- /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 \ +/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=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,\ +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 44c2a316b0..5a30f225d7 100644 --- a/tests/qemuxml2argvtest.c +++ b/tests/qemuxml2argvtest.c @@ -2115,6 +2115,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..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 + +
+ + + + +