Dwarves Archive mirror
 help / color / mirror / Atom feed
From: Suren Baghdasaryan <surenb@google.com>
To: John Hubbard <jhubbard@nvidia.com>
Cc: Jiri Olsa <olsajiri@gmail.com>,
	Alan Maguire <alan.maguire@oracle.com>,
	 Arnaldo Carvalho de Melo <acme@redhat.com>,
	Alexei Starovoitov <ast@kernel.org>,
	bpf@vger.kernel.org,  LKML <linux-kernel@vger.kernel.org>,
	dwarves@vger.kernel.org,
	 Kent Overstreet <kent.overstreet@linux.dev>,
	Johannes Weiner <hannes@cmpxchg.org>
Subject: Re: [PATCH] fix linux kernel BTF builds: increase max percpu variables by 10x
Date: Fri, 1 Mar 2024 19:15:36 +0000	[thread overview]
Message-ID: <CAJuCfpGMoOTPBJoT=R8GayLg6rfFRppKameeW1w3_V1=YgL6kA@mail.gmail.com> (raw)
In-Reply-To: <a0ea8c23-96e8-4ad2-8523-6749dc59b462@nvidia.com>

On Fri, Mar 1, 2024 at 6:33 PM John Hubbard <jhubbard@nvidia.com> wrote:
>
> On 3/1/24 06:14, Jiri Olsa wrote:
> > On Thu, Feb 29, 2024 at 10:15:23AM -0800, John Hubbard wrote:
> >>> ...
> >>> Running
> >>>
> >>> bpftool btf dump file vmlinux |grep "] VAR"
> >>>
> >>
> >> $ bpftool btf dump file vmlinux |grep "] VAR" | wc -l
> >> 4852
> >>
> >> $ bpftool btf dump file vmlinux |grep "] VAR" | tail -5
> >> [136994] VAR '_alloc_tag_cntr.9' type_id=703, linkage=static
> >> [137003] VAR '_alloc_tag_cntr.5' type_id=703, linkage=static
> >> [137004] VAR '_alloc_tag_cntr.7' type_id=703, linkage=static
> >> [137005] VAR '_alloc_tag_cntr.17' type_id=703, linkage=static
> >> [137018] VAR '_alloc_tag_cntr.14' type_id=703, linkage=static
> >>
> >>> ...should give us a sense of what's going on. I only see 375 per-cpu
> >>> variables when I do this so maybe there's something
> >>> kernel-config-specific that might explain why you have so many more?
> >>
> >> Yes, as mentioned earlier, this is specifically due to the .config.
> >> The .config is a huge distro configuration that has a lot of modules
> >> enabled.
> >
> > could you share your .config? I tried with fedora .config and got 396
> > per cpu variables, I wonder where this is coming from
> >
>
> Attaching it. And based on your results, I think that Suren's Memory
> allocation profiling patchset v4 [1] may also be required, as that is what
> I was building.

Yes, that will definitely increase the number of required per-cpu
variables since it adds a per-cpu variable for each kernel allocation
to track it. I vaguely remember now that Johannes also mentioned
hitting this limit when he was using our patchset. Allocating
encoder->percpu.vars dynamically seems to be a great way to fix this
limitation.

>
> Cc: Suren and Kent. btw, I the whole reason I went down this path was that
> I recommended your patchset in order to zero in on a memory leak that a
> colleague is debugging. This patchset provides a new view of allocations
> and leaks and we have high hopes for it. :)

Thanks for trying it out John and CC'ing us on this thread!
Suren.

>
>
> [1] https://lore.kernel.org/20240221194052.927623-1-surenb@google.com
>
>
> thanks,
> --
> John Hubbard
> NVIDIA

      reply	other threads:[~2024-03-01 19:15 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-02-28  3:21 [PATCH] fix linux kernel BTF builds: increase max percpu variables by 10x John Hubbard
2024-02-28  9:20 ` Jiri Olsa
2024-02-28 12:04   ` Alan Maguire
2024-02-28 23:21     ` John Hubbard
2024-02-29  9:17       ` Alan Maguire
2024-02-29 18:15         ` John Hubbard
2024-03-01 14:14           ` Jiri Olsa
2024-03-01 18:32             ` John Hubbard
2024-03-01 19:15               ` Suren Baghdasaryan [this message]

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='CAJuCfpGMoOTPBJoT=R8GayLg6rfFRppKameeW1w3_V1=YgL6kA@mail.gmail.com' \
    --to=surenb@google.com \
    --cc=acme@redhat.com \
    --cc=alan.maguire@oracle.com \
    --cc=ast@kernel.org \
    --cc=bpf@vger.kernel.org \
    --cc=dwarves@vger.kernel.org \
    --cc=hannes@cmpxchg.org \
    --cc=jhubbard@nvidia.com \
    --cc=kent.overstreet@linux.dev \
    --cc=linux-kernel@vger.kernel.org \
    --cc=olsajiri@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;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).