From patchwork Thu Jan 20 21:31:51 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mark Michelson X-Patchwork-Id: 1582330 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: bilbo.ozlabs.org; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256 header.s=mimecast20190719 header.b=CJY5Uxl6; dkim-atps=neutral Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=openvswitch.org (client-ip=2605:bc80:3010::133; helo=smtp2.osuosl.org; envelope-from=ovs-dev-bounces@openvswitch.org; receiver=) Received: from smtp2.osuosl.org (smtp2.osuosl.org [IPv6:2605:bc80:3010::133]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by bilbo.ozlabs.org (Postfix) with ESMTPS id 4Jfwh4071Pz9t3b for ; Fri, 21 Jan 2022 08:32:03 +1100 (AEDT) Received: from localhost (localhost [127.0.0.1]) by smtp2.osuosl.org (Postfix) with ESMTP id B0B6A40519; Thu, 20 Jan 2022 21:32:01 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from smtp2.osuosl.org ([127.0.0.1]) by localhost (smtp2.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id MbXN_1CD_Mlx; Thu, 20 Jan 2022 21:32:00 +0000 (UTC) Received: from lists.linuxfoundation.org (lf-lists.osuosl.org [IPv6:2605:bc80:3010:104::8cd3:938]) by smtp2.osuosl.org (Postfix) with ESMTPS id A017A40420; Thu, 20 Jan 2022 21:31:59 +0000 (UTC) Received: from lf-lists.osuosl.org (localhost [127.0.0.1]) by lists.linuxfoundation.org (Postfix) with ESMTP id 64357C0031; Thu, 20 Jan 2022 21:31:59 +0000 (UTC) X-Original-To: dev@openvswitch.org Delivered-To: ovs-dev@lists.linuxfoundation.org Received: from smtp2.osuosl.org (smtp2.osuosl.org [140.211.166.133]) by lists.linuxfoundation.org (Postfix) with ESMTP id 23C58C002F for ; Thu, 20 Jan 2022 21:31:58 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by smtp2.osuosl.org (Postfix) with ESMTP id 116744032B for ; Thu, 20 Jan 2022 21:31:58 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from smtp2.osuosl.org ([127.0.0.1]) by localhost (smtp2.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id dYBOL7TbuO5i for ; Thu, 20 Jan 2022 21:31:56 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.8.0 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by smtp2.osuosl.org (Postfix) with ESMTPS id C7BBA4032A for ; Thu, 20 Jan 2022 21:31:56 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1642714315; h=from:from: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; bh=x5ApJrozdk2gJc5W3Yyelm1nXS58MgB7LWNT4n+ItV8=; b=CJY5Uxl6GIWfa9WeCozuvo6/lDsZl8D69WEZwNw8i8qDz8LdRRnc0tF+8j7NxiGb2tox5Q r+FtHmG952QpMMuH+04A/vP6SMnf/5lPiEqAzSpAK52KYcczU3N/pPJsJ95dfPC8ybqtNL B1dvLOqgXjERnXILHP8BNWt3NcJzp5Y= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-36-WfPWyDlmOqaELjKG9HRtaw-1; Thu, 20 Jan 2022 16:31:54 -0500 X-MC-Unique: WfPWyDlmOqaELjKG9HRtaw-1 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 5F1D71006AA3 for ; Thu, 20 Jan 2022 21:31:53 +0000 (UTC) Received: from localhost.localdomain.com (unknown [10.22.48.9]) by smtp.corp.redhat.com (Postfix) with ESMTP id E6EF84697A for ; Thu, 20 Jan 2022 21:31:52 +0000 (UTC) From: Mark Michelson To: dev@openvswitch.org Date: Thu, 20 Jan 2022 16:31:51 -0500 Message-Id: <20220120213151.220418-1-mmichels@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=mmichels@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Subject: [ovs-dev] [PATCH ovn] ovn-parallel-hmap: Fix NUMA and core detection. X-BeenThere: ovs-dev@openvswitch.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: ovs-dev-bounces@openvswitch.org Sender: "dev" ovn-parallel-hmap attempted to determine the number of threads to allocate for its pool based on the NUMA and core count reported by OVS. The problem is that since ovn-northd never called ovs_numa_init(), OVS would always return OVS_NUMA_UNSPEC for the number of NUMAs, and OVS_CORE_UNSPEC for the number of cores. Parallelization still was operational because we would fall back to a CPU core count. On a single NUMA machine, this is identical to what was expected, so everything seemed fine. In 37ad427cfb78a9e59d7e7ef249b2f2b3ac68c65a, the --dumy-numa option was added to ovn-northd to allow for parallel operation on machines with fewer NUMAs and cores than the parallelization code otherwise would require. However, because of the missing call to ovs_numa_init(), this option did not function as intended. This commit adds a call to ovs_numa_init() when setting up the parallel hmap thread pool so that accurate NUMA and core counts are reported, and dummy NUMA and core counts can be used. The referenced bugzilla is not actually reporting this as an issue, but this particular fix will enable the functionality requested. Reported-at: https://bugzilla.redhat.com/show_bug.cgi?id=1975345 Signed-off-by: Mark Michelson Acked-by: Numan Siddique --- lib/ovn-parallel-hmap.c | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/ovn-parallel-hmap.c b/lib/ovn-parallel-hmap.c index 56ceed8e8..7edc4c0b6 100644 --- a/lib/ovn-parallel-hmap.c +++ b/lib/ovn-parallel-hmap.c @@ -404,6 +404,7 @@ static void setup_worker_pools(bool force) { int cores, nodes; + ovs_numa_init(); nodes = ovs_numa_get_n_numas(); if (nodes == OVS_NUMA_UNSPEC || nodes <= 0) { nodes = 1;