15 Nov, 2011

1 commit


08 Nov, 2011

1 commit

  • Merge reason: Resolve conflicts with Don's NMI rework:

    commit 9c48f1c629ecfa114850c03f875c6691003214de
    Author: Don Zickus
    Date: Fri Sep 30 15:06:21 2011 -0400
    x86, nmi: Wire up NMI handlers to new routines

    Conflicts:
    arch/x86/oprofile/nmi_timer_int.c

    Signed-off-by: Robert Richter

    Robert Richter
     

04 Nov, 2011

3 commits

  • The legacy x86 nmi watchdog code was removed with the implementation
    of the perf based nmi watchdog. This broke Oprofile's nmi timer
    mode. To run nmi timer mode we relied on a continuous ticking nmi
    source which the nmi watchdog provided. The nmi tick was no longer
    available and current watchdog can not be used anymore since it runs
    with very long periods in the range of seconds. This patch
    reimplements the nmi timer mode using a perf counter nmi source.

    V2:
    * removing pr_info()
    * fix undefined reference to `__udivdi3' for 32 bit build
    * fix section mismatch of .cpuinit.data:nmi_timer_cpu_nb
    * removed nmi timer setup in arch/x86
    * implemented function stubs for op_nmi_init/exit()
    * made code more readable in oprofile_init()

    V3:
    * fix architectural initialization in oprofile_init()
    * fix CONFIG_OPROFILE_NMI_TIMER dependencies

    Acked-by: Peter Zijlstra
    Signed-off-by: Robert Richter

    Robert Richter
     
  • We need this to better test x86 NMI timer mode. Otherwise it is very
    hard to setup systems with NMI timer enabled, but we have this e.g. in
    virtual machine environments.

    Signed-off-by: Robert Richter

    Robert Richter
     
  • If oprofile uses the nmi timer interrupt there is a crash while
    unloading the module. The bug can be triggered with oprofile build as
    module and kernel parameter nolapic set. This patch fixes this.

    oprofile: using NMI timer interrupt.
    BUG: unable to handle kernel NULL pointer dereference at 0000000000000008
    IP: [] unregister_syscore_ops+0x41/0x58
    PGD 42dbca067 PUD 41da6a067 PMD 0
    Oops: 0002 [#1] PREEMPT SMP
    CPU 5
    Modules linked in: oprofile(-) [last unloaded: oprofile]

    Pid: 2518, comm: modprobe Not tainted 3.1.0-rc7-00019-gb2fb49d #19 Advanced Micro Device Anaheim/Anaheim
    RIP: 0010:[] [] unregister_syscore_ops+0x41/0x58
    RSP: 0018:ffff88041ef71e98 EFLAGS: 00010296
    RAX: 0000000000000000 RBX: ffffffffa0017100 RCX: dead000000200200
    RDX: 0000000000000000 RSI: dead000000100100 RDI: ffffffff8178c620
    RBP: ffff88041ef71ea8 R08: 0000000000000001 R09: 0000000000000082
    R10: 0000000000000000 R11: ffff88041ef71de8 R12: 0000000000000080
    R13: fffffffffffffff5 R14: 0000000000000001 R15: 0000000000610210
    FS: 00007fc902f20700(0000) GS:ffff88042fd40000(0000) knlGS:0000000000000000
    CS: 0010 DS: 0000 ES: 0000 CR0: 000000008005003b
    CR2: 0000000000000008 CR3: 000000041cdb6000 CR4: 00000000000006e0
    DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
    DR3: 0000000000000000 DR6: 00000000ffff0ff0 DR7: 0000000000000400
    Process modprobe (pid: 2518, threadinfo ffff88041ef70000, task ffff88041d348040)
    Stack:
    ffff88041ef71eb8 ffffffffa0017790 ffff88041ef71eb8 ffffffffa0013532
    ffff88041ef71ec8 ffffffffa00132d6 ffff88041ef71ed8 ffffffffa00159b2
    ffff88041ef71f78 ffffffff81073115 656c69666f72706f 0000000000610200
    Call Trace:
    [] op_nmi_exit+0x15/0x17 [oprofile]
    [] oprofile_arch_exit+0xe/0x10 [oprofile]
    [] oprofile_exit+0x1e/0x20 [oprofile]
    [] sys_delete_module+0x1c3/0x22f
    [] ? trace_hardirqs_on_thunk+0x3a/0x3f
    [] system_call_fastpath+0x16/0x1b
    Code: 20 c6 78 81 e8 c5 cc 23 00 48 8b 13 48 8b 43 08 48 be 00 01 10 00 00 00 ad de 48 b9 00 02 20 00 00 00 ad de 48 c7 c7 20 c6 78 81
    89 42 08 48 89 10 48 89 33 48 89 4b 08 e8 a6 c0 23 00 5a 5b
    RIP [] unregister_syscore_ops+0x41/0x58
    RSP
    CR2: 0000000000000008
    ---[ end trace 43a541a52956b7b0 ]---

    CC: stable@kernel.org # 2.6.37+
    Signed-off-by: Robert Richter

    Robert Richter
     

26 Oct, 2011

1 commit

  • * 'perf-core-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: (121 commits)
    perf symbols: Increase symbol KSYM_NAME_LEN size
    perf hists browser: Refuse 'a' hotkey on non symbolic views
    perf ui browser: Use libslang to read keys
    perf tools: Fix tracing info recording
    perf hists browser: Elide DSO column when it is set to just one DSO, ditto for threads
    perf hists: Don't consider filtered entries when calculating column widths
    perf hists: Don't decay total_period for filtered entries
    perf hists browser: Honour symbol_conf.show_{nr_samples,total_period}
    perf hists browser: Do not exit on tab key with single event
    perf annotate browser: Don't change selection line when returning from callq
    perf tools: handle endianness of feature bitmap
    perf tools: Add prelink suggestion to dso update message
    perf script: Fix unknown feature comment
    perf hists browser: Apply the dso and thread filters when merging new batches
    perf hists: Move the dso and thread filters from hist_browser
    perf ui browser: Honour the xterm colors
    perf top tui: Give color hints just on the percentage, like on --stdio
    perf ui browser: Make the colors configurable and change the defaults
    perf tui: Remove unneeded call to newtCls on startup
    perf hists: Don't format the percentage on hist_entry__snprintf
    ...

    Fix up conflicts in arch/x86/kernel/kprobes.c manually.

    Ingo's tree did the insane "add volatile to const array", which just
    doesn't make sense ("volatile const"?). But we could remove the const
    *and* make the array volatile to make doubly sure that gcc doesn't
    optimize it away..

    Also fix up kernel/trace/ring_buffer.c non-data-conflicts manually: the
    reader_lock has been turned into a raw lock by the core locking merge,
    and there was a new user of it introduced in this perf core merge. Make
    sure that new use also uses the raw accessor functions.

    Linus Torvalds
     

10 Oct, 2011

3 commits

  • This patch implements IBS feature detection and initialzation. The
    code is shared between perf and oprofile. If IBS is available on the
    system for perf, a pmu is setup.

    Signed-off-by: Robert Richter
    Signed-off-by: Peter Zijlstra
    Link: http://lkml.kernel.org/r/1316597423-25723-3-git-send-email-robert.richter@amd.com
    Signed-off-by: Ingo Molnar

    Robert Richter
     
  • Moving IBS macros from oprofile to to make it
    available to perf. No additional changes.

    Signed-off-by: Robert Richter
    Signed-off-by: Peter Zijlstra
    Link: http://lkml.kernel.org/r/1316597423-25723-2-git-send-email-robert.richter@amd.com
    Signed-off-by: Ingo Molnar

    Robert Richter
     
  • Just convert all the files that have an nmi handler to the new routines.
    Most of it is straight forward conversion. A couple of places needed some
    tweaking like kgdb which separates the debug notifier from the nmi handler
    and mce removes a call to notify_die.

    [Thanks to Ying for finding out the history behind that mce call

    https://lkml.org/lkml/2010/5/27/114

    And Boris responding that he would like to remove that call because of it

    https://lkml.org/lkml/2011/9/21/163]

    The things that get converted are the registeration/unregistration routines
    and the nmi handler itself has its args changed along with code removal
    to check which list it is on (most are on one NMI list except for kgdb
    which has both an NMI routine and an NMI Unknown routine).

    Signed-off-by: Don Zickus
    Signed-off-by: Peter Zijlstra
    Acked-by: Corey Minyard
    Cc: Jason Wessel
    Cc: Andi Kleen
    Cc: Robert Richter
    Cc: Huang Ying
    Cc: Corey Minyard
    Cc: Jack Steiner
    Link: http://lkml.kernel.org/r/1317409584-23662-4-git-send-email-dzickus@redhat.com
    Signed-off-by: Ingo Molnar

    Don Zickus
     

13 Sep, 2011

1 commit

  • The oprofilefs_lock can be taken in atomic context (in profiling
    interrupts) and therefore cannot cannot be preempted on -rt -
    annotate it.

    In mainline this change documents the low level nature of
    the lock - otherwise there's no functional difference. Lockdep
    and Sparse checking will work as usual.

    Signed-off-by: Thomas Gleixner
    Signed-off-by: Ingo Molnar

    Thomas Gleixner
     

17 Aug, 2011

1 commit

  • Following fixes for:

    1d12d35 oprofile, x86: Convert memory allocation to static array

    Fix potential buffer overflow.

    Fix the following warning:

    arch/x86/oprofile/op_model_ppro.c: In function ‘ppro_check_ctrs’:
    arch/x86/oprofile/op_model_ppro.c:143: warning: label ‘out’ defined but not used

    Cc: Maarten Lankhorst
    Cc: Andi Kleen
    Signed-off-by: Robert Richter

    Robert Richter
     

02 Aug, 2011

1 commit

  • On -rt, allocators don't work from atomic context any more,
    and the maximum size of the array is known at compile time.

    Call trace on a -rt kernel:

    oprofile: using NMI interrupt.
    BUG: sleeping function called from invalid context at kernel/rtmutex.c:645
    in_atomic(): 1, irqs_disabled(): 1, pid: 0, name: kworker/0:1
    Pid: 0, comm: kworker/0:1 Tainted: G C 3.0.0-rt3-patser+ #39
    Call Trace:
    [] __might_sleep+0xca/0xf0
    [] rt_spin_lock+0x24/0x40
    [] __kmalloc+0xc7/0x370
    [] ? ppro_setup_ctrs+0x215/0x260 [oprofile]
    [] ? oprofile_cpu_notifier+0x60/0x60 [oprofile]
    [] ppro_setup_ctrs+0x215/0x260 [oprofile]
    [] ? oprofile_cpu_notifier+0x60/0x60 [oprofile]
    [] ? oprofile_cpu_notifier+0x60/0x60 [oprofile]
    [] nmi_cpu_setup+0xc4/0x110 [oprofile]
    [] generic_smp_call_function_interrupt+0x95/0x190
    [] smp_call_function_interrupt+0x27/0x40
    [] call_function_interrupt+0x13/0x20
    [] ? plist_check_head+0x54/0xc0
    [] ? intel_idle+0xc8/0x120
    [] ? intel_idle+0xa7/0x120
    [] cpuidle_idle_call+0xb0/0x230
    [] cpu_idle+0x8b/0xe0
    [] start_secondary+0x1d3/0x1d8

    Signed-off-by: Maarten Lankhorst
    Signed-off-by: Robert Richter

    Maarten Lankhorst
     

22 Jul, 2011

1 commit

  • copy_from_user_nmi() is used in oprofile and perf. Moving it to other
    library functions like copy_from_user(). As this is x86 code for 32
    and 64 bits, create a new file usercopy.c for unified code.

    Signed-off-by: Robert Richter
    Signed-off-by: Peter Zijlstra
    Link: http://lkml.kernel.org/r/20110607172413.GJ20052@erda.amd.com
    Signed-off-by: Ingo Molnar

    Robert Richter
     

15 Jun, 2011

2 commits

  • Current oprofile's x86 callgraph support may trigger page faults
    throwing the BUG_ON(in_nmi()) message below. This patch fixes this by
    using the same nmi-safe copy-from-user code as in perf.

    ------------[ cut here ]------------
    kernel BUG at .../arch/x86/kernel/traps.c:436!
    invalid opcode: 0000 [#1] SMP
    last sysfs file: /sys/devices/pci0000:00/0000:00:0a.0/0000:07:00.0/0000:08:04.0/net/eth0/broadcast
    CPU 5
    Modules linked in:

    Pid: 8611, comm: opcontrol Not tainted 2.6.39-00007-gfe47ae7 #1 Advanced Micro Device Anaheim/Anaheim
    RIP: 0010:[] [] do_nmi+0x22/0x1ee
    RSP: 0000:ffff88042fd47f28 EFLAGS: 00010002
    RAX: ffff88042c0a7fd8 RBX: 0000000000000001 RCX: 00000000c0000101
    RDX: 00000000ffff8804 RSI: ffffffffffffffff RDI: ffff88042fd47f58
    RBP: ffff88042fd47f48 R08: 0000000000000004 R09: 0000000000001484
    R10: 0000000000000001 R11: 0000000000000000 R12: ffff88042fd47f58
    R13: 0000000000000000 R14: ffff88042fd47d98 R15: 0000000000000020
    FS: 00007fca25e56700(0000) GS:ffff88042fd40000(0000) knlGS:0000000000000000
    CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033
    CR2: 0000000000000074 CR3: 000000042d28b000 CR4: 00000000000006e0
    DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
    DR3: 0000000000000000 DR6: 00000000ffff0ff0 DR7: 0000000000000400
    Process opcontrol (pid: 8611, threadinfo ffff88042c0a6000, task ffff88042c532310)
    Stack:
    0000000000000000 0000000000000001 ffff88042c0a7fd8 0000000000000000
    ffff88042fd47de8 ffffffff813e897a 0000000000000020 ffff88042fd47d98
    0000000000000000 ffff88042c0a7fd8 ffff88042fd47de8 0000000000000074
    Call Trace:

    [] nmi+0x1a/0x20
    [] ? bad_to_user+0x25/0x771
    <>
    Code: ff 59 5b 41 5c 41 5d c9 c3 55 65 48 8b 04 25 88 b5 00 00 48 89 e5 41 55 41 54 49 89 fc 53 48 83 ec 08 f6 80 47 e0 ff ff 04 74 04 0b eb fe 81 80 44 e0 ff ff 00 00 01 04 65 ff 04 25 c4 0f 01
    RIP [] do_nmi+0x22/0x1ee
    RSP
    ---[ end trace ed6752185092104b ]---
    Kernel panic - not syncing: Fatal exception in interrupt
    Pid: 8611, comm: opcontrol Tainted: G D 2.6.39-00007-gfe47ae7 #1
    Call Trace:
    [] panic+0x8c/0x188
    [] oops_end+0x81/0x8e
    [] die+0x55/0x5e
    [] do_trap+0x11c/0x12b
    [] do_invalid_op+0x91/0x9a
    [] ? do_nmi+0x22/0x1ee
    [] ? oprofile_add_sample+0x83/0x95
    [] ? op_amd_check_ctrs+0x4f/0x2cf
    [] invalid_op+0x15/0x20
    [] ? do_nmi+0x22/0x1ee
    [] ? do_nmi+0x67/0x1ee
    [] nmi+0x1a/0x20
    [] ? bad_to_user+0x25/0x771
    <>

    Cc: John Lumby
    Cc: Maynard Johnson
    Cc: # .37+
    Signed-off-by: Robert Richter

    Robert Richter
     
  • In some rare cases, nmis are generated immediately after the nmi
    handler of the cpu was started. This causes the counter not to be
    enabled. Before enabling the nmi handlers we need to set variable
    ctr_running first and make sure its value is written to memory.

    Also, the patch makes all existing barriers a memory barrier instead
    of a compiler barrier only.

    Reported-by: Suravee Suthikulpanit
    Cc: # .35+
    Signed-off-by: Robert Richter

    Robert Richter
     

08 Jun, 2011

1 commit


30 May, 2011

1 commit


27 May, 2011

1 commit


20 May, 2011

1 commit

  • IBS initialization is a mix of per-core register access and per-node
    pci device setup. Register access should be pinned to the cpu, but pci
    setup must run with preemption enabled.

    This patch better separates the code into non-/preemptible sections
    and fixes sleeping with preemption disabled. See bug message below.

    Fixes also freeing the eilvt entry by introducing put_eilvt().

    BUG: sleeping function called from invalid context at mm/slub.c:824
    in_atomic(): 1, irqs_disabled(): 0, pid: 32357, name: modprobe
    INFO: lockdep is turned off.
    Pid: 32357, comm: modprobe Not tainted 2.6.39-rc7+ #14
    Call Trace:
    [] __might_sleep+0x112/0x117
    [] kmem_cache_alloc_trace+0x4b/0xe7
    [] kzalloc.constprop.0+0x29/0x2b
    [] pci_get_subsys+0x36/0x78
    [] ? setup_APIC_eilvt+0xfb/0x139
    [] pci_get_device+0x16/0x18
    [] op_amd_init+0xd3/0x211 [oprofile]
    [] ? 0xffffffffa064cfff
    [] op_nmi_init+0x21e/0x26a [oprofile]
    [] oprofile_arch_init+0xe/0x26 [oprofile]
    [] oprofile_init+0x10/0x42 [oprofile]
    [] do_one_initcall+0x7f/0x13a
    [] sys_init_module+0x132/0x281
    [] system_call_fastpath+0x16/0x1b

    Reported-by: Dave Jones
    Cc: [2.6.37.x]
    Signed-off-by: Robert Richter

    Robert Richter
     

12 May, 2011

1 commit

  • Both warning and warning_symbol are nowhere used.
    Let's get rid of them.

    Signed-off-by: Richard Weinberger
    Cc: Oleg Nesterov
    Cc: Andrew Morton
    Cc: Huang Ying
    Cc: Soeren Sandmann Pedersen
    Cc: Namhyung Kim
    Cc: x86
    Cc: H. Peter Anvin
    Cc: Thomas Gleixner
    Cc: Robert Richter
    Cc: Paul Mundt
    Link: http://lkml.kernel.org/r/1305205872-10321-2-git-send-email-richard@nod.at
    Signed-off-by: Frederic Weisbecker

    Richard Weinberger
     

29 Mar, 2011

1 commit


25 Mar, 2011

1 commit

  • For some performance events it's useful to set the EDGE and INV
    bits and the CMASK mask in the counter control register. The list
    of predefined events Intel releases for each CPU has some events which
    require these settings to get more "natural" to use higher level events.

    oprofile currently doesn't allow this.

    This patch adds new extra configuration fields for them, so that
    they can be specified in oprofilefs.

    An updated oprofile daemon can then make use of this to set them.

    v2: Write back masked extra value to variable.

    Signed-off-by: Andi Kleen
    Signed-off-by: Robert Richter

    Andi Kleen
     

24 Mar, 2011

1 commit

  • Some subsystems in the x86 tree need to carry out suspend/resume and
    shutdown operations with one CPU on-line and interrupts disabled and
    they define sysdev classes and sysdevs or sysdev drivers for this
    purpose. This leads to unnecessarily complicated code and excessive
    memory usage, so switch them to using struct syscore_ops objects for
    this purpose instead.

    Generally, there are three categories of subsystems that use
    sysdevs for implementing PM operations: (1) subsystems whose
    suspend/resume callbacks ignore their arguments entirely (the
    majority), (2) subsystems whose suspend/resume callbacks use their
    struct sys_device argument, but don't really need to do that,
    because they can be implemented differently in an arguably simpler
    way (io_apic.c), and (3) subsystems whose suspend/resume callbacks
    use their struct sys_device argument, but the value of that argument
    is always the same and could be ignored (microcode_core.c). In all
    of these cases the subsystems in question may be readily converted to
    using struct syscore_ops objects for power management and shutdown.

    Signed-off-by: Rafael J. Wysocki
    Reviewed-by: Thomas Gleixner
    Acked-by: Ingo Molnar

    Rafael J. Wysocki
     

19 Mar, 2011

1 commit


18 Mar, 2011

1 commit

  • Current stack dump code scans entire stack and check each entry
    contains a pointer to kernel code. If CONFIG_FRAME_POINTER=y it
    could mark whether the pointer is valid or not based on value of
    the frame pointer. Invalid entries could be preceded by '?' sign.

    However this was not going to happen because scan start point
    was always higher than the frame pointer so that they could not
    meet.

    Commit 9c0729dc8062 ("x86: Eliminate bp argument from the stack
    tracing routines") delayed bp acquisition point, so the bp was
    read in lower frame, thus all of the entries were marked
    invalid.

    This patch fixes this by reverting above commit while retaining
    stack_frame() helper as suggested by Frederic Weisbecker.

    End result looks like below:

    before:

    [ 3.508329] Call Trace:
    [ 3.508551] [] ? panic+0x91/0x199
    [ 3.508662] [] ? printk+0x68/0x6a
    [ 3.508770] [] ? mount_block_root+0x257/0x26e
    [ 3.508876] [] ? mount_root+0x56/0x5a
    [ 3.508975] [] ? prepare_namespace+0x170/0x1a9
    [ 3.509216] [] ? kernel_init+0x1d2/0x1e2
    [ 3.509335] [] ? kernel_thread_helper+0x4/0x10
    [ 3.509442] [] ? restore_args+0x0/0x30
    [ 3.509542] [] ? kernel_init+0x0/0x1e2
    [ 3.509641] [] ? kernel_thread_helper+0x0/0x10

    after:

    [ 3.522991] Call Trace:
    [ 3.523351] [] panic+0x91/0x199
    [ 3.523468] [] ? printk+0x68/0x6a
    [ 3.523576] [] mount_block_root+0x257/0x26e
    [ 3.523681] [] mount_root+0x56/0x5a
    [ 3.523780] [] prepare_namespace+0x170/0x1a9
    [ 3.523885] [] kernel_init+0x1d2/0x1e2
    [ 3.523987] [] kernel_thread_helper+0x4/0x10
    [ 3.524228] [] ? restore_args+0x0/0x30
    [ 3.524345] [] ? kernel_init+0x0/0x1e2
    [ 3.524445] [] ? kernel_thread_helper+0x0/0x10

    -v5:
    * fix build breakage with oprofile

    -v4:
    * use 0 instead of regs->bp
    * separate out printk changes

    -v3:
    * apply comment from Frederic
    * add a couple of printk fixes

    Signed-off-by: Namhyung Kim
    Acked-by: Peter Zijlstra
    Acked-by: Frederic Weisbecker
    Cc: Soren Sandmann
    Cc: Paul Mackerras
    Cc: Arnaldo Carvalho de Melo
    Cc: Robert Richter
    LKML-Reference:
    Signed-off-by: Ingo Molnar

    Namhyung Kim
     

19 Jan, 2011

1 commit

  • Fix a bunch of
    warning: ‘inline’ is not at beginning of declaration
    messages when building a 'make allyesconfig' kernel with -Wextra.

    These warnings are trivial to kill, yet rather annoying when building with
    -Wextra.
    The more we can cut down on pointless crap like this the better (IMHO).

    A previous patch to do this for a 'allnoconfig' build has already been
    merged. This just takes the cleanup a little further.

    Signed-off-by: Jesper Juhl
    Signed-off-by: Jiri Kosina

    Jesper Juhl
     

12 Jan, 2011

1 commit

  • …/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: (28 commits)
    perf session: Fix infinite loop in __perf_session__process_events
    perf evsel: Support perf_evsel__open(cpus > 1 && threads > 1)
    perf sched: Use PTHREAD_STACK_MIN to avoid pthread_attr_setstacksize() fail
    perf tools: Emit clearer message for sys_perf_event_open ENOENT return
    perf stat: better error message for unsupported events
    perf sched: Fix allocation result check
    perf, x86: P4 PMU - Fix unflagged overflows handling
    dynamic debug: Fix build issue with older gcc
    tracing: Fix TRACE_EVENT power tracepoint creation
    tracing: Fix preempt count leak
    tracepoint: Add __rcu annotation
    tracing: remove duplicate null-pointer check in skb tracepoint
    tracing/trivial: Add missing comma in TRACE_EVENT comment
    tracing: Include module.h in define_trace.h
    x86: Save rbp in pt_regs on irq entry
    x86, dumpstack: Fix unused variable warning
    x86, NMI: Clean-up default_do_nmi()
    x86, NMI: Allow NMI reason io port (0x61) to be processed on any CPU
    x86, NMI: Remove DIE_NMI_IPI
    x86, NMI: Add priorities to handlers
    ...

    Linus Torvalds
     

09 Jan, 2011

1 commit


08 Jan, 2011

1 commit

  • * 'for-2.6.38' of git://git.kernel.org/pub/scm/linux/kernel/git/tj/percpu: (30 commits)
    gameport: use this_cpu_read instead of lookup
    x86: udelay: Use this_cpu_read to avoid address calculation
    x86: Use this_cpu_inc_return for nmi counter
    x86: Replace uses of current_cpu_data with this_cpu ops
    x86: Use this_cpu_ops to optimize code
    vmstat: User per cpu atomics to avoid interrupt disable / enable
    irq_work: Use per cpu atomics instead of regular atomics
    cpuops: Use cmpxchg for xchg to avoid lock semantics
    x86: this_cpu_cmpxchg and this_cpu_xchg operations
    percpu: Generic this_cpu_cmpxchg() and this_cpu_xchg support
    percpu,x86: relocate this_cpu_add_return() and friends
    connector: Use this_cpu operations
    xen: Use this_cpu_inc_return
    taskstats: Use this_cpu_ops
    random: Use this_cpu_inc_return
    fs: Use this_cpu_inc_return in buffer.c
    highmem: Use this_cpu_xx_return() operations
    vmstat: Use this_cpu_inc_return for vm statistics
    x86: Support for this_cpu_add, sub, dec, inc_return
    percpu: Generic support for this_cpu_add, sub, dec, inc_return
    ...

    Fixed up conflicts: in arch/x86/kernel/{apic/nmi.c, apic/x2apic_uv_x.c, process.c}
    as per Tejun.

    Linus Torvalds
     

07 Jan, 2011

3 commits

  • With priorities in place and no one really understanding the difference between
    DIE_NMI and DIE_NMI_IPI, just remove DIE_NMI_IPI and convert everyone to DIE_NMI.

    This also simplifies default_do_nmi() a little bit. Instead of calling the
    die_notifier in both the if and else part, just pull it out and call it before
    the if-statement. This has the side benefit of avoiding a call to the ioport
    to see if there is an external NMI sitting around until after the (more frequent)
    internal NMIs are dealt with.

    Patch-Inspired-by: Huang Ying
    Signed-off-by: Don Zickus
    Signed-off-by: Peter Zijlstra
    LKML-Reference:
    Signed-off-by: Ingo Molnar

    Don Zickus
     
  • In order to consolidate the NMI die_chain events, we need to setup the priorities
    for the die notifiers.

    I started by defining a bunch of common priorities that can be used by the
    notifier blocks. Then I modified the notifier blocks to use the newly created
    priorities.

    Now that the priorities are straightened out, it should be easier to remove the
    event DIE_NMI_IPI.

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

    Don Zickus
     
  • * 'x86-mce-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip:
    apic, amd: Make firmware bug messages more meaningful
    mce, amd: Remove goto in threshold_create_device()
    mce, amd: Add helper functions to setup APIC
    mce, amd: Shorten local variables mci_misc_{hi,lo}
    mce, amd: Implement mce_threshold_block_init() helper function

    Linus Torvalds
     

05 Jan, 2011

1 commit


03 Jan, 2011

1 commit

  • Disable preemption in init_ibs(). The function only checks the
    ibs capabilities and sets up pci devices (if necessary). It runs
    only on one cpu but operates with the local APIC and some MSRs,
    thus it is better to disable preemption.

    [ 7.034377] BUG: using smp_processor_id() in preemptible [00000000] code: modprobe/483
    [ 7.034385] caller is setup_APIC_eilvt+0x155/0x180
    [ 7.034389] Pid: 483, comm: modprobe Not tainted 2.6.37-rc1-20101110+ #1
    [ 7.034392] Call Trace:
    [ 7.034400] [] debug_smp_processor_id+0xd2/0xf0
    [ 7.034404] [] setup_APIC_eilvt+0x155/0x180
    [ ... ]

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

    Reported-by:
    Signed-off-by: Robert Richter
    Cc: oprofile-list@lists.sourceforge.net
    Cc: Peter Zijlstra
    Cc: Frederic Weisbecker
    Cc: Rafael J. Wysocki
    Cc: Dan Carpenter
    Cc: Andrew Morton
    Cc: [2.6.37.x]
    LKML-Reference:
    [ small cleanups ]
    Signed-off-by: Ingo Molnar

    Robert Richter
     

30 Dec, 2010

3 commits


23 Dec, 2010

1 commit

  • The x86 arch has shifted its use of the nmi_watchdog from a
    local implementation to the global one provide by
    kernel/watchdog.c. This shift has caused a whole bunch of
    compile problems under different config options. I attempt to
    simplify things with the patch below.

    In order to simplify things, I had to come to terms with the
    meaning of two terms ARCH_HAS_NMI_WATCHDOG and
    CONFIG_HARDLOCKUP_DETECTOR. Basically they mean the same thing,
    the former on a local level and the latter on a global level.

    With the old x86 nmi watchdog gone, there is no need to rely on
    defining the ARCH_HAS_NMI_WATCHDOG variable because it doesn't
    make sense any more. x86 will now use the global
    implementation.

    The changes below do a few things. First it changes the few
    places that relied on ARCH_HAS_NMI_WATCHDOG to use
    CONFIG_X86_LOCAL_APIC (the former was an alias for the latter
    anyway, so nothing unusual here). Those pieces of code were
    relying more on local apic functionality the nmi watchdog
    functionality, so the change should make sense.

    Second, I removed the x86 implementation of
    touch_nmi_watchdog(). It isn't need now, instead x86 will rely
    on kernel/watchdog.c's implementation.

    Third, I removed the #define ARCH_HAS_NMI_WATCHDOG itself from
    x86. And tweaked the include/linux/nmi.h file to tell users to
    look for an externally defined touch_nmi_watchdog in the case of
    ARCH_HAS_NMI_WATCHDOG _or_ CONFIG_HARDLOCKUP_DETECTOR. This
    changes removes some of the ugliness in that file.

    Finally, I added a Kconfig dependency for
    CONFIG_HARDLOCKUP_DETECTOR that said you can't have
    ARCH_HAS_NMI_WATCHDOG _and_ CONFIG_HARDLOCKUP_DETECTOR. You can
    only have one nmi_watchdog.

    Tested with
    ARCH=i386: allnoconfig, defconfig, allyesconfig, (various broken
    configs) ARCH=x86_64: allnoconfig, defconfig, allyesconfig,
    (various broken configs)

    Hopefully, after this patch I won't get any more compile broken
    emails. :-)

    v3:
    changed a couple of 'linux/nmi.h' -> 'asm/nmi.h' to pick-up correct function
    prototypes when CONFIG_HARDLOCKUP_DETECTOR is not set.

    Signed-off-by: Don Zickus
    Cc: Peter Zijlstra
    Cc: fweisbec@gmail.com
    LKML-Reference:
    Signed-off-by: Ingo Molnar

    Don Zickus
     

19 Dec, 2010

2 commits