16 Oct, 2010

2 commits


15 Oct, 2010

8 commits

  • The file kernel/trace/ftrace.c references the mcount() call to
    convert the mcount() callers to nops. But because it references
    mcount(), the mcount() address is placed in the relocation table.

    The C version of recordmcount reads the relocation table of all
    object files, and it will add all references to mcount to the
    __mcount_loc table that is used to find the places that call mcount()
    and change the call to a nop. When recordmcount finds the mcount reference
    in kernel/trace/ftrace.o, it saves that location even though the code
    is not a call, but references mcount as data.

    On boot up, when all calls are converted to nops, the code has a safety
    check to determine what op code it is actually replacing before it
    replaces it. If that op code at the address does not match, then
    a warning is printed and the function tracer is disabled.

    The reference to mcount in ftrace.c, causes this warning to trigger,
    since the reference is not a call to mcount(). The ftrace.c file is
    not compiled with the -pg flag, so no calls to mcount() should be
    expected.

    This patch simply makes recordmcount.c skip the kernel/trace/ftrace.c
    file. This was the same solution used by the perl version of
    recordmcount.

    Reported-by: Ingo Molnar
    Cc: John Reiser
    Signed-off-by: Steven Rostedt

    Steven Rostedt
     
  • …nel/git/rostedt/linux-2.6-trace into perf/core

    Ingo Molnar
     
  • The config option used by archs to let the build system know that
    the C version of the recordmcount works for said arch is currently
    called HAVE_C_MCOUNT_RECORD which enables BUILD_C_RECORDMCOUNT. To
    be more consistent with the name that all archs may use, it has been
    renamed to HAVE_C_RECORDMCOUNT. This will be less confusing since
    we are building a C recordmcount and not a mcount_record.

    Suggested-by: Ingo Molnar
    Cc:
    Cc: Michal Marek
    Cc: linux-kbuild@vger.kernel.org
    Cc: John Reiser
    Signed-off-by: Steven Rostedt

    Steven Rostedt
     
  • …ic/random-tracing into perf/core

    Ingo Molnar
     
  • The elf reader for recordmcount.c had duplicate functions for both
    32 bit and 64 bit elf handling. This was due to the need of using
    the 32 and 64 bit elf structures.

    This patch consolidates the two by using macros to define the 32
    and 64 bit names in a recordmcount.h file, and then by just defining
    a RECORD_MCOUNT_64 macro and including recordmcount.h twice we
    create the funtions for both the 32 bit version as well as the
    64 bit version using one code source.

    Cc: John Reiser
    Signed-off-by: Steven Rostedt

    Steven Rostedt
     
  • This patch adds the support for the C version of recordmcount and
    compile times show ~ 12% improvement.

    After verifying this works, other archs can add:

    HAVE_C_MCOUNT_RECORD

    in its Kconfig and it will use the C version of recordmcount
    instead of the perl version.

    Cc:
    Cc: Michal Marek
    Cc: linux-kbuild@vger.kernel.org
    Cc: John Reiser
    Signed-off-by: Steven Rostedt

    Steven Rostedt
     
  • Currently, the mcount callers are found with a perl script that does
    an objdump on every file in the kernel. This is a C version of that
    same code which should increase the performance time of compiling
    the kernel with dynamic ftrace enabled.

    Signed-off-by: John Reiser

    [ Updated the code to include .text.unlikely section as well as
    changing the format to follow Linux coding style. ]

    Signed-off-by: Steven Rostedt

    John Reiser
     
  • In x86, faults exit by executing the iret instruction, which then
    reenables NMIs if we faulted in NMI context. Then if a fault
    happens in NMI, another NMI can nest after the fault exits.

    But we don't yet support nested NMIs because we have only one NMI
    stack. To prevent from that, check that vmalloc and kmemcheck
    faults don't happen in this context. Most of the other kernel faults
    in NMIs can be more easily spotted by finding explicit
    copy_from,to_user() calls on review.

    Signed-off-by: Frederic Weisbecker
    Cc: Ingo Molnar
    Cc: Thomas Gleixner
    Cc: H. Peter Anvin
    Cc: Mathieu Desnoyers
    Cc: Peter Zijlstra

    Frederic Weisbecker
     

14 Oct, 2010

6 commits


13 Oct, 2010

1 commit

  • Fix

    kernel/trace/trace_functions_graph.c: In function ‘trace_print_graph_duration’:
    kernel/trace/trace_functions_graph.c:652: warning: comparison of distinct pointer types lacks a cast

    when building 36-rc6 on a 32-bit due to the strict type check failing
    in the min() macro.

    Signed-off-by: Borislav Petkov
    Cc: Chase Douglas
    Cc: Steven Rostedt
    Cc: Ingo Molnar
    LKML-Reference:
    Signed-off-by: Frederic Weisbecker

    Borislav Petkov
     

08 Oct, 2010

1 commit


07 Oct, 2010

5 commits


06 Oct, 2010

5 commits

  • Since powerpc uses -Werror on arch powerpc, the build was broken like
    this:

    cc1: warnings being treated as errors
    arch/powerpc/kernel/module.c: In function 'module_finalize':
    arch/powerpc/kernel/module.c:66: error: unused variable 'err'

    Signed-off-by: Stephen Rothwell
    Signed-off-by: Linus Torvalds

    Stephen Rothwell
     
  • …/git/tip/linux-2.6-tip

    * 'core-fixes-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip:
    rcu: rcu_read_lock_bh_held(): disabling irqs also disables bh
    generic-ipi: Fix deadlock in __smp_call_function_single

    Linus Torvalds
     
  • …/git/tip/linux-2.6-tip

    * 'perf-fixes-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip:
    perf trace scripting: Fix extern struct definitions
    perf ui hist browser: Fix segfault on 'a' for annotate
    perf tools: Fix build breakage
    perf, x86: Handle in flight NMIs on P4 platform
    oprofile, ARM: Release resources on failure
    oprofile: Add Support for Intel CPU Family 6 / Model 29

    Linus Torvalds
     
  • The "flags" member of "struct wait_queue_t" is used in several places in
    the kernel code without beeing initialized by init_wait(). "flags" is
    used in bitwise operations.

    If "flags" not initialized then unexpected behaviour may take place.
    Incorrect flags might used later in code.

    Added initialization of "wait_queue_t.flags" with zero value into
    "init_wait".

    Signed-off-by: Evgeny Kuznetsov
    [ The bit we care about does end up being initialized by both
    prepare_to_wait() and add_to_wait_queue(), so this doesn't seem to
    cause actual bugs, but is definitely the right thing to do -Linus ]
    Signed-off-by: Linus Torvalds

    Evgeny Kuznetsov
     
  • With all the recent module loading cleanups, we've minimized the code
    that sits under module_mutex, fixing various deadlocks and making it
    possible to do most of the module loading in parallel.

    However, that whole conversion totally missed the rather obscure code
    that adds a new module to the list for BUG() handling. That code was
    doubly obscure because (a) the code itself lives in lib/bugs.c (for
    dubious reasons) and (b) it gets called from the architecture-specific
    "module_finalize()" rather than from generic code.

    Calling it from arch-specific code makes no sense what-so-ever to begin
    with, and is now actively wrong since that code isn't protected by the
    module loading lock any more.

    So this commit moves the "module_bug_{finalize,cleanup}()" calls away
    from the arch-specific code, and into the generic code - and in the
    process protects it with the module_mutex so that the list operations
    are now safe.

    Future fixups:
    - move the module list handling code into kernel/module.c where it
    belongs.
    - get rid of 'module_bug_list' and just use the regular list of modules
    (called 'modules' - imagine that) that we already create and maintain
    for other reasons.

    Reported-and-tested-by: Thomas Gleixner
    Cc: Rusty Russell
    Cc: Adrian Bunk
    Cc: Andrew Morton
    Cc: stable@kernel.org
    Signed-off-by: Linus Torvalds

    Linus Torvalds
     

05 Oct, 2010

12 commits