15 Oct, 2010

2 commits

  • 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
     
  • 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
     

14 Oct, 2010

1 commit


08 Oct, 2010

1 commit


06 Oct, 2010

2 commits

  • …/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
     
  • 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
     

04 Oct, 2010

1 commit

  • This patch fixes an error in perf_event_open() when the pid
    provided by the user is invalid. find_lively_task_by_vpid()
    does not return NULL on error but an error code. Without the
    fix the error code was silently passed to find_get_context()
    which would eventually cause a invalid pointer dereference.

    Signed-off-by: Stephane Eranian
    Cc: peterz@infradead.org
    Cc: paulus@samba.org
    Cc: davem@davemloft.net
    Cc: fweisbec@gmail.com
    Cc: perfmon2-devel@lists.sf.net
    Cc: eranian@gmail.com
    Cc: robert.richter@amd.com
    LKML-Reference:
    Signed-off-by: Ingo Molnar

    Stephane Eranian
     

02 Oct, 2010

1 commit

  • The kfifo_dma family of functions use sg_mark_end() on the last element in
    their scatterlist. This forces use of a fresh scatterlist for each DMA
    operation, which makes recycling a single scatterlist impossible.

    Change the behavior of the kfifo_dma functions to match the usage of the
    dma_map_sg function. This means that users must respect the returned
    nents value. The sample code is updated to reflect the change.

    This bug is trivial to cause: call kfifo_dma_in_prepare() such that it
    prepares a scatterlist with a single entry comprising the whole fifo.
    This is the case when you map the entirety of a newly created empty fifo.
    This causes the setup_sgl() function to mark the first scatterlist entry
    as the end of the chain, no matter what comes after it.

    Afterwards, add and remove some data from the fifo such that another call
    to kfifo_dma_in_prepare() will create two scatterlist entries. It returns
    nents=2. However, due to the previous sg_mark_end() call, sg_is_last()
    will now return true for the first scatterlist element. This causes the
    sample code to print a single scatterlist element when it should print
    two.

    By removing the call to sg_mark_end(), we make the API as similar as
    possible to the DMA mapping API. All users are required to respect the
    returned nents.

    Signed-off-by: Ira W. Snyder
    Cc: Stefani Seibold
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Ira W. Snyder
     

24 Sep, 2010

1 commit


23 Sep, 2010

6 commits

  • The below bug in fork led to the rmap walk finding the parent huge-pmd
    twice instead of just once, because the anon_vma_chain objects of the
    child vma still point to the vma->vm_mm of the parent.

    The patch fixes it by making the rmap walk accurate during fork. It's not
    a big deal normally but it worth being accurate considering the cost is
    the same.

    Signed-off-by: Andrea Arcangeli
    Acked-by: Johannes Weiner
    Acked-by: Rik van Riel
    Acked-by: Hugh Dickins
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Andrea Arcangeli
     
  • Make use of the jump label infrastructure for tracepoints.

    Signed-off-by: Jason Baron
    LKML-Reference:
    Signed-off-by: Steven Rostedt

    Jason Baron
     
  • Add a jump_label_text_reserved(void *start, void *end), so that other
    pieces of code that want to modify kernel text, can first verify that
    jump label has not reserved the instruction.

    Acked-by: Masami Hiramatsu
    Signed-off-by: Jason Baron
    LKML-Reference:
    Signed-off-by: Steven Rostedt

    Jason Baron
     
  • Initialize the workqueue data structures *before* they are registered
    so that they are ready for callbacks.

    Signed-off-by: Jason Baron
    LKML-Reference:
    Signed-off-by: Steven Rostedt

    Jason Baron
     
  • base patch to implement 'jump labeling'. Based on a new 'asm goto' inline
    assembly gcc mechanism, we can now branch to labels from an 'asm goto'
    statment. This allows us to create a 'no-op' fastpath, which can subsequently
    be patched with a jump to the slowpath code. This is useful for code which
    might be rarely used, but which we'd like to be able to call, if needed.
    Tracepoints are the current usecase that these are being implemented for.

    Acked-by: David S. Miller
    Signed-off-by: Jason Baron
    LKML-Reference:

    [ cleaned up some formating ]

    Signed-off-by: Steven Rostedt

    Jason Baron
     
  • Conflicts:
    kernel/hw_breakpoint.c

    Merge reason: resolve the conflict.

    Signed-off-by: Ingo Molnar

    Ingo Molnar
     

