From: Maksymilian Graczyk <maksymilian.graczyk@cern.ch>
To: Namhyung Kim <namhyung@kernel.org>,
Arnaldo Carvalho de Melo <acme@kernel.org>
Cc: Hao Luo <haoluo@google.com>, Jiri Olsa <jolsa@kernel.org>,
Andrii Nakryiko <andrii.nakryiko@gmail.com>,
linux-perf-users@vger.kernel.org,
syclops-project <syclops-project@cern.ch>,
Guilherme Amadio <guilherme.amadio@cern.ch>,
Stephan Hageboeck <stephan.hageboeck@cern.ch>
Subject: Re: long BPF stack traces Re: Broken stack traces with --call-graph=fp and a multi-threaded app due to page faults?
Date: Sat, 11 Nov 2023 14:37:53 +0100 [thread overview]
Message-ID: <ed21730f-7fdb-4c1c-a66a-ffbcd5c215c1@cern.ch> (raw)
In-Reply-To: <CAM9d7cjRBWnFoSkR+Gu8fN_0G6PDLMHRq3rim_Aksdwh8tWBmQ@mail.gmail.com>
Hi all,
Thank you for your responses.
As I said in my first e-mail, perf_event_max_stack is already set to
1024 and it doesn't help unfortunately.
Also, as Namhyung has spotted, my problem isn't limited only to BPF, I
get broken stacks for both on-CPU and off-CPU stuff. The page faults I
caught in my debugging sessions actually come from on-CPU stack
traversal and they cannot be currently (if at all) handled by perf
because a sample is taken inside an interrupt handler.
In the meantime, I have managed to find the exact cause of my page
faults, which is narrower than what I posted in my last update: it's
NUMA automatic balancing, which unmaps program's pages to migrate them
closer to a CPU running that program on the next page fault. Disabling
it with "sysctl kernel.numa_balancing=0" seems to fix the broken stack
issue and is a smaller overkill than turning off NUMA awareness
completely in the kernel, but it's still only a workaround with a
potential performance penalty (unless there is a manual way of setting
up NUMA properly so that the performance penalty is negligible and
callchains are not broken).
The ideal solution for me would be fixing perf so that stack unwinding
can always be fully done without disabling or tinkering with any
performance-enhancing mechanisms enabled by default. By "the proposed
sframe unwinder", do you mean the set of patches suggested in this
thread?
https://lore.kernel.org/all/cover.1699487758.git.jpoimboe@kernel.org/
Best regards,
Maks Graczyk
prev parent reply other threads:[~2023-11-11 13:38 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-11-08 10:46 Broken stack traces with --call-graph=fp and a multi-threaded app due to page faults? Maksymilian Graczyk
2023-11-10 10:45 ` Maksymilian Graczyk
2023-11-10 10:51 ` Maksymilian Graczyk
2023-11-10 15:59 ` Arnaldo Carvalho de Melo
2023-11-10 17:40 ` long BPF stack traces " Arnaldo Carvalho de Melo
2023-11-10 23:01 ` Namhyung Kim
2023-11-11 13:37 ` Maksymilian Graczyk [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=ed21730f-7fdb-4c1c-a66a-ffbcd5c215c1@cern.ch \
--to=maksymilian.graczyk@cern.ch \
--cc=acme@kernel.org \
--cc=andrii.nakryiko@gmail.com \
--cc=guilherme.amadio@cern.ch \
--cc=haoluo@google.com \
--cc=jolsa@kernel.org \
--cc=linux-perf-users@vger.kernel.org \
--cc=namhyung@kernel.org \
--cc=stephan.hageboeck@cern.ch \
--cc=syclops-project@cern.ch \
/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).