16 Dec, 2010

6 commits


10 Dec, 2010

1 commit

  • Originally adapted from Huang Ying's patch which moved the
    unknown_nmi_panic to the traps.c file. Because the old nmi
    watchdog was deleted before this change happened, the
    unknown_nmi_panic sysctl was lost. This re-adds it.

    Also, the nmi_watchdog sysctl was re-implemented and its
    documentation updated accordingly.

    Patch-inspired-by: Huang Ying
    Signed-off-by: Don Zickus
    Reviewed-by: Cyrill Gorcunov
    Acked-by: Yinghai Lu
    Cc: fweisbec@gmail.com
    LKML-Reference:
    Signed-off-by: Ingo Molnar

    Don Zickus
     

09 Dec, 2010

2 commits

  • Use the reboot notifier to detach all running counters on reboot, this
    solves a problem with kexec where the new kernel doesn't expect
    running counters (rightly so).

    It will however decrease the coverage of the NMI watchdog. Making a
    kexec specific reboot notifier callback would be best, however that
    would require touching all notifier callback handlers as they are not
    properly structured to deal with new state.

    As a compromise, place the perf reboot notifier at the very last
    position in the list.

    Reported-by: Yinghai Lu
    Signed-off-by: Peter Zijlstra
    Cc: Vivek Goyal
    Cc: Eric W. Biederman
    Cc: Jason Wessel
    Cc: Don Zickus
    LKML-Reference:
    Signed-off-by: Ingo Molnar

    Peter Zijlstra
     
  • Because the multi-pmu bits can share contexts between struct pmu
    instances we could get duplicate events by iterating the pmu list.

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

    Peter Zijlstra
     

08 Dec, 2010

2 commits

  • …r-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip

    * 'x86-fixes-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip:
    x86/pvclock: Zero last_value on resume

    * 'perf-fixes-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip:
    perf record: Fix eternal wait for stillborn child
    perf header: Don't assume there's no attr info if no sample ids is provided
    perf symbols: Figure out start address of kernel map from kallsyms
    perf symbols: Fix kallsyms kernel/module map splitting

    * 'sched-fixes-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip:
    nohz: Fix printk_needs_cpu() return value on offline cpus
    printk: Fix wake_up_klogd() vs cpu hotplug

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

    * 'irq-fixes-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip:
    genirq: Fix incorrect proc spurious output

    Linus Torvalds
     

07 Dec, 2010

