From nobody Tue Apr 23 07:38:56 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 205.139.110.61 as permitted sender) client-ip=205.139.110.61; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-delivery-1.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 205.139.110.61 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1599824730; cv=none; d=zohomail.com; s=zohoarc; b=RLXPJt043ItFv0XJl8Gxpc7sKDYnDIqnoKlhtbJHjmTLEGlSgsjBKoyedstMhy5XlLGVVO9V9ItwGULz1ov5IQbvkbq/BKlWL/TYIvgoNO2rzKwxUGhUNRMxdGHSpZOwTwMEvWLxtBAuf3kFMF0/NPUUZ2yP/YmkUG7ROrhH0+U= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1599824730; 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=0Eh8sBcYi8WI9duSlefGUNi9BEjtweudj3AX7yYyomU=; b=Z78+BtSoldOXhXX9RCbNDml131OellwlxOjYzEInXAtDKUBX+0KyVgfxtilGe4LMKj4ykAX3xRpPxWED6rwF1iB5WiTTkuzNtQKugIOZQNzUCpDgk65QIDlVsj+pWRE1T34/HI32ZrgUdOg9uO0cagAkgk3S+21cokYRez/E0jk= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 205.139.110.61 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from us-smtp-delivery-1.mimecast.com (us-smtp-1.mimecast.com [205.139.110.61]) by mx.zohomail.com with SMTPS id 159982473020262.84699892364915; Fri, 11 Sep 2020 04:45: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-190--8XmTqzoMpKzyhViyEAXUA-1; Fri, 11 Sep 2020 07:45:25 -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 9BD428030D2; Fri, 11 Sep 2020 11:45: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 7DFB57C0B8; Fri, 11 Sep 2020 11:45: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 47610181A872; Fri, 11 Sep 2020 11:45:20 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 08BBjHFc011323 for ; Fri, 11 Sep 2020 07:45:17 -0400 Received: by smtp.corp.redhat.com (Postfix) id CD2BF19C66; Fri, 11 Sep 2020 11:45:17 +0000 (UTC) Received: from localhost.localdomain (unknown [10.40.193.149]) by smtp.corp.redhat.com (Postfix) with ESMTP id 4DACF19C59 for ; Fri, 11 Sep 2020 11:45:17 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1599824728; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=0Eh8sBcYi8WI9duSlefGUNi9BEjtweudj3AX7yYyomU=; b=OQsosQYdIKFqtKR2chZ8mXVdzwx1B4hYwdjvN/zjiV+F9wvwd72M5D7kEbG1aMNqXXp+dw V3XilNPMupRrF7uD27AazBcPkVAXneCtc+otPWqQCbA+RoVH0+ejhD34OB8iXbJ08U5BZx Dmabkh/iALOYXFXWeVkWqcNHHIlWVuQ= X-MC-Unique: -8XmTqzoMpKzyhViyEAXUA-1 From: Michal Privoznik To: libvir-list@redhat.com Subject: [PATCH 1/2] virnuma: Assume numa_bitmask_isbitset() exists Date: Fri, 11 Sep 2020 13:45:11 +0200 Message-Id: <454f28da69daa519880b5023ace0e537061300e8.1599824696.git.mprivozn@redhat.com> In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 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.001 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) Content-Type: text/plain; charset="utf-8" This function was introduced in the 2.0.6 release which happened in December 2010. I think it is safe to assume that all libnuma we deal with have the function. Signed-off-by: Michal Privoznik Reviewed-by: Daniel P. Berrang=C3=A9 --- meson.build | 5 +---- src/util/virnuma.c | 6 +++--- 2 files changed, 4 insertions(+), 7 deletions(-) diff --git a/meson.build b/meson.build index bcb978292b..195d7cd784 100644 --- a/meson.build +++ b/meson.build @@ -1239,13 +1239,10 @@ else intl_dep =3D dependency('', required: false) endif =20 +numactl_version =3D '2.0.6' numactl_dep =3D cc.find_library('numa', required: get_option('numactl')) if numactl_dep.found() conf.set('WITH_NUMACTL', 1) - - if cc.has_function('numa_bitmask_isbitset', dependencies: [ numactl_dep = ]) - conf.set('WITH_NUMA_BITMASK_ISBITSET', 1) - endif endif =20 openwsman_version =3D '2.2.3' diff --git a/src/util/virnuma.c b/src/util/virnuma.c index 2872ce3c5e..b8cf8b4510 100644 --- a/src/util/virnuma.c +++ b/src/util/virnuma.c @@ -423,7 +423,7 @@ virNumaGetMaxCPUs(void) } =20 =20 -#if WITH_NUMACTL && WITH_NUMA_BITMASK_ISBITSET +#if WITH_NUMACTL /** * virNumaNodeIsAvailable: * @node: node to check @@ -493,7 +493,7 @@ virNumaGetDistances(int node, return 0; } =20 -#else /* !(WITH_NUMACTL && WITH_NUMA_BITMASK_ISBITSET) */ +#else /* !WITH_NUMACTL */ =20 bool virNumaNodeIsAvailable(int node) @@ -518,7 +518,7 @@ virNumaGetDistances(int node G_GNUC_UNUSED, VIR_DEBUG("NUMA distance information isn't available on this host"); return 0; } -#endif /* !(WITH_NUMACTL && WITH_NUMA_BITMASK_ISBITSET) */ +#endif /* !WITH_NUMACTL */ =20 =20 /* currently all the huge page stuff below is linux only */ --=20 2.26.2 From nobody Tue Apr 23 07:38:56 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 207.211.31.120 as permitted sender) client-ip=207.211.31.120; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-1.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 207.211.31.120 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1599824731; cv=none; d=zohomail.com; s=zohoarc; b=A+60BXNlL20VOliiBg6NKb9WAaJMdEt1fvzDFZauRewlEE4uwnhg2LhgHuakHo4M3l+6zTteYeYdpl3lXFQv4ftVOiUEtyvgl7ZKj//e4h0GZ9gE7hKPmMyuKqwyz/MyEmx6Cj8kqyfdskbDvgMmEHWwDy+pzkwOV5fNzLYjQa4= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1599824731; 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=1pP7KluzjR0TnCnSgbcuGzsibLa/G6DdRfQ00QiSm3U=; b=I8xBAeV2dZxs2QjSGZnR4r1uKVRZQ5PhcJTbFlpH2dkhs+ECht+Ljz0B1jAx3KnUgk/5d7R8ghOtvg5xS9QtbIGPiOY/Y5qtxy9l5DDWsedQ1cI0N45+xf5UJC1JdGTuboyuOK2W173dI1QoutvTfFyDyop+0Zhg7zBZr1Jh/tk= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 207.211.31.120 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from us-smtp-1.mimecast.com (us-smtp-delivery-1.mimecast.com [207.211.31.120]) by mx.zohomail.com with SMTPS id 1599824731205116.2294350196654; Fri, 11 Sep 2020 04:45:31 -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-511-CqjBxDFHNPatEJr_o3jElg-1; Fri, 11 Sep 2020 07:45:26 -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 C14DB8030DD; Fri, 11 Sep 2020 11:45: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 A26867C0BA; Fri, 11 Sep 2020 11:45: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 6D862181A87F; Fri, 11 Sep 2020 11:45:20 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 08BBjIHY011334 for ; Fri, 11 Sep 2020 07:45:18 -0400 Received: by smtp.corp.redhat.com (Postfix) id AA6D819C66; Fri, 11 Sep 2020 11:45:18 +0000 (UTC) Received: from localhost.localdomain (unknown [10.40.193.149]) by smtp.corp.redhat.com (Postfix) with ESMTP id 2BF0319C59 for ; Fri, 11 Sep 2020 11:45:18 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1599824729; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=1pP7KluzjR0TnCnSgbcuGzsibLa/G6DdRfQ00QiSm3U=; b=Z1QqTcs+q/Jei/ECD16h4f3uivFP8YrlmMaaQvOzrGGdeUAOCCamyllycqvDgWC+sc6uf/ qJgGh17UDN197zqW1lQhbHwrbEPEuBoMcWVHjl4nGVpFUXeWHNHYP1OsFuQnGt66zN+BTS LBE9+1KYcDljSa42hfqjIXu3NW7EdUg= X-MC-Unique: CqjBxDFHNPatEJr_o3jElg-1 From: Michal Privoznik To: libvir-list@redhat.com Subject: [PATCH 2/2] virnuma: Use numa_nodes_ptr when checking available NUMA nodes Date: Fri, 11 Sep 2020 13:45:12 +0200 Message-Id: <404a79d336036d44e1a3435bf8c80ae5c2c41f02.1599824696.git.mprivozn@redhat.com> In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 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.001 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) Content-Type: text/plain; charset="utf-8" In v6.7.0-rc1~86 I've tried to fix a problem where we were not detecting NUMA nodes properly because we misused behaviour of a libnuma API and as it turned out the behaviour was correct for hosts with 64 CPUs in one NUMA node. So I changed the code to use nodemask_isset(&numa_all_nodes, ..) instead and it fixed the problem on such hosts. However, what I did not realize is that numa_all_nodes does not reflect all NUMA nodes visible to userspace, it contains only those nodes that the process (libvirtd) an allocate memory from, which can be only a subset of all NUMA nodes. The bitmask that contains all NUMA nodes visible to userspace and which one I should have used is: numa_nodes_ptr. For curious ones: https://github.com/numactl/numactl/commit/4a22f2238234155e11e3e2717c0118647= 22b767b And as I was fixing virNumaGetNodeCPUs() I came to realize that we already have a function that wraps the correct bitmask: virNumaNodeIsAvailable(). Fixes: 24d7d85208f812a45686b32a0561cc9c5c9a49c9 Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=3D1876956 Signed-off-by: Michal Privoznik Reviewed-by: Daniel P. Berrang=C3=A9 --- src/util/virnuma.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/util/virnuma.c b/src/util/virnuma.c index b8cf8b4510..39f0f30917 100644 --- a/src/util/virnuma.c +++ b/src/util/virnuma.c @@ -260,7 +260,7 @@ virNumaGetNodeCPUs(int node, =20 *cpus =3D NULL; =20 - if (!nodemask_isset(&numa_all_nodes, node)) { + if (!virNumaNodeIsAvailable(node)) { VIR_DEBUG("NUMA topology for cell %d is not available, ignoring", = node); return -2; } --=20 2.26.2