From: Namhyung Kim <namhyung@kernel.org>
To: Ian Rogers <irogers@google.com>
Cc: Howard Chu <howardchu95@gmail.com>,
Arnaldo Carvalho de Melo <acme@kernel.org>,
Kan Liang <kan.liang@linux.intel.com>,
Jiri Olsa <jolsa@kernel.org>,
Adrian Hunter <adrian.hunter@intel.com>,
Peter Zijlstra <peterz@infradead.org>,
Ingo Molnar <mingo@kernel.org>,
LKML <linux-kernel@vger.kernel.org>,
linux-perf-users@vger.kernel.org
Subject: Re: [PATCH] perf trace: Increase syscall handler map size to 1024
Date: Fri, 31 Oct 2025 12:29:21 -0700 [thread overview]
Message-ID: <aQUOEU5Srvxvw_ye@google.com> (raw)
In-Reply-To: <CAP-5=fWumaLVt4DbSXXHmJ-9Y-hTyj9K61s2E8m_xZY+ux5nLg@mail.gmail.com>
On Fri, Oct 31, 2025 at 12:25:41PM -0700, Ian Rogers wrote:
> On Fri, Oct 31, 2025 at 12:08 PM Namhyung Kim <namhyung@kernel.org> wrote:
> >
> > On Thu, Oct 30, 2025 at 01:47:55PM -0700, Ian Rogers wrote:
> > > On Mon, Oct 13, 2025 at 1:22 PM Ian Rogers <irogers@google.com> wrote:
> > > >
> > > > On Thu, Aug 21, 2025 at 9:45 AM Ian Rogers <irogers@google.com> wrote:
> > > > >
> > > > > On Tue, May 20, 2025 at 3:14 PM Namhyung Kim <namhyung@kernel.org> wrote:
> > > > > >
> > > > > > Hi Ian,
> > > > > >
> > > > > > On Tue, May 20, 2025 at 08:05:37AM -0700, Ian Rogers wrote:
> > > > > > > On Mon, May 19, 2025 at 4:36 PM Howard Chu <howardchu95@gmail.com> wrote:
> > > > > > > >
> > > > > > > > Hello Namhyung,
> > > > > > > >
> > > > > > > > On Mon, May 19, 2025 at 4:25 PM Namhyung Kim <namhyung@kernel.org> wrote:
> > > > > > > > >
> > > > > > > > > The syscalls_sys_{enter,exit} map in augmented_raw_syscalls.bpf.c has
> > > > > > > > > max entries of 512. Usually syscall numbers are smaller than this but
> > > > > > > > > x86 has x32 ABI where syscalls start from 512.
> > > > > > > > >
> > > > > > > > > That makes trace__init_syscalls_bpf_prog_array_maps() fail in the middle
> > > > > > > > > of the loop when it accesses those keys. As the loop iteration is not
> > > > > > > > > ordered by syscall numbers anymore, the failure can affect non-x32
> > > > > > > > > syscalls.
> > > > > > > > >
> > > > > > > > > Let's increase the map size to 1024 so that it can handle those ABIs
> > > > > > > > > too. While most systems won't need this, increasing the size will be
> > > > > > > > > safer for potential future changes.
> > > > > > >
> > > > > > > Do we need to worry about MIPS where syscalls can be offset by 1000s?
> > > > > > > https://lore.kernel.org/lkml/8ed7dfb2-1e4d-4aa4-a04b-0397a89365d1@app.fastmail.com/
> > > > > >
> > > > > > Argh..
> > > > > >
> > > > > > > We could do with a map that combines BPF_MAP_TYPE_HASH with the tails
> > > > > > > calls of BPF_MAP_TYPE_PROG_ARRAY.
> > > > > >
> > > > > > Right, it'd complicate things but I think it's doable.
> > > > >
> > > > > Should we merge the x32 fix while waiting for the hash fix?
> > > >
> > > > Just a reminder that this is still not resolved.
> >
> > What do you mean by the x32 fix?
>
> This patch is the x32 fix. Your commit message says:
> "Usually syscall numbers are smaller than this but x86 has x32 ABI
> where syscalls start from 512."
Oh, you meant this patch. :)
>
> We started discussing a hash table based fix because of MIPS, etc.
Right, I'll merge this as an interim solution.
Thanks,
Namhyung
next prev parent reply other threads:[~2025-10-31 19:29 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-05-19 23:25 [PATCH] perf trace: Increase syscall handler map size to 1024 Namhyung Kim
2025-05-19 23:36 ` Howard Chu
2025-05-20 15:05 ` Ian Rogers
2025-05-20 22:14 ` Namhyung Kim
2025-08-21 16:45 ` Ian Rogers
2025-10-13 20:22 ` Ian Rogers
2025-10-30 20:47 ` Ian Rogers
2025-10-31 19:08 ` Namhyung Kim
2025-10-31 19:25 ` Ian Rogers
2025-10-31 19:29 ` Namhyung Kim [this message]
2025-11-03 17:53 ` Namhyung Kim
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=aQUOEU5Srvxvw_ye@google.com \
--to=namhyung@kernel.org \
--cc=acme@kernel.org \
--cc=adrian.hunter@intel.com \
--cc=howardchu95@gmail.com \
--cc=irogers@google.com \
--cc=jolsa@kernel.org \
--cc=kan.liang@linux.intel.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-perf-users@vger.kernel.org \
--cc=mingo@kernel.org \
--cc=peterz@infradead.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 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 NNTP newsgroup(s).