BPF List
 help / color / mirror / Atom feed
From: Antoine Tenart <atenart@kernel.org>
To: Alan Maguire <alan.maguire@oracle.com>
Cc: Antoine Tenart <atenart@kernel.org>,
	andrii@kernel.org,  eddyz87@gmail.com, bpf@vger.kernel.org,
	Paul Houssel <paulhoussel2@gmail.com>
Subject: Re: [PATCH bpf] libbpf: fix deduplication of typedef with base definitions
Date: Thu, 16 Apr 2026 12:20:34 +0200	[thread overview]
Message-ID: <aeC3ta43I7ZJFWZ5@kwain> (raw)
In-Reply-To: <74ee8ec0-904b-40ae-8fd8-25e1aa24b465@oracle.com>

On Thu, Apr 16, 2026 at 09:31:53AM +0100, Alan Maguire wrote:
> On 16/04/2026 08:38, Antoine Tenart wrote:
> > When deduplicating definitions for a module, typedef defined in the base
> > are not removed. This is because the hash used for base types differs
> > from the one used in the deduplication logic in btf_dedup_struct_type.
> > 
> > This was introduced by the referenced commit when moving the typedef
> > deduplication logic handling from btf_dedup_ref_type to
> > btf_dedup_struct_type, as this also changed the hash logic
> > (btf_hash_common to btf_hash_typedef).
> > 
> > This also impacts other types referencing those typedef (e.g. const). In
> > my test, the BTF section size of the openvswitch module went from 31KB
> > to 45KB.
> > 
> > Cc: Paul Houssel <paulhoussel2@gmail.com>
> > Fixes: 3781413465df ("libbpf: Fix BTF dedup to support recursive typedef definitions").
> > Signed-off-by: Antoine Tenart <atenart@kernel.org>
> 
> Nice catch! It would be great to have test coverage for this in
> prog_tests/btf_dedup_split.c ; adding a duplicated typedef to base and split
> BTF in test_split_simple() and ensuring it's removed from split BTF
> would do the trick I think.

Makes sense, I'll add a test for v2. Would you prefer a dedicated test
or reusing an existing one?

  reply	other threads:[~2026-04-16 10:20 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-04-16  7:38 [PATCH bpf] libbpf: fix deduplication of typedef with base definitions Antoine Tenart
2026-04-16  8:31 ` Alan Maguire
2026-04-16 10:20   ` Antoine Tenart [this message]
2026-04-16 11:53     ` Alan Maguire

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=aeC3ta43I7ZJFWZ5@kwain \
    --to=atenart@kernel.org \
    --cc=alan.maguire@oracle.com \
    --cc=andrii@kernel.org \
    --cc=bpf@vger.kernel.org \
    --cc=eddyz87@gmail.com \
    --cc=paulhoussel2@gmail.com \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox