From: Stephen Hemminger <stephen@networkplumber.org>
To: Thomas Monjalon <thomas@monjalon.net>
Cc: "David Marchand" <david.marchand@redhat.com>,
"Mattias Rönnblom" <hofors@lysator.liu.se>,
dev@dpdk.org, frode.nordahl@canonical.com,
mattias.ronnblom@ericsson.com
Subject: Re: [PATCH 0/3] Defer lcore variables allocation
Date: Tue, 10 Dec 2024 09:09:56 -0800 [thread overview]
Message-ID: <20241210090956.53848f56@hermes.local> (raw)
In-Reply-To: <6775037.31r3eYUQgx@thomas>
On Fri, 06 Dec 2024 16:55:30 +0100
Thomas Monjalon <thomas@monjalon.net> wrote:
> 06/12/2024 12:01, Mattias Rönnblom:
> > On 2024-12-05 18:57, David Marchand wrote:
> > In retrospect, maybe the offset between lcore variable instances could
> > have been encoded into the handle, and thus one could use
> > different-sized offset for different variables.
>
> Yes it would allow to allocate a minimum size,
> instead of having a default which is also a maximum limit size of an object.
>
> It is not too late to change the behavior as the API is experimental.
>
> > > The general question on whether lcore variables in constructor should
> > > be forbidden, is left to a later discussion.
> >
> > That discussion could be extended to cover the question if RTE_INIT()
> > type constructors should be used at all. Intuitively, it seems better if
> > all DPDK initialization, or at least all EAL init, happens at the time
> > of rte_eal_init(), in some ordered/organized fashion.
>
> Yes we may avoid constructors and instead have callbacks called in rte_eal_init().
> In order to not break the RTE_INIT API, we could define some new macros
> for registering such rte_eal_init callbacks.
>
>
My intuition is that the OVS problem with using mlockall() is caused because when
malloc is used, the malloc code will pre-allocate a new arena (memory area) for use.
If the malloc takes before the mlockall() it will then be pinned even if not used.
If the malloc takes place later, perhaps that arena is coming from unpinned area.
Many more details on glibc malloc here:
https://sourceware.org/glibc/wiki/MallocInternals
Using blunt tool like mlockall() will have unintended side effects.
The issue with constructors, is they look good when they are simple, statless,
and only a few of them. But they get to be a undebuggable mess when the constructor
does complex stuff; has dependencies; and there are lots of them.
As a refinement, maybe having a way to register callback to be called in parallel
after EAL has started threads. But some things like random() need to be available
early in startup.
next prev parent reply other threads:[~2024-12-10 17:10 UTC|newest]
Thread overview: 44+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-12-05 17:57 [PATCH 0/3] Defer lcore variables allocation David Marchand
2024-12-05 17:57 ` [PATCH 1/3] random: defer seeding to EAL init David Marchand
2024-12-06 11:09 ` Mattias Rönnblom
2024-12-16 9:38 ` Burakov, Anatoly
2024-12-05 17:57 ` [PATCH 2/3] power: defer lcore variable allocation David Marchand
2024-12-06 11:29 ` Mattias Rönnblom
2024-12-12 7:57 ` David Marchand
2024-12-13 6:58 ` Mattias Rönnblom
2024-12-16 10:02 ` David Marchand
2024-12-05 17:57 ` [PATCH 3/3] eal/x86: defer power intrinsics " David Marchand
2024-12-06 11:32 ` Mattias Rönnblom
2024-12-06 11:01 ` [PATCH 0/3] Defer lcore variables allocation Mattias Rönnblom
2024-12-06 15:55 ` Thomas Monjalon
2024-12-10 17:09 ` Stephen Hemminger [this message]
2024-12-09 11:03 ` David Marchand
2024-12-09 15:39 ` Mattias Rönnblom
2024-12-09 17:40 ` David Marchand
2024-12-10 9:41 ` Mattias Rönnblom
2024-12-16 10:01 ` Burakov, Anatoly
2024-12-16 9:42 ` Burakov, Anatoly
2024-12-16 9:49 ` David Marchand
2024-12-17 9:06 ` David Marchand
2024-12-18 20:10 ` Mattias Rönnblom
2024-12-17 8:59 ` [PATCH v2 0/5] " David Marchand
2024-12-17 8:59 ` [PATCH v2 1/5] eal: check lcore variable handle David Marchand
2024-12-18 11:18 ` Burakov, Anatoly
2024-12-17 8:59 ` [PATCH v2 2/5] random: defer seeding to EAL init David Marchand
2024-12-18 16:35 ` Stephen Hemminger
2024-12-18 17:03 ` Mattias Rönnblom
2024-12-17 8:59 ` [PATCH v2 3/5] power: defer lcore variable allocation David Marchand
2024-12-18 11:17 ` Burakov, Anatoly
2024-12-17 8:59 ` [PATCH v2 4/5] power: reduce memory footprint of per-lcore state David Marchand
2024-12-18 11:17 ` Burakov, Anatoly
2024-12-17 8:59 ` [PATCH v2 5/5] eal/x86: defer power intrinsics variable allocation David Marchand
2024-12-18 11:17 ` Burakov, Anatoly
2024-12-19 16:19 ` [PATCH v2 0/5] Defer lcore variables allocation Frode Nordahl
2025-02-10 21:31 ` [PATCH v3 " David Marchand
2025-02-10 21:31 ` [PATCH v3 1/5] eal: check lcore variable handle David Marchand
2025-02-10 21:31 ` [PATCH v3 2/5] random: defer seeding to EAL init David Marchand
2025-02-10 21:31 ` [PATCH v3 3/5] power: defer lcore variable allocation David Marchand
2025-02-10 21:31 ` [PATCH v3 4/5] power: reduce memory footprint of per-lcore state David Marchand
2025-02-10 21:31 ` [PATCH v3 5/5] eal/x86: defer power intrinsics variable allocation David Marchand
2025-02-11 13:01 ` [PATCH v3 0/5] Defer lcore variables allocation David Marchand
2025-02-12 0:47 ` fengchengwen
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20241210090956.53848f56@hermes.local \
--to=stephen@networkplumber.org \
--cc=david.marchand@redhat.com \
--cc=dev@dpdk.org \
--cc=frode.nordahl@canonical.com \
--cc=hofors@lysator.liu.se \
--cc=mattias.ronnblom@ericsson.com \
--cc=thomas@monjalon.net \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.