22 Sep, 2010

2 commits


21 Sep, 2010

3 commits

  • The per-pmu per-cpu context patch converted things from
    get_cpu_var() to this_cpu_ptr(), but that only works if
    rcu_read_lock() actually disables preemption, and since
    there is no such guarantee, we need to fix that.

    Use the newly introduced {get,put}_cpu_ptr().

    Signed-off-by: Peter Zijlstra
    Cc: Tejun Heo
    LKML-Reference:
    Signed-off-by: Ingo Molnar

    Peter Zijlstra
     
  • Merge reason: Pick up the latest fixes in -rc5.

    Signed-off-by: Ingo Molnar

    Ingo Molnar
     
  • There's a situation where the nohz balancer will try to wake itself:

    cpu-x is idle which is also ilb_cpu
    got a scheduler tick during idle
    and the nohz_kick_needed() in trigger_load_balance() checks for
    rq_x->nr_running which might not be zero (because of someone waking a
    task on this rq etc) and this leads to the situation of the cpu-x
    sending a kick to itself.

    And this can cause a lockup.

    Avoid this by not marking ourself eligible for kicking.

    Signed-off-by: Suresh Siddha
    Signed-off-by: Peter Zijlstra
    LKML-Reference:
    Signed-off-by: Ingo Molnar

    Suresh Siddha
     

17 Sep, 2010

