From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 6226A45E3B; Thu, 5 Dec 2024 18:58:26 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 29EA24069D; Thu, 5 Dec 2024 18:58:25 +0100 (CET) Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by mails.dpdk.org (Postfix) with ESMTP id AB5D14065E for ; Thu, 5 Dec 2024 18:58:23 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1733421503; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=jmv8YF/PRQqkOlMFhlSPWLbcYM2c1VQKLYb+xjhiosw=; b=iJfFoqVNclUVS3D3bBgpqTbwgvf0EH/VYv+r2TQ2JvJDvNdqqN63kBQJg25XhytRK50i9b 6OcAJUQGSFw1q2xSVtz9Tr6iEXKQp/2QWRBw+Ij3oijJ9zK+usSQYe71HonrtuE1SWo20N lq1PvkwcHFacbmazP/SRa6g0TRsPIvQ= Received: from mx-prod-mc-01.mail-002.prod.us-west-2.aws.redhat.com (ec2-54-186-198-63.us-west-2.compute.amazonaws.com [54.186.198.63]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-48-bU3xCiDbO_GWOdcfrRWpgw-1; Thu, 05 Dec 2024 12:58:19 -0500 X-MC-Unique: bU3xCiDbO_GWOdcfrRWpgw-1 X-Mimecast-MFC-AGG-ID: bU3xCiDbO_GWOdcfrRWpgw Received: from mx-prod-int-04.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-04.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.40]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-01.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 798C519560B5; Thu, 5 Dec 2024 17:58:18 +0000 (UTC) Received: from dmarchan.redhat.com (unknown [10.45.225.129]) by mx-prod-int-04.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 02A041955F3F; Thu, 5 Dec 2024 17:58:14 +0000 (UTC) From: David Marchand To: dev@dpdk.org Cc: thomas@monjalon.net, frode.nordahl@canonical.com, mattias.ronnblom@ericsson.com Subject: [PATCH 0/3] Defer lcore variables allocation Date: Thu, 5 Dec 2024 18:57:51 +0100 Message-ID: <20241205175754.1673888-1-david.marchand@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.0 on 10.30.177.40 X-Mimecast-Spam-Score: 0 X-Mimecast-MFC-PROC-ID: YX1sKPFq99mOs4fXxoqqCgfupk4DyeYclBpCgVAakO4_1733421498 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: 8bit content-type: text/plain; charset="US-ASCII"; x-default=true X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org As I had reported in rc2, the lcore variables allocation have a noticeable impact on applications consuming DPDK, even when such applications does not use DPDK, or use features associated to some lcore variables. While the amount has been reduced in a rush before rc2, there are still cases when the increased memory footprint is noticed like in scaling tests. See https://bugs.launchpad.net/ubuntu/+source/dpdk/+bug/2090931 lcore variable allocations in constructor is a bad idea, as the application consuming DPDK has no control over such allocation: linking some code does not mean that all of it will be used at runtime. The general question on whether lcore variables in constructor should be forbidden, is left to a later discussion. For now, this series only focus on fixing subsystems using lcore variables so that those allocations are deferred either in rte_eal_init() or in the path that does require such lcore variables. -- David Marchand David Marchand (3): random: defer seeding to EAL init power: defer lcore variable allocation eal/x86: defer power intrinsics variable allocation lib/eal/common/eal_private.h | 6 ++++++ lib/eal/common/rte_random.c | 7 +++++-- lib/eal/freebsd/eal.c | 2 ++ lib/eal/linux/eal.c | 2 ++ lib/eal/windows/eal.c | 2 ++ lib/eal/x86/rte_power_intrinsics.c | 15 ++++++++++++--- lib/power/rte_power_pmd_mgmt.c | 27 +++++++++++++++++++-------- 7 files changed, 48 insertions(+), 13 deletions(-) -- 2.47.0