12 commits

  • …inux-2.6 into perf/core

    Ingo Molnar
     
  • Merge reason: Pick up the latest -rc.

    Signed-off-by: Ingo Molnar

    Ingo Molnar
     
  • * 'pm-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/suspend-2.6:
    PM / Hibernate: Fix memory corruption related to swap
    PM / Hibernate: Use async I/O when reading compressed hibernation image

    Linus Torvalds
     
  • There is a problem that swap pages allocated before the creation of
    a hibernation image can be released and used for storing the contents
    of different memory pages while the image is being saved. Since the
    kernel stored in the image doesn't know of that, it causes memory
    corruption to occur after resume from hibernation, especially on
    systems with relatively small RAM that need to swap often.

    This issue can be addressed by keeping the GFP_IOFS bits clear
    in gfp_allowed_mask during the entire hibernation, including the
    saving of the image, until the system is finally turned off or
    the hibernation is aborted. Unfortunately, for this purpose
    it's necessary to rework the way in which the hibernate and
    suspend code manipulates gfp_allowed_mask.

    This change is based on an earlier patch from Hugh Dickins.

    Signed-off-by: Rafael J. Wysocki
    Reported-by: Ondrej Zary
    Acked-by: Hugh Dickins
    Reviewed-by: KAMEZAWA Hiroyuki
    Cc: stable@kernel.org

    Rafael J. Wysocki
     
  • This is a fix for reading LZO compressed image using async I/O.
    Essentially, instead of having just one page into which we keep
    reading blocks from swap, we allocate enough of them to cover the
    largest compressed size and then let block I/O pick them all up. Once
    we have them all (and here we wait), we decompress them, as usual.
    Obviously, the very first block we still pick up synchronously,
    because we need to know the size of the lot before we pick up the
    rest.

    Also fixed the copyright line, which I've forgotten before.

    Signed-off-by: Bojan Smojver
    Signed-off-by: Rafael J. Wysocki

    Bojan Smojver
     
  • Use text_poke_smp_batch() on unoptimization path for reducing
    the number of stop_machine() issues. If the number of
    unoptimizing probes is more than MAX_OPTIMIZE_PROBES(=256),
    kprobes unoptimizes first MAX_OPTIMIZE_PROBES probes and kicks
    optimizer for remaining probes.

    Signed-off-by: Masami Hiramatsu
    Cc: Rusty Russell
    Cc: Frederic Weisbecker
    Cc: Ananth N Mavinakayanahalli
    Cc: Jason Baron
    Cc: Mathieu Desnoyers
    Cc: 2nddept-manager@sdl.hitachi.co.jp
    Cc: Peter Zijlstra
    Cc: Steven Rostedt
    LKML-Reference:
    Signed-off-by: Ingo Molnar

    Masami Hiramatsu
     
  • Use text_poke_smp_batch() in optimization path for reducing
    the number of stop_machine() issues. If the number of optimizing
    probes is more than MAX_OPTIMIZE_PROBES(=256), kprobes optimizes
    first MAX_OPTIMIZE_PROBES probes and kicks optimizer for
    remaining probes.

    Changes in v5:
    - Use kick_kprobe_optimizer() instead of directly calling
    schedule_delayed_work().
    - Rescheduling optimizer outside of kprobe mutex lock.

    Changes in v2:
    - Allocate code buffer and parameters in arch_init_kprobes()
    instead of using static arraies.
    - Merge previous max optimization limit patch into this patch.
    So, this patch introduces upper limit of optimization at
    once.

    Signed-off-by: Masami Hiramatsu
    Cc: Rusty Russell
    Cc: Frederic Weisbecker
    Cc: Ananth N Mavinakayanahalli
    Cc: Jason Baron
    Cc: Mathieu Desnoyers
    Cc: 2nddept-manager@sdl.hitachi.co.jp
    Cc: Peter Zijlstra
    Cc: Steven Rostedt
    LKML-Reference:
    Signed-off-by: Ingo Molnar

    Masami Hiramatsu
     
  • Reuse unused (waiting for unoptimizing and no user handler)
    kprobe on given address instead of returning -EBUSY for
    registering a new kprobe.

    Signed-off-by: Masami Hiramatsu
    Cc: Rusty Russell
    Cc: Frederic Weisbecker
    Cc: Ananth N Mavinakayanahalli
    Cc: Jason Baron
    Cc: Mathieu Desnoyers
    Cc: 2nddept-manager@sdl.hitachi.co.jp
    LKML-Reference:
    Signed-off-by: Ingo Molnar

    Masami Hiramatsu
     
  • Unoptimization occurs when a probe is unregistered or disabled,
    and is heavy because it recovers instructions by using
    stop_machine(). This patch delays unoptimization operations and
    unoptimize several probes at once by using
    text_poke_smp_batch(). This can avoid unexpected system slowdown
    coming from stop_machine().

    Changes in v5:
    - Split this patch into several cleanup patches and this patch.
    - Fix some text_mutex lock miss.
    - Use bool instead of int for behavior flags.
    - Add additional comment for (un)optimizing path.

    Changes in v2:
    - Use dynamic allocated buffers and params.

    Signed-off-by: Masami Hiramatsu
    Cc: Rusty Russell
    Cc: Frederic Weisbecker
    Cc: Ananth N Mavinakayanahalli
    Cc: Jason Baron
    Cc: Mathieu Desnoyers
    Cc: 2nddept-manager@sdl.hitachi.co.jp
    LKML-Reference:
    Signed-off-by: Ingo Molnar

    Masami Hiramatsu
     
  • Separate kprobe optimizing code from optimizer, this
    will make easy to introducing unoptimizing code in
    optimizer.

    Signed-off-by: Masami Hiramatsu
    Cc: Rusty Russell
    Cc: Frederic Weisbecker
    Cc: Ananth N Mavinakayanahalli
    Cc: Jason Baron
    Cc: Mathieu Desnoyers
    Cc: 2nddept-manager@sdl.hitachi.co.jp
    LKML-Reference:
    Signed-off-by: Ingo Molnar

    Masami Hiramatsu
     
  • Merge disabling kprobe to unregistering kprobe function
    and add comments for disabing/unregistring process.

    Current unregistering code disables(disarms) kprobes after
    checking target kprobe status. This patch changes it to
    disabling kprobe first after that it changing the kprobe's
    state. This allows to share probe disabling code between
    disable_kprobe() and unregister_kprobe().

    Signed-off-by: Masami Hiramatsu
    Cc: Rusty Russell
    Cc: Frederic Weisbecker
    Cc: Ananth N Mavinakayanahalli
    Cc: Jason Baron
    Cc: Mathieu Desnoyers
    Cc: 2nddept-manager@sdl.hitachi.co.jp
    LKML-Reference:
    Signed-off-by: Ingo Molnar

    Masami Hiramatsu
     
  • Rename irrelevant uses of "old_p" to more appropriate names.
    Originally, "old_p" just meant "the old kprobe on given address"
    but current code uses that name as "just another kprobe" or
    something like that. This patch renames those pointer names
    to more appropriate one for maintainability.

    Signed-off-by: Masami Hiramatsu
    Cc: Rusty Russell
    Cc: Frederic Weisbecker
    Cc: Ananth N Mavinakayanahalli
    Cc: Jason Baron
    Cc: Mathieu Desnoyers
    Cc: 2nddept-manager@sdl.hitachi.co.jp
    LKML-Reference:
    Signed-off-by: Ingo Molnar

    Masami Hiramatsu
     