6 commits

  • Revert the timer per cpu-context timers because of unfortunate
    nohz interaction. Fixing that would have been somewhat ugly, so
    go back to driving things from the regular tick. Provide a
    jiffies interval feature for people who want slower rotations.

    Signed-off-by: Peter Zijlstra
    Cc: Stephane Eranian
    Cc: Robert Richter
    Cc: Yinghai Lu
    LKML-Reference:
    Signed-off-by: Ingo Molnar

    Peter Zijlstra
     
  • Use the right cpu-context.. spotted by preempt warning on
    hot-unplug

    Signed-off-by: Peter Zijlstra
    Cc: Stephane Eranian
    Cc: Robert Richter
    LKML-Reference:
    Signed-off-by: Ingo Molnar

    Peter Zijlstra
     
  • Aside from allowing software events into a !software group,
    allow adding !software events to pure software groups.

    Once we've moved the software group and attached the first
    !software event, the group will no longer be a pure software
    group and hence no longer be eligible for movement, at which
    point the straight ctx comparison is correct again.

    Signed-off-by: Peter Zijlstra
    Cc: Stephane Eranian
    Cc: Robert Richter
    Cc: Paul Mackerras
    LKML-Reference:
    Signed-off-by: Ingo Molnar

    Peter Zijlstra
     
  • Events were not grouped anymore. The reason was that in
    perf_event_open(), the field event->group_leader was
    initialized before the function looked up the group_fd
    to find the event leader. This patch fixes this by
    reordering the code correctly.

    Signed-off-by: Stephane Eranian
    Signed-off-by: Peter Zijlstra
    Cc: Robert Richter
    LKML-Reference:
    Signed-off-by: Ingo Molnar

    Stephane Eranian
     
  • Hardware breakpoints can't be registered within pid namespaces
    because tsk->pid is passed rather than the pid in the current
    namespace.

    (See https://bugzilla.kernel.org/show_bug.cgi?id=17281 )

    This is a quick fix demonstrating the problem but is not the
    best method of solving the problem since passing pids internally
    is not the best way to avoid pid namespace bugs. Subsequent patches
    will show a better solution.

    Much thanks to Frederic Weisbecker for doing
    the bulk of the work finding this bug.

    Reported-by: Robin Green
    Signed-off-by: Matt Helsley
    Signed-off-by: Peter Zijlstra
    Cc: Prasad
    Cc: Arnaldo Carvalho de Melo
    Cc: Steven Rostedt
    Cc: Will Deacon
    Cc: Mahesh Salgaonkar
    Cc: 2.6.33-2.6.35
    LKML-Reference:
    Signed-off-by: Ingo Molnar
    Signed-off-by: Frederic Weisbecker

    Matt Helsley
     
  • * 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tj/wq:
    workqueue: add documentation

    Linus Torvalds
     

15 Sep, 2010

14 commits

  • This removes following warnings when build with C=1

    warning: context imbalance in 'kretprobe_hash_lock' - wrong count at exit
    warning: context imbalance in 'kretprobe_table_lock' - wrong count at exit
    warning: context imbalance in 'kretprobe_hash_unlock' - unexpected unlock
    warning: context imbalance in 'kretprobe_table_unlock' - unexpected unlock

    Signed-off-by: Namhyung Kim
    Acked-by: Masami Hiramatsu
    LKML-Reference:
    Signed-off-by: Ingo Molnar

    Namhyung Kim
     
  • Make following (internal) functions static to make sparse
    happier :-)

    * get_optimized_kprobe: only called from static functions
    * kretprobe_table_unlock: _lock function is static
    * kprobes_optinsn_template_holder: never called but holding asm code

    Signed-off-by: Namhyung Kim
    Acked-by: Masami Hiramatsu
    LKML-Reference:
    Signed-off-by: Ingo Molnar

    Namhyung Kim
     
  • Verify jprobe's entry point is a function entry point
    using kallsyms' offset value.

    Signed-off-by: Namhyung Kim
    Acked-by: Masami Hiramatsu
    LKML-Reference:
    Signed-off-by: Ingo Molnar

    Namhyung Kim
     
  • Remove call to kernel_text_address() in register_jprobes()
    because it is called right after in register_kprobe().

    Signed-off-by: Namhyung Kim
    Acked-by: Masami Hiramatsu
    LKML-Reference:
    Signed-off-by: Ingo Molnar

    Namhyung Kim
     
  • The kernel perf event creation path shouldn't use find_task_by_vpid()
    because a vpid exists in a specific namespace. find_task_by_vpid() uses
    current's pid namespace which isn't always the correct namespace to use
    for the vpid in all the places perf_event_create_kernel_counter() (and
    thus find_get_context()) is called.

    The goal is to clean up pid namespace handling and prevent bugs like:

    https://bugzilla.kernel.org/show_bug.cgi?id=17281

    Instead of using pids switch find_get_context() to use task struct
    pointers directly. The syscall is responsible for resolving the pid to
    a task struct. This moves the pid namespace resolution into the syscall
    much like every other syscall that takes pid parameters.

    Signed-off-by: Matt Helsley
    Signed-off-by: Peter Zijlstra
    Cc: Robin Green
    Cc: Prasad
    Cc: Arnaldo Carvalho de Melo
    Cc: Steven Rostedt
    Cc: Will Deacon
    Cc: Mahesh Salgaonkar
    LKML-Reference:
    Signed-off-by: Ingo Molnar

    Matt Helsley
     
  • Split out the code which searches for non-exiting tasks into its own
    helper. Creating this helper not only makes the code slightly more
    readable it prepares to move the search out of find_get_context() in
    a subsequent commit.

    Signed-off-by: Matt Helsley
    Signed-off-by: Peter Zijlstra
    Cc: Robin Green
    Cc: Prasad
    Cc: Arnaldo Carvalho de Melo
    Cc: Steven Rostedt
    Cc: Will Deacon
    Cc: Mahesh Salgaonkar
    LKML-Reference:
    Signed-off-by: Ingo Molnar

    Matt Helsley
     
  • Hardware breakpoints can't be registered within pid namespaces
    because tsk->pid is passed rather than the pid in the current
    namespace.

    (See https://bugzilla.kernel.org/show_bug.cgi?id=17281 )

    This is a quick fix demonstrating the problem but is not the
    best method of solving the problem since passing pids internally
    is not the best way to avoid pid namespace bugs. Subsequent patches
    will show a better solution.

    Much thanks to Frederic Weisbecker for doing the
    bulk of the work finding this bug.

    Signed-off-by: Matt Helsley
    Signed-off-by: Peter Zijlstra
    Cc: Robin Green
    Cc: Prasad
    Cc: Arnaldo Carvalho de Melo
    Cc: Steven Rostedt
    Cc: Will Deacon
    Cc: Mahesh Salgaonkar
    LKML-Reference:
    Signed-off-by: Ingo Molnar

    Matt Helsley
     
  • In case you boot with the watchdog disabled, i.e., nowatchdog, then,
    if you try to disable it via /proc/sys/kernel/watchdog, you get
    a kernel crash. The reason is that you are trying to cancel a hrtimer
    which has never been initialized.

    This patch fixes this by skipping execution of
    watchdog_disable_all_cpus() when the watchdog is marked
    disabled from boot.

    Signed-off-by: Stephane Eranian
    Signed-off-by: Peter Zijlstra
    LKML-Reference:
    Signed-off-by: Ingo Molnar

    Stephane Eranian
     
  • We have 32-bit variable overflow possibility when multiply in
    task_times() and thread_group_times() functions. When the
    overflow happens then the scaled utime value becomes erroneously
    small and the scaled stime becomes i erroneously big.

    Reported here:

    https://bugzilla.redhat.com/show_bug.cgi?id=633037
    https://bugzilla.kernel.org/show_bug.cgi?id=16559

    Reported-by: Michael Chapman
    Reported-by: Ciriaco Garcia de Celis
    Signed-off-by: Stanislaw Gruszka
    Signed-off-by: Peter Zijlstra
    Cc: Hidetoshi Seto
    Cc: # 2.6.32.19+ (partially) and 2.6.33+
    LKML-Reference:
    Signed-off-by: Ingo Molnar

    Stanislaw Gruszka
     
  • …stedt/linux-2.6-trace into perf/core

    Ingo Molnar
     
  • The enums for FTRACE_ENABLE_MCOUNT and FTRACE_DISABLE_MCOUNT were
    used as commands to ftrace_run_update_code(). But these commands
    were used by the old nasty ftrace daemon that has long been slain.

    This is a clean up patch to remove the references to these enums
    and simplify the code a little.

    Reported-by: Wu Zhangjin
    Signed-off-by: Steven Rostedt

    Steven Rostedt
     
  • When the function graph tracer funcgraph-irq option is zero, disable
    tracing in IRQs. This makes the option have two effects.

    1) When reading the trace file, do not display the functions that
    happen in interrupt context (when detected)

    2) [*new*] When recording a trace, skip those that are detected
    to be in interrupt by the 'in_irq()' function

    Note, in_irq() is updated at irq_enter() and irq_exit(). There are
    still functions that are recorded by the function graph tracer that
    is in interrupt context but outside the irq_enter/exit() routines.

    Signed-off-by: Steven Rostedt

    Steven Rostedt
     
  • It's handy to be able to disable the irq related output
    and not to have to jump over each irq related code, when
    you have no interrest in it.

    The option is by default enabled, so there's no change to
    current behaviour. It affects only the final output, so all
    the irq related data stay in the ring buffer.

    Signed-off-by: Jiri Olsa
    LKML-Reference:
    Signed-off-by: Steven Rostedt

    Jiri Olsa
     
  • compat_alloc_user_space() expects the caller to independently call
    access_ok() to verify the returned area. A missing call could
    introduce problems on some architectures.

    This patch incorporates the access_ok() check into
    compat_alloc_user_space() and also adds a sanity check on the length.
    The existing compat_alloc_user_space() implementations are renamed
    arch_compat_alloc_user_space() and are used as part of the
    implementation of the new global function.

    This patch assumes NULL will cause __get_user()/__put_user() to either
    fail or access userspace on all architectures. This should be
    followed by checking the return value of compat_access_user_space()
    for NULL in the callers, at which time the access_ok() in the callers
    can also be removed.

    Reported-by: Ben Hawkes
    Signed-off-by: H. Peter Anvin
    Acked-by: Benjamin Herrenschmidt
    Acked-by: Chris Metcalf
    Acked-by: David S. Miller
    Acked-by: Ingo Molnar
    Acked-by: Thomas Gleixner
    Acked-by: Tony Luck
    Cc: Andrew Morton
    Cc: Arnd Bergmann
    Cc: Fenghua Yu
    Cc: H. Peter Anvin
    Cc: Heiko Carstens
    Cc: Helge Deller
    Cc: James Bottomley
    Cc: Kyle McMartin
    Cc: Martin Schwidefsky
    Cc: Paul Mackerras
    Cc: Ralf Baechle
    Cc:

    H. Peter Anvin