15 Sep, 2010

17 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
     
  • Remove __dummy_buf which is needed for kallsyms_lookup only.
    use kallsysm_lookup_size_offset instead.

    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
     
  • 3f6da390 ("perf: Rework and fix the arch CPU-hotplug hooks") introduced
    this breakage. sh_pmu_setup() is missing an opening curly brace.

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

    Matt Fleming
     
  • Also fix a few compile errors due to undefined and duplicated
    variables.

    Signed-off-by: Michael Cree
    Signed-off-by: Peter Zijlstra
    LKML-Reference:
    Signed-off-by: Ingo Molnar

    Michael Cree
     
  • 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
     
  • …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
     
  • If we do:

    # cd /sys/kernel/debug
    # echo 'do_IRQ:traceon schedule:traceon sys_write:traceon' > \
    set_ftrace_filter
    # cat set_ftrace_filter

    We get the following output:

    #### all functions enabled ####
    sys_write:traceon:unlimited
    schedule:traceon:unlimited
    do_IRQ:traceon:unlimited

    This outputs two lists. One is the fact that all functions are
    currently enabled for function tracing, the other has three probed
    functions, which happen to have 'traceon' as their commands.

    Currently, when reading the first list (functions enabled) the
    seq_file code will receive a "NULL" from the t_next() function
    causing it to exit early. This makes "read()" from userspace stop
    reading the code at this boarder. Although read is allowed to do this,
    some (broken) applications might consider this an end of file and
    stop early.

    This patch adds the start of the second list to t_next() when it
    finishes the first list. It is a simple change and gives the
    set_ftrace_filter file nicer reading ability.

    Signed-off-by: Steven Rostedt

    Steven Rostedt
     
  • This patch keeps track of the index within the elements of
    set_ftrace_filter and if the position goes backwards, it nicely
    resets and starts from the beginning again.

    This allows for lseek and pread to work properly now.

    Signed-off-by: Steven Rostedt

    Steven Rostedt
     

14 Sep, 2010

