From: Tejun Heo <tj@kernel.org>
To: Andrii Nakryiko <andrii.nakryiko@gmail.com>
Cc: Amery Hung <ameryhung@gmail.com>,
bpf@vger.kernel.org, netdev@vger.kernel.org,
alexei.starovoitov@gmail.com, andrii@kernel.org,
daniel@iogearbox.net, martin.lau@kernel.org,
kernel-team@meta.com
Subject: Re: [PATCH RFC v3 0/2] Task local data API
Date: Fri, 2 May 2025 08:36:20 -1000 [thread overview]
Message-ID: <aBUQpPFemrUYxyO6@slm.duckdns.org> (raw)
In-Reply-To: <CAEf4BzZ=HORw6JnQz=pguoaUSc=swFiaG9mzQLxqLZgTamc1qA@mail.gmail.com>
Hello,
On Fri, May 02, 2025 at 09:14:47AM -0700, Andrii Nakryiko wrote:
> > The advantage of no memory wasted for threads that are not using TLD
> > doesn't seem to be that definite to me. If users add per-process
> > hints, then this scheme can potentially use a lot more memory (i.e.,
> > PAGE_SIZE * number of threads). Maybe we need another uptr for
> > per-process data? Or do you think this is out of the scope of TLD and
> > we should recommend other solutions?
>
> I'd keep it simple. One page per thread isn't a big deal at all, in my
> mind. If the application has a few threads, then a bunch of kilobytes
> is not a big deal. If the application has thousands of threads, then a
> few megabytes for this is the least of that application's concern,
> it's already heavy-weight as hell. I think we are overpivoting on
> saving a few bytes here.
It could well be that 4k is a price worth paying but there will be cases
where this matters. With 100k threads - not common but not unheard of
either, that's ~400MB. If the data needed to be shared is small and most of
that is wasted, that's not an insignificant amount. uptr supports sub-page
sizing, right? If keeping sizing dynamic is too complex, can't a process
just set the max size to what it deems appropriate?
Thanks.
--
tejun
next prev parent reply other threads:[~2025-05-02 18:36 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-04-25 21:40 [PATCH RFC v3 0/2] Task local data API Amery Hung
2025-04-25 21:40 ` [PATCH RFC v3 1/2] selftests/bpf: Introduce task local data Amery Hung
2025-04-30 1:44 ` Alexei Starovoitov
2025-05-02 15:00 ` Amery Hung
2025-05-01 20:38 ` Andrii Nakryiko
2025-04-25 21:40 ` [PATCH RFC v3 2/2] selftests/bpf: Test basic workflow of " Amery Hung
2025-04-25 22:12 ` Tejun Heo
2025-04-25 22:51 ` Amery Hung
2025-05-01 20:37 ` [PATCH RFC v3 0/2] Task local data API Andrii Nakryiko
2025-05-01 23:26 ` Alexei Starovoitov
2025-05-02 2:22 ` Andrii Nakryiko
2025-05-02 17:55 ` Alexei Starovoitov
2025-05-02 4:26 ` Amery Hung
2025-05-02 16:14 ` Andrii Nakryiko
2025-05-02 18:36 ` Tejun Heo [this message]
2025-05-02 20:10 ` Andrii Nakryiko
2025-05-02 21:23 ` Amery Hung
2025-05-02 22:25 ` Andrii Nakryiko
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=aBUQpPFemrUYxyO6@slm.duckdns.org \
--to=tj@kernel.org \
--cc=alexei.starovoitov@gmail.com \
--cc=ameryhung@gmail.com \
--cc=andrii.nakryiko@gmail.com \
--cc=andrii@kernel.org \
--cc=bpf@vger.kernel.org \
--cc=daniel@iogearbox.net \
--cc=kernel-team@meta.com \
--cc=martin.lau@kernel.org \
--cc=netdev@vger.kernel.org \
/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.