linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Vito Caputo <vcaputo@pengaru.com>
To: jpoimboe@redhat.com
Cc: linux-kernel <linux-kernel@vger.kernel.org>
Subject: CONFIG_ORC_UNWINDER=y breaks get_wchan()?
Date: Tue, 21 Sep 2021 12:32:49 -0700	[thread overview]
Message-ID: <20210921193249.el476vlhg5k6lfcq@shells.gnugeneration.com> (raw)

Hi Josh (and CC:lkml),

I've recently transitioned to an Arch system which has
CONFIG_ORC_UNWINDER=y in the default kernel.  My window manager
integrates process monitoring showing the wchans of processes, making
it very apparent when wchan breaks.

Glancing at the kernel code to see what's involved in get_wchan() for
x86, it looks to assume there are frame pointers in the stack.  I
don't see any mention of ORC_UNWINDER in the get_wchan() code which
seems like an oversight when ORC_UNWINDER=y gets rid of them.

I had originally assumed this was just a Kconfig problem and asked
lkml about it (hearing crickets back) [0], but have since learned of
ORC_UNWINDER's existence via the Arch kernel maintainer.

Is this an oversight of the ORC_UNWINDER implementation?  It's
arguably a regression to completely break wchans for tools like `ps -o
wchan` and `top`, or my window manager and its separate monitoring
utility.  Presumably there are other tools out there sampling wchans
for monitoring as well, there's also an internal use of get_chan() in
kernel/sched/fair.c for sleep profiling.

I've occasionally seen when monitoring at a high sample rate (60hz) on
something churny like a parallel kernel or systemd build, there's a
spurious non-zero sample coming out of /proc/[pid]/wchan containing a
hexadecimal address like 0xffffa9ebc181bcf8.  This all smells broken,
is get_wchan() occasionally spitting out random junk here kallsyms
can't resolve, because get_chan() is completely ignorant of
ORC_UNWINDER's effects?

My time to spend on this currently is very limited, but I'd like to at
least get the relevant parties aware if they're not already...  Maybe
I should just file something in bugzilla.

Thanks,
Vito Caputo


[0] https://lore.kernel.org/lkml/20210914012612.vwlowt5wsojmyfzr@shells.gnugeneration.com/

             reply	other threads:[~2021-09-21 19:32 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-09-21 19:32 Vito Caputo [this message]
2021-09-22  0:15 ` Josh Poimboeuf
2021-09-22  3:04   ` Kees Cook
2021-09-23 23:59     ` Jann Horn
2021-09-25 19:07       ` David Laight
2021-09-22  3:30   ` Qi Zheng
2021-10-05  0:51     ` Andy Lutomirski
2021-09-24  5:46   ` Vito Caputo

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=20210921193249.el476vlhg5k6lfcq@shells.gnugeneration.com \
    --to=vcaputo@pengaru.com \
    --cc=jpoimboe@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --subject='Re: CONFIG_ORC_UNWINDER=y breaks get_wchan()?' \
    /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

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).