05 Dec, 2010

3 commits

  • If perf_event_attr.sample_id_all is set it will add the PERF_SAMPLE_ identity
    info:

    TID, TIME, ID, CPU, STREAM_ID

    As a trailer, so that older perf tools can process new files, just ignoring the
    extra payload.

    With this its possible to do further analysis on problems in the event stream,
    like detecting reordering of MMAP and FORK events, etc.

    V2: Fixup header size in comm, mmap and task processing, as we have to take into
    account different sample_types for each matching event, noticed by Thomas Gleixner.

    Thomas also noticed a problem in v2 where if we didn't had space in the buffer we
    wouldn't restore the header size.

    Tested-by: Thomas Gleixner
    Reviewed-by: Thomas Gleixner
    Acked-by: Ian Munsie
    Acked-by: Peter Zijlstra
    Acked-by: Thomas Gleixner
    Cc: Frédéric Weisbecker
    Cc: Ian Munsie
    Cc: Mike Galbraith
    Cc: Peter Zijlstra
    Cc: Paul Mackerras
    Cc: Stephane Eranian
    Cc: Thomas Gleixner
    LKML-Reference:
    Signed-off-by: Arnaldo Carvalho de Melo

    Arnaldo Carvalho de Melo
     
  • Those will be made available in sample like events like MMAP, EXEC, etc in a
    followup patch. So precalculate the extra id header space and have a separate
    routine to fill them up.

    V2: Thomas noticed that the id header needs to be precalculated at
    inherit_events too:

    LKML-Reference:

    Tested-by: Thomas Gleixner
    Reviewed-by: Thomas Gleixner
    Acked-by: Ian Munsie
    Acked-by: Peter Zijlstra
    Acked-by: Thomas Gleixner
    Cc: Frédéric Weisbecker
    Cc: Ian Munsie
    Cc: Mike Galbraith
    Cc: Peter Zijlstra
    Cc: Paul Mackerras
    Cc: Stephane Eranian
    Cc: Thomas Gleixner
    LKML-Reference:
    Signed-off-by: Arnaldo Carvalho de Melo

    Arnaldo Carvalho de Melo
     
  • The precalculated header size is not updated when an event is inherited. That
    results in bogus sample entries for all child events. Bug introduced in c320c7b.

    Cc: Frederic Weisbecker
    Cc: Ian Munsie
    Cc: Ingo Molnar
    Cc: Mike Galbraith
    Cc: Paul Mackerras
    Cc: Peter Zijlstra
    Cc: Stephane Eranian
    LKML-Reference:
    Signed-off-by: Thomas Gleixner
    Signed-off-by: Arnaldo Carvalho de Melo

    Thomas Gleixner
     

