Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1685828

Re: [PATCH v3 00/10] x86: ORC unwinder (previously undwarf)

From Josh Poimboeuf <jpoimboe@redhat.com>
Newsgroups linux.kernel
Subject Re: [PATCH v3 00/10] x86: ORC unwinder (previously undwarf)
Date 2017-07-12 16:50 +0200
Message-ID <u2r7H-140-3@gated-at.bofh.it> (permalink)
References <u25qx-454-3@gated-at.bofh.it> <u2lbX-5M9-1@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


On Wed, Jul 12, 2017 at 10:27:10AM +0200, Ingo Molnar wrote:
> > Create a new "ORC" unwinder, enabled by CONFIG_ORC_UNWINDER, and plug it
> > into the x86 unwinder framework.  Objtool is used to generate the ORC
> > debuginfo.  The ORC debuginfo format is basically a simplified version
> > of DWARF CFI.  More details below.
> 
> BTW., we should perhaps consolidate our unwinder related Kconfig space, 
> hierarchically:
> 
> 	CONFIG_UNWINDER
> 	CONFIG_UNWINDER_ORC
> 	CONFIG_UNWINDER_FRAME_POINTERS
> 
> Note that as a side effect it would be a valid small systems build option to have 
> no unwinder at all, if CONFIG_EXPERT=y is set and such: !CONFIG_UNWINDER=n would 
> be a sibling to !CONFIG_BUG.

So is the idea that CONFIG_UNWINDER=n means "use the 'guess' unwinder"?
Or should it mean that the unwind API isn't available?

Without frame pointers and orc, it defaults to the 'guess' unwinder, for
which the only overhead is a tiny amount of code.  It's still
technically considered an unwinder because it plugs into the unwind
interfaces (unwind_start(), unwind_next_frame(), etc) and is used for
things like /proc/<pid>/stack.

So I'm not really sure CONFIG_UNWINDER=n would make sense.  Maybe there
should just be a multiple-choice where you have to choose one of
CONFIG_UNWINDER_{ORC,FRAME_POINTER,GUESS}.

> CONFIG_FRAME_POINTERS et al would be left for architectures where it has a meaning 
> beyond backtrace generation. (Not sure whether there's any such architectures.)

Well, on x86, hardened usercopy relies on frame pointers, but not the
unwinder.  It does the frame pointer walk manually to avoid the full
unwinder overhead.  See arch_within_stack_frames().

> > The unwinder works well in my testing.  It unwinds through interrupts,
> > exceptions, and preemption, with and without frame pointers, across
> > aligned stacks and dynamically allocated stacks.  If something goes
> > wrong during an oops, it successfully falls back to printing the '?'
> > entries just like the frame pointer unwinder.
> 
> Ok, I'll start applying your patches after -rc1, unless anyone objects.

Thank you Ingo!

> > The ORC data format does have a few downsides compared to DWARF.  The
> > ORC unwind tables take up ~1MB more memory than DWARF eh_frame tables.
> 
> Could we also write this in percentage, not absolute RAM size - i.e. ORC unwind 
> tables take 30% more RAM (+0.7 MB on an x86 defconfig kernel) than DWARF eh_frame 
> tables.

Ok, how about:

  "Orc unwind tables take up ~50% more RAM (+1.3MB on an x86 defconfig
  kernel) than DWARF eh_frame tables."

(My previous 1MB number was from my distro-based config, and it also
forgot to take into account the fast lookup table (".orc_lookup")).

-- 
Josh

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

[PATCH v3 00/10] x86: ORC unwinder (previously undwarf) Josh Poimboeuf <jpoimboe@redhat.com> - 2017-07-11 17:40 +0200
  Re: [PATCH v3 00/10] x86: ORC unwinder (previously undwarf) Ingo Molnar <mingo@kernel.org> - 2017-07-12 10:30 +0200
    Re: [PATCH v3 00/10] x86: ORC unwinder (previously undwarf) Josh Poimboeuf <jpoimboe@redhat.com> - 2017-07-12 16:50 +0200
      Re: [PATCH v3 00/10] x86: ORC unwinder (previously undwarf) Ingo Molnar <mingo@kernel.org> - 2017-07-12 21:30 +0200
        Re: [PATCH v3 00/10] x86: ORC unwinder (previously undwarf) Josh Poimboeuf <jpoimboe@redhat.com> - 2017-07-14 19:20 +0200
  Re: [PATCH v3 00/10] x86: ORC unwinder (previously undwarf) Andres Freund <andres@anarazel.de> - 2017-07-12 23:50 +0200
    Re: [PATCH v3 00/10] x86: ORC unwinder (previously undwarf) Josh Poimboeuf <jpoimboe@redhat.com> - 2017-07-13 00:40 +0200
      Re: [PATCH v3 00/10] x86: ORC unwinder (previously undwarf) Andres Freund <andres@anarazel.de> - 2017-07-13 00:40 +0200
        Re: [PATCH v3 00/10] x86: ORC unwinder (previously undwarf) Josh Poimboeuf <jpoimboe@redhat.com> - 2017-07-13 00:50 +0200
          Re: [PATCH v3 00/10] x86: ORC unwinder (previously undwarf) Andres Freund <andres@anarazel.de> - 2017-07-13 01:00 +0200
      Re: [PATCH v3 00/10] x86: ORC unwinder (previously undwarf) Peter Zijlstra <peterz@infradead.org> - 2017-07-13 09:20 +0200
        Re: [PATCH v3 00/10] x86: ORC unwinder (previously undwarf) Peter Zijlstra <peterz@infradead.org> - 2017-07-13 11:00 +0200
          Re: [PATCH v3 00/10] x86: ORC unwinder (previously undwarf) Ingo Molnar <mingo@kernel.org> - 2017-07-13 11:20 +0200
            Re: [PATCH v3 00/10] x86: ORC unwinder (previously undwarf) Josh Poimboeuf <jpoimboe@redhat.com> - 2017-07-13 14:20 +0200
              Re: [PATCH v3 00/10] x86: ORC unwinder (previously undwarf) Josh Poimboeuf <jpoimboe@redhat.com> - 2017-07-13 14:30 +0200
                Re: [PATCH v3 00/10] x86: ORC unwinder (previously undwarf) Josh Poimboeuf <jpoimboe@redhat.com> - 2017-07-13 14:40 +0200
                Re: [PATCH v3 00/10] x86: ORC unwinder (previously undwarf) Ingo Molnar <mingo@kernel.org> - 2017-07-14 10:40 +0200
              Re: [PATCH v3 00/10] x86: ORC unwinder (previously undwarf) Ingo Molnar <mingo@kernel.org> - 2017-07-14 10:30 +0200
        Re: [PATCH v3 00/10] x86: ORC unwinder (previously undwarf) Peter Zijlstra <peterz@infradead.org> - 2017-07-13 11:00 +0200
  Re: [PATCH v3 00/10] x86: ORC unwinder (previously undwarf) Andi Kleen <andi@firstfloor.org> - 2017-07-13 00:40 +0200
    Re: [PATCH v3 00/10] x86: ORC unwinder (previously undwarf) Josh Poimboeuf <jpoimboe@redhat.com> - 2017-07-13 00:50 +0200
      Re: [PATCH v3 00/10] x86: ORC unwinder (previously undwarf) Andi Kleen <andi@firstfloor.org> - 2017-07-13 06:30 +0200
        Re: [PATCH v3 00/10] x86: ORC unwinder (previously undwarf) Josh Poimboeuf <jpoimboe@redhat.com> - 2017-07-13 15:20 +0200
      Re: [PATCH v3 00/10] x86: ORC unwinder (previously undwarf) Ingo Molnar <mingo@kernel.org> - 2017-07-13 11:30 +0200
    Re: [PATCH v3 00/10] x86: ORC unwinder (previously undwarf) Andy Lutomirski <luto@kernel.org> - 2017-07-13 01:30 +0200
    Re: [PATCH v3 00/10] x86: ORC unwinder (previously undwarf) Mike Galbraith <efault@gmx.de> - 2017-07-13 05:10 +0200
      Re: [PATCH v3 00/10] x86: ORC unwinder (previously undwarf) Andi Kleen <andi@firstfloor.org> - 2017-07-13 06:20 +0200
        Re: [PATCH v3 00/10] x86: ORC unwinder (previously undwarf) Mike Galbraith <efault@gmx.de> - 2017-07-13 06:40 +0200
          Re: [PATCH v3 00/10] x86: ORC unwinder (previously undwarf) Andi Kleen <andi@firstfloor.org> - 2017-07-13 06:50 +0200
            Re: [PATCH v3 00/10] x86: ORC unwinder (previously undwarf) Mike Galbraith <efault@gmx.de> - 2017-07-13 07:30 +0200
            Re: [PATCH v3 00/10] x86: ORC unwinder (previously undwarf) Jiri Kosina <jikos@kernel.org> - 2017-07-13 14:10 +0200

csiph-web