11 commits

  • The set_ftrace_filter uses seq_file and reads from two lists. The
    pointer returned by t_next() can either be of type struct dyn_ftrace
    or struct ftrace_func_probe. If there is a bug (there was one)
    the wrong pointer may be used and the reference can cause an oops.

    This patch makes t_next() and friends only return the iterator structure
    which now has a pointer of type struct dyn_ftrace and struct
    ftrace_func_probe. The t_show() can now test if the pointer is NULL or
    not and if the pointer exists, it is guaranteed to be of the correct type.

    Now if there's a bug, only wrong data will be shown but not an oops.

    Cc: Chris Wright
    Signed-off-by: Steven Rostedt

    Steven Rostedt
     
  • After the filtered functions are read, the probed functions are read
    from the hash in set_ftrace_filter. When the hashed probed functions
    are read, the *pos passed in is reset. Instead of modifying the pos
    given to the read function, just record the pos where the filtered
    functions ended and subtract from that.

    Signed-off-by: Steven Rostedt

    Steven Rostedt
     
  • * 'sched/urgent' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip:
    sched: Improve latencies under load by decreasing minimum scheduling granularity

    Linus Torvalds
     
  • * 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/geert/linux-m68k:
    m68k,m68knommu: Wire up fanotify_init, fanotify_mark, and prlimit64

    Linus Torvalds
     
  • * 'release' of git://git.kernel.org/pub/scm/linux/kernel/git/aegl/linux-2.6:
    [IA64] fix siglock

    Quoth Tony:

    "I committed the fix for this last week prior to your -rc4 announcement
    reminding us to give proper "Reported-by:" credit. This one should have
    had:

    Reported-by: Tony Ernst

    and also

    Much-useful-investigation-and-tracing-by: Hedi Berriche
    Much-useful-investigation-and-tracing-by: Petr Tesarik "

    Linus Torvalds
     
  • * git://git.kernel.org/pub/scm/linux/kernel/git/sfrench/cifs-2.6:
    cifs: prevent possible memory corruption in cifs_demultiplex_thread
    cifs: eliminate some more premature cifsd exits
    cifs: prevent cifsd from exiting prematurely
    [CIFS] ntlmv2/ntlmssp remove-unused-function CalcNTLMv2_partial_mac_key
    cifs: eliminate redundant xdev check in cifs_rename
    Revert "[CIFS] Fix ntlmv2 auth with ntlmssp"
    Revert "missing changes during ntlmv2/ntlmssp auth and sign"
    Revert "Eliminate sparse warning - bad constant expression"
    Revert "[CIFS] Eliminate unused variable warning"

    Linus Torvalds
     
  • * 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/ericvh/v9fs:
    fs/9p: Don't use dotl version of mknod for dotu inode operations
    fs/9p: Use the correct dentry operations
    9p: Check for NULL fid in v9fs_dir_release()
    fs/9p: Fix error handling in v9fs_get_sb
    fs/9p, net/9p: memory leak fixes

    Linus Torvalds
     
  • * 'for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jack/linux-fs-2.6:
    dquot: do full inode dirty in allocating space

    Linus Torvalds
     
  • * 'next-spi' of git://git.secretlab.ca/git/linux-2.6:
    spi/pl022: move probe call to subsys_initcall()
    powerpc/5200: mpc52xx_uart.c: Add of_node_put to avoid memory leak
    spi/pl022: fix APB pclk power regression on U300
    spi/spi_s3c64xx: Warn if PIO transfers time out
    spi/s3c64xx: Fix incorrect reuse of 'val' local variable.
    spi/s3c64xx: Fix compilation warning
    spi/dw_spi: clean the cs_control code
    spi/dw_spi: Allow interrupt sharing
    spi/spi_s3c64xx: Increase dead reckoning time in wait_for_xfer()
    spi/spi_s3c64xx: Move to subsys_initcall()
    spi: free children in spi_unregister_master, not siblings
    gpiolib: Add 'struct gpio_chip' forward declaration for !GPIOLIB case
    of: Fix missing includes - ll_temac
    spi/spi_s3c64xx: Staticise non-exported functions
    spi/spi_s3c64xx: Make probe more robust against missing board config

    Linus Torvalds
     
  • Signed-off-by: Geert Uytterhoeven
    Acked-by: Greg Ungerer

    Geert Uytterhoeven
     
  • Mathieu reported bad latencies with make -j10 kind of kbuild
    workloads - which is mostly caused by us scheduling with a
    too coarse granularity.

    Reduce the minimum granularity some more, to make sure we
    can meet the latency target.

    I got the following results (make -j10 kbuild load, average of 3
    runs):

    vanilla:

    maximum latency: 38278.9 µs
    average latency: 7730.1 µs

    patched:

    maximum latency: 22702.1 µs
    average latency: 6684.8 µs

    Mathieu also measured it:

    |
    | * wakeup-latency.c (SIGEV_THREAD) with make -j10
    |
    | - Mainline 2.6.35.2 kernel
    |
    | maximum latency: 45762.1 µs
    | average latency: 7348.6 µs
    |
    | - With only Peter's smaller min_gran (shown below):
    |
    | maximum latency: 29100.6 µs
    | average latency: 6684.1 µs
    |

    Reported-by: Mathieu Desnoyers
    Reported-by: Linus Torvalds
    Acked-by: Mathieu Desnoyers
    Suggested-by: Peter Zijlstra
    Acked-by: Peter Zijlstra
    LKML-Reference:
    Signed-off-by: Ingo Molnar

    Ingo Molnar
     

13 Sep, 2010

10 commits


12 Sep, 2010

2 commits

  • Fix docbook templates that reference files that do not contain the
    expected kernel-doc notation.

    Fixes these warnings:

    Warning(arch/x86/include/asm/unaligned.h): no structured comments found
    Warning(lib/vsprintf.c): no structured comments found

    These cause errors in the generated html output, like below, so drop
    these lines.

    Name
    arch/x86/include/asm/unaligned.h - Document generation inconsistency
    Oops
    Warning
    The template for this document tried to insert the structured comment from the file arch/x86/include/asm/unaligned.h at this point, but none was found. This dummy section is inserted to allow generation to continue.

    Signed-off-by: Randy Dunlap
    Signed-off-by: Linus Torvalds

    Randy Dunlap
     
  • When you don't use !E or !I but only !F, then it's very easy to miss
    including some functions, structs etc. in documentation. To help
    finding which ones were missed, allow printing out the unused ones as
    warnings.

    For example, using this on mac80211 yields a lot of warnings like this:

    Warning: didn't use docs for DOC: mac80211 workqueue
    Warning: didn't use docs for ieee80211_max_queues
    Warning: didn't use docs for ieee80211_bss_change
    Warning: didn't use docs for ieee80211_bss_conf

    when generating the documentation for it.

    Signed-off-by: Johannes Berg
    Signed-off-by: Randy Dunlap
    Signed-off-by: Linus Torvalds

    Johannes Berg