03 Dec, 2010

1 commit

  • If a user manages to trigger an oops with fs set to KERNEL_DS, fs is not
    otherwise reset before do_exit(). do_exit may later (via mm_release in
    fork.c) do a put_user to a user-controlled address, potentially allowing
    a user to leverage an oops into a controlled write into kernel memory.

    This is only triggerable in the presence of another bug, but this
    potentially turns a lot of DoS bugs into privilege escalations, so it's
    worth fixing. I have proof-of-concept code which uses this bug along
    with CVE-2010-3849 to write a zero to an arbitrary kernel address, so
    I've tested that this is not theoretical.

    A more logical place to put this fix might be when we know an oops has
    occurred, before we call do_exit(), but that would involve changing
    every architecture, in multiple places.

    Let's just stick it in do_exit instead.

    [akpm@linux-foundation.org: update code comment]
    Signed-off-by: Nelson Elhage
    Cc: KOSAKI Motohiro
    Cc:
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Nelson Elhage
     

01 Dec, 2010

3 commits

  • Since commit a1afb637(switch /proc/irq/*/spurious to seq_file) all
    /proc/irq/XX/spurious files show the information of irq 0.

    Current irq_spurious_proc_open() passes on NULL as the 3rd argument,
    which is used as an IRQ number in irq_spurious_proc_show(), to the
    single_open(). Because of this, all the /proc/irq/XX/spurious file
    shows IRQ 0 information regardless of the IRQ number.

    To fix the problem, irq_spurious_proc_open() must pass on the
    appropreate data (IRQ number) to single_open().

    Signed-off-by: Kenji Kaneshige
    Reviewed-by: Yong Zhang
    LKML-Reference:
    Cc: stable@kernel.org [2.6.33+]
    Signed-off-by: Thomas Gleixner

    Kenji Kaneshige
     
  • PERF_SAMPLE_{CALLCHAIN,RAW} have variable lenghts per sample, but the others
    can be precalculated, reducing a bit the per sample cost.

    Acked-by: Peter Zijlstra
    Cc: Frédéric Weisbecker
    Cc: Ian Munsie
    Cc: Mike Galbraith
    Cc: Peter Zijlstra
    Cc: Paul Mackerras
    Cc: Stephane Eranian
    LKML-Reference:
    Signed-off-by: Arnaldo Carvalho de Melo

    Arnaldo Carvalho de Melo
     
  • The file_ops struct for the "trace" special file defined llseek as seq_lseek().
    However, if the file was opened for writing only, seq_open() was not called,
    and the seek would dereference a null pointer, file->private_data.

    This patch introduces a new wrapper for seq_lseek() which checks if the file
    descriptor is opened for reading first. If not, it does nothing.

    Cc:
    Signed-off-by: Slava Pestov
    LKML-Reference:
    Signed-off-by: Steven Rostedt

    Slava Pestov
     

29 Nov, 2010

1 commit


27 Nov, 2010

3 commits


26 Nov, 2010

6 commits