From patchwork Fri Jan 26 15:23:08 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Roberto Bartzen Acosta X-Patchwork-Id: 1891468 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=luizalabs.com header.i=@luizalabs.com header.a=rsa-sha256 header.s=google header.b=YrN5XzCX; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=openvswitch.org (client-ip=140.211.166.133; helo=smtp2.osuosl.org; envelope-from=ovs-dev-bounces@openvswitch.org; receiver=patchwork.ozlabs.org) Received: from smtp2.osuosl.org (smtp2.osuosl.org [140.211.166.133]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (secp384r1) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4TM1f20JHvz23f9 for ; Sat, 27 Jan 2024 02:22:32 +1100 (AEDT) Received: from localhost (localhost [127.0.0.1]) by smtp2.osuosl.org (Postfix) with ESMTP id 5A5F54368C; Fri, 26 Jan 2024 15:22:30 +0000 (UTC) DKIM-Filter: OpenDKIM Filter v2.11.0 smtp2.osuosl.org 5A5F54368C Authentication-Results: smtp2.osuosl.org; dkim=fail reason="signature verification failed" (1024-bit key) header.d=luizalabs.com header.i=@luizalabs.com header.a=rsa-sha256 header.s=google header.b=YrN5XzCX 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 N4nCR_Fapcwu; Fri, 26 Jan 2024 15:22:28 +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 94B6840468; Fri, 26 Jan 2024 15:22:27 +0000 (UTC) DKIM-Filter: OpenDKIM Filter v2.11.0 smtp2.osuosl.org 94B6840468 Received: from lf-lists.osuosl.org (localhost [127.0.0.1]) by lists.linuxfoundation.org (Postfix) with ESMTP id 65C57C0072; Fri, 26 Jan 2024 15:22:27 +0000 (UTC) X-Original-To: dev@openvswitch.org Delivered-To: ovs-dev@lists.linuxfoundation.org Received: from smtp3.osuosl.org (smtp3.osuosl.org [IPv6:2605:bc80:3010::136]) by lists.linuxfoundation.org (Postfix) with ESMTP id BD539C0037 for ; Fri, 26 Jan 2024 15:22:25 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by smtp3.osuosl.org (Postfix) with ESMTP id 84E5B600C6 for ; Fri, 26 Jan 2024 15:22:25 +0000 (UTC) DKIM-Filter: OpenDKIM Filter v2.11.0 smtp3.osuosl.org 84E5B600C6 Authentication-Results: smtp3.osuosl.org; dkim=pass (1024-bit key) header.d=luizalabs.com header.i=@luizalabs.com header.a=rsa-sha256 header.s=google header.b=YrN5XzCX X-Virus-Scanned: amavisd-new at osuosl.org Received: from smtp3.osuosl.org ([127.0.0.1]) by localhost (smtp3.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id SbRdZR2pHR4w for ; Fri, 26 Jan 2024 15:22:23 +0000 (UTC) Received: from mail-pl1-x62f.google.com (mail-pl1-x62f.google.com [IPv6:2607:f8b0:4864:20::62f]) by smtp3.osuosl.org (Postfix) with ESMTPS id 680E960067 for ; Fri, 26 Jan 2024 15:22:23 +0000 (UTC) DKIM-Filter: OpenDKIM Filter v2.11.0 smtp3.osuosl.org 680E960067 Received: by mail-pl1-x62f.google.com with SMTP id d9443c01a7336-1d71b62fa87so11775105ad.0 for ; Fri, 26 Jan 2024 07:22:23 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=luizalabs.com; s=google; t=1706282542; x=1706887342; darn=openvswitch.org; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=7gmZaMLkuTZa/DZbMmAYOaQ9daTpEmV8O9t6eJ3mV1E=; b=YrN5XzCXFlvHoSB/LWrHmJ0zWIris4+ObkwBTYjUnZRAlQ/EA0U2wXYmcH2rXiCeMQ SB+VFbOFOZ8IycBHspOz7eEM+Pbmll8EnsLBiIB7Qk53OlMdlnRv6VZcA9Kbo2f61frE rLUajLzEc5jactt3f2j6X1YwVpDI/04qfO61U= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1706282542; x=1706887342; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=7gmZaMLkuTZa/DZbMmAYOaQ9daTpEmV8O9t6eJ3mV1E=; b=wAXqUfYl5+VmBSilFDgf455tn/xPcH1u+wDQ70hEY+Q09OCzDIDqLQdcjE4jWdCGCi pV/GCGUbnHEGMjwmRSUDEb5k+Yu//hJJOMunzud4H+D5io4llta1nRF6wgJ65gxcuIRe mGby8XERD5Z78T6S6bLJL/+FwOOJ+IopzC7LXPi3fjtgWI4cc3pmLRv1nc2VIPSSevuz K7Fklx4CSmQctC2ycWWdOiXYZeea8lZ4VwhOgwfRWgru/uMaliEgEC+ssBvLp584tAjp FCkQlCDiGydo6o8mNw3xt8tiqoazVSVLCeyO+a8AZJYKcpLqyTORin3D3ONnwP66p7FS cpFA== X-Gm-Message-State: AOJu0YxSWYZaqRpQtCJCj/7gg16PHzlqpKhygURbGHy7YcUC4y2djMnG 8epKzBwd47swYxJEd2hHKrSR8hqVIsAn9GZNZjuVflssWcR36sQIuj2SqoGVRXgOzgy9yGZibAA xtkOdRYJpL+Q8DMVPL/ELMfztRAFoHnV0kRquR+97VPp2mdHkc5f2FKtS X-Google-Smtp-Source: AGHT+IGUFS2Q7+ZJ8wT/+PUAeGjS8Jn1xpT1HZGThx99qi6QQchoKWao4MDhBiHYVHDUTlQiA8ZOxg== X-Received: by 2002:a17:902:9a81:b0:1d7:490:d0fc with SMTP id w1-20020a1709029a8100b001d70490d0fcmr1550531plp.7.1706282542382; Fri, 26 Jan 2024 07:22:22 -0800 (PST) Received: from WNL1099LABS421.magazineluiza.intranet ([191.187.213.146]) by smtp.gmail.com with ESMTPSA id q2-20020a170902788200b001d3a371cd24sm1066110pll.53.2024.01.26.07.22.20 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 26 Jan 2024 07:22:21 -0800 (PST) To: dev@openvswitch.org Date: Fri, 26 Jan 2024 12:23:08 -0300 Message-Id: <20240126152308.2146717-1-roberto.acosta@luizalabs.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 Subject: [ovs-dev] [PATCH ovs] Documentation: Adding note about using the jemalloc library. 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: , X-Patchwork-Original-From: Roberto Bartzen Acosta via dev From: Roberto Bartzen Acosta Reply-To: Roberto Bartzen Acosta Errors-To: ovs-dev-bounces@openvswitch.org Sender: "dev" Current version of debian/rules simply uses the default GCC optimization settings during the linkage process. The main problem with this approach is that GCC on OS like Ubuntu Jammy, for example, can enable the -flto=auto flag option during the Open vSwitch building and linking process. In this case, the linked dynamic libraries would need to be compatible with the same lto optimization options, at the risk of not working, according to documentation [1]. However, it could be possible to link to jemalloc using the LTO option but the GIMPLE-bytecode may not work correctly. In this case, it would be necessary to disable the -fbuiltin flag [2] if it is set as default. Updating the reference documentation with the inclusion of possible building problems with libjemalloc and solution suggestions. [1] https://gcc.gnu.org/onlinedocs/gcc/Optimize-Options.html#index-flto [2] https://gcc.gnu.org/onlinedocs/gcc/Other-Builtins.html Signed-off-by: Roberto Bartzen Acosta --- Documentation/intro/install/general.rst | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/Documentation/intro/install/general.rst b/Documentation/intro/install/general.rst index 19e360d47..ef4e6181d 100644 --- a/Documentation/intro/install/general.rst +++ b/Documentation/intro/install/general.rst @@ -344,6 +344,23 @@ you wish to link with jemalloc add it to LIBS:: $ ./configure LIBS=-ljemalloc +.. note:: + Linking Open vSwitch with the jemalloc shared library may not work as + expected in certain operating system development environments if the GCC + compiler tries to optimize the linking process using the ``-flto`` flag. + You can overrides the automatic compiler decision removing the link-time + optimization by passing ``-fno-lto`` or disabling ``-fno-builtin`` flag since + the jemalloc override standard built-in memory allocation functions such as + malloc, calloc, etc. Both options can solve possible jemalloc linker issues + with pros and cons for each case, feel free to choose the path that appears + best to you. Disabling LTO flag example:: + + $ ./configure LIBS=-ljemalloc CFLAGS=-fno-lto + + Disabling built-in flag example:: + + ./configure LIBS=-ljemalloc CFLAGS=-fno-builtin + .. _general-building: Building