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


Groups > linux.kernel > #1311979

Re: x86_64 Compiler Output Kernel Bloat v4.4

From Jiri Olsa <jolsa@redhat.com>
Newsgroups linux.kernel
Subject Re: x86_64 Compiler Output Kernel Bloat v4.4
Date 2016-01-19 08:50 +0100
Message-ID <qSzd7-4Gm-5@gated-at.bofh.it> (permalink)
References <qSpx9-6kN-15@gated-at.bofh.it> <qSpQt-6uq-1@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


On Mon, Jan 18, 2016 at 02:45:14PM -0700, Jeff Merkey wrote:

SNIP

> > 0xffffffffa073e019 E8C2579FE0      call   touch_softlockup_watchdog_sync
> > 0xffffffffa073e01e E87D2B9BE0      call   clocksource_touch_watchdog
> > 0xffffffffa073e023 E8F8099AE0      call   rcu_cpu_stall_reset
> > 0xffffffffa073e028 E893579FE0      call   touch_nmi_watchdog
> > 0xffffffffa073e02d 5D              pop    rbp
> > 0xffffffffa073e02e 6690            data16
> > 0xffffffffa073e030 C3              ret
> > 0xffffffffa073e031 6666666666662E0F1F840000000000  nop    cs:WORD PTR
> > [rax+rax]=0x0000
> > mdb|mdb:
> > 0xffffffffa073e040 0F1F440000      nop    DWORD PTR [rax+rax]=0x0  <<
> > 0xffffffffa073e045 55              push   rbp
> > 0xffffffffa073e046 4889E5          mov    rbp,rsp
> > 0xffffffffa073e049 4157            push   r15
> > 0xffffffffa073e04b 4156            push   r14
> > 0xffffffffa073e04d 4989FE          mov    r14,rdi
> > 0xffffffffa073e050 4155            push   r13
> > (0)> g
> >
> > Jeff
> >
> 
> I think xor eax,eax is a lot shorter and fewer bytes.

that 5 byte nop gets replaced by call instruction once the
function trace is enabled

explained in CONFIG_FUNCTION_TRACER option doc:


config FUNCTION_TRACER
        bool "Kernel Function Tracer"
        depends on HAVE_FUNCTION_TRACER
        select KALLSYMS
        select GENERIC_TRACER
        select CONTEXT_SWITCH_TRACER
        help
          Enable the kernel to trace every kernel function. This is done
          by using a compiler feature to insert a small, 5-byte No-Operation
          instruction at the beginning of every kernel function, which NOP
          sequence is then dynamically patched into a tracer call when
          tracing is enabled by the administrator. If it's runtime disabled
          (the bootup default), then the overhead of the instructions is very
          small and not measurable even in micro-benchmarks.

jirka

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


Thread

x86_64 Compiler Output Kernel Bloat v4.4 Jeff Merkey <linux.mdb@gmail.com> - 2016-01-18 22:30 +0100
  Re: x86_64 Compiler Output Kernel Bloat v4.4 Jeff Merkey <linux.mdb@gmail.com> - 2016-01-18 22:40 +0100
  Re: x86_64 Compiler Output Kernel Bloat v4.4 Jeff Merkey <linux.mdb@gmail.com> - 2016-01-18 22:50 +0100
    Re: x86_64 Compiler Output Kernel Bloat v4.4 Jeff Merkey <linux.mdb@gmail.com> - 2016-01-18 22:50 +0100
      Re: x86_64 Compiler Output Kernel Bloat v4.4 Mihai Donțu <mihai.dontu@gmail.com> - 2016-01-18 23:20 +0100
    Re: x86_64 Compiler Output Kernel Bloat v4.4 Jiri Olsa <jolsa@redhat.com> - 2016-01-19 08:50 +0100
      Re: x86_64 Compiler Output Kernel Bloat v4.4 Jeff Merkey <linux.mdb@gmail.com> - 2016-01-19 16:40 +0100
        Re: x86_64 Compiler Output Kernel Bloat v4.4 Jeff Merkey <linux.mdb@gmail.com> - 2016-01-19 16:50 +0100
          Re: x86_64 Compiler Output Kernel Bloat v4.4 Steven Rostedt <rostedt@goodmis.org> - 2016-01-20 15:50 +0100
            Re: x86_64 Compiler Output Kernel Bloat v4.4 "H. Peter Anvin" <hpa@zytor.com> - 2016-01-20 16:00 +0100

csiph-web