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 7D46C45F20; Mon, 23 Dec 2024 11:36:31 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 56920406BC; Mon, 23 Dec 2024 11:36:31 +0100 (CET) Received: from smtp-relay-internal-0.canonical.com (smtp-relay-internal-0.canonical.com [185.125.188.122]) by mails.dpdk.org (Postfix) with ESMTP id 34B804025F for ; Thu, 19 Dec 2024 17:19:44 +0100 (CET) Received: from mail-pj1-f71.google.com (mail-pj1-f71.google.com [209.85.216.71]) (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 smtp-relay-internal-0.canonical.com (Postfix) with ESMTPS id 76C9E3F5AA for ; Thu, 19 Dec 2024 16:19:43 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=canonical.com; s=20210705; t=1734625183; bh=99DKlVfhxac3V/t1d0a9xlhKZWGJG0VAHuusu7XXIbA=; h=MIME-Version:References:In-Reply-To:From:Date:Message-ID:Subject: To:Cc:Content-Type; b=WfFha8QuruJ+LkRBNZu6K0JumFb1YxnCuceJfa6N7txBZKuN5CtBvRaeNKvJh3okt 0xthQwjuXH9wD2WGKDWqIDU94rvHFGhMaBptBu++M46oEwj4pnffPiwBKSp2r/yi10 mJbYiMDV29UyrQRj9R2f+faCyOGNaSLBPok9D7iKnrZm836+6co2Fk28o7pSF+sNAX mmt9wKW8imupuWy6UJnCef9GYtHkDcPvdABH5g2B3G8Bbheay/K2w8DVv/xyUGIXkP KdnpywF+sX00jwk5UrTelE+Cklyo7hEmYxnvrr1wjErTm+sJWvd34MY6Z5W4zAkOsW jL5luhgD6IhwA== Received: by mail-pj1-f71.google.com with SMTP id 98e67ed59e1d1-2ef775ec883so913892a91.1 for ; Thu, 19 Dec 2024 08:19:43 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1734625182; x=1735229982; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=99DKlVfhxac3V/t1d0a9xlhKZWGJG0VAHuusu7XXIbA=; b=oR/y3BLNSRkOEW72Ucp3gMADf3jNNoJ4PVcFL2OBF7Kq4X3FjPx/BPIbKHMXIGsx2p bfs+6lfe22cA6tdzmEZnFso5VLteEDIlOC/YDms2MaHbhKJqix63mrOb8vwz1wOtIjI2 9oG+3ANkMoPlCYBjtOhaSFRdltLxHgtC6kkyRzKMKROCIJ3Y7wz/CW288y1fRcJfPDv7 W1SWZoDafrYZY+NI/4FHH/1LTORzWtjkvS68DtgPcFmd/VtgKNipExSHwcSDJh8uE47f sQi+wUAf71Lt3KJ7d3yFiOEmnzGj6X/InqYLOyJy3Y3jR3wJmpF5OrA+GIDugOkc4eGo NkBA== X-Gm-Message-State: AOJu0YwYPIQn0KL5CZtgWPVsqKnB+wjT/53o2mXcCWNm9H2C2D74Pbyb 8zfV3BGIJhcWh0fsmOoUN4IHrOuzzn8Ujj5GDFL6bj91dfr88y34p5AGoq2irKHv2EWDi6d2xp4 bJFRMn8XjXC3BerKbg1uUBgwYt6hA4df0jlwRpXuDXqOyuuswD0GOPT0PIDAcXn6gcxBhOIL5Gf 8drbwyWilNQXz2Nqp1MjJxg2/nMMFJrUA= X-Gm-Gg: ASbGnctN29dYVwQl82VlFYXo4CdAMywuUGTtmqDHqWmpAV2HknCoEDgOTNIrbdX+ATp 0yfo8wWKd5uFA2O3HjEJg0kH1VHucgk2pl+qEcONtPC0BHYyBH0hbU3bJS7bjFaIqsSPA X-Received: by 2002:a17:90b:4f:b0:2ee:889b:b11e with SMTP id 98e67ed59e1d1-2f2e937836bmr10048409a91.30.1734625182039; Thu, 19 Dec 2024 08:19:42 -0800 (PST) X-Google-Smtp-Source: AGHT+IFPNCdf2drsiUREW8qm6G7dm0VdagwVP6J/RA4ZVraR7PudXHuMaRIs3H+YyVKdXEeuTfDqsS8Uoy2c3DrDM+0= X-Received: by 2002:a17:90b:4f:b0:2ee:889b:b11e with SMTP id 98e67ed59e1d1-2f2e937836bmr10048392a91.30.1734625181752; Thu, 19 Dec 2024 08:19:41 -0800 (PST) MIME-Version: 1.0 References: <20241205175754.1673888-1-david.marchand@redhat.com> <20241217085954.3310414-1-david.marchand@redhat.com> In-Reply-To: <20241217085954.3310414-1-david.marchand@redhat.com> From: Frode Nordahl Date: Thu, 19 Dec 2024 17:19:30 +0100 Message-ID: Subject: Re: [PATCH v2 0/5] Defer lcore variables allocation To: David Marchand Cc: dev@dpdk.org, thomas@monjalon.net, mattias.ronnblom@ericsson.com, anatoly.burakov@intel.com Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Mailman-Approved-At: Mon, 23 Dec 2024 11:36:30 +0100 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 On Tue, Dec 17, 2024 at 10:00=E2=80=AFAM David Marchand wrote: > > 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. While I have not done code review of this series, I can confirm that building Open vSwitch against DPDK built with this set of patches resolves the issue outlined in https://bugs.launchpad.net/ubuntu/+source/dpdk/+bug/2090931 as in just linking against DPDK no longer make a program increase its resident size. Acked-by: Frode Nordahl Thanks alot for addressing the issue! --=20 Frode Nordahl > -- > David Marchand > > Changes since v1: > - added a check on lcore handle, > - fixed lcore variable size in lib/power, > - renamed/introduced allocation helpers, > > > David Marchand (5): > eal: check lcore variable handle > random: defer seeding to EAL init > power: defer lcore variable allocation > power: reduce memory footprint of per-lcore state > 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/include/rte_lcore_var.h | 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 | 29 ++++++++++++++++++++--------- > 8 files changed, 52 insertions(+), 13 deletions(-) > > -- > 2.47.0 >