17 Jan, 2012

1 commit

  • When suspending, there was a large list of warnings going something like:

    Device 'machinecheck1' does not have a release() function, it is broken and must be fixed

    This patch turns the static mce_devices into dynamically allocated, and
    properly frees them when they are removed from the system. It solves
    the warning messages on my laptop here.

    Reported-by: "Srivatsa S. Bhat"
    Reported-by: Linus Torvalds
    Tested-by: Djalal Harouni
    Cc: Kay Sievers
    Cc: Tony Luck
    Cc: Borislav Petkov
    Signed-off-by: Greg Kroah-Hartman
    Signed-off-by: Linus Torvalds

    Greg Kroah-Hartman
     

16 Jan, 2012

1 commit

  • * 'perf-core-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: (39 commits)
    perf tools: Fix compile error on x86_64 Ubuntu
    perf report: Fix --stdio output alignment when --showcpuutilization used
    perf annotate: Get rid of field_sep check
    perf annotate: Fix usage string
    perf kmem: Fix a memory leak
    perf kmem: Add missing closedir() calls
    perf top: Add error message for EMFILE
    perf test: Change type of '-v' option to INCR
    perf script: Add missing closedir() calls
    tracing: Fix compile error when static ftrace is enabled
    recordmcount: Fix handling of elf64 big-endian objects.
    perf tools: Add const.h to MANIFEST to make perf-tar-src-pkg work again
    perf tools: Add support for guest/host-only profiling
    perf kvm: Do guest-only counting by default
    perf top: Don't update total_period on process_sample
    perf hists: Stop using 'self' for struct hist_entry
    perf hists: Rename total_session to total_period
    x86: Add counter when debug stack is used with interrupts enabled
    x86: Allow NMIs to hit breakpoints in i386
    x86: Keep current stack in NMI breakpoints
    ...

    Linus Torvalds
     

14 Jan, 2012

1 commit

  • Commit 8a25a2fd126c ("cpu: convert 'cpu' and 'machinecheck' sysdev_class
    to a regular subsystem") changed how things are dealt with in the MCE
    subsystem. Some of the things that got broken due to this are CPU
    hotplug and suspend/hibernate.

    MCE uses per_cpu allocations of struct device. So, when a CPU goes
    offline and comes back online, in order to ensure that we start from a
    clean slate with respect to the MCE subsystem, zero out the entire
    per_cpu device structure to 0 before using it.

    Signed-off-by: Srivatsa S. Bhat
    Signed-off-by: Linus Torvalds

    Srivatsa S. Bhat
     

08 Jan, 2012

2 commits

  • …rostedt/linux-trace into perf/core

    Ingo Molnar
     
  • * 'driver-core-next' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/driver-core: (73 commits)
    arm: fix up some samsung merge sysdev conversion problems
    firmware: Fix an oops on reading fw_priv->fw in sysfs loading file
    Drivers:hv: Fix a bug in vmbus_driver_unregister()
    driver core: remove __must_check from device_create_file
    debugfs: add missing #ifdef HAS_IOMEM
    arm: time.h: remove device.h #include
    driver-core: remove sysdev.h usage.
    clockevents: remove sysdev.h
    arm: convert sysdev_class to a regular subsystem
    arm: leds: convert sysdev_class to a regular subsystem
    kobject: remove kset_find_obj_hinted()
    m86k: gpio - convert sysdev_class to a regular subsystem
    mips: txx9_sram - convert sysdev_class to a regular subsystem
    mips: 7segled - convert sysdev_class to a regular subsystem
    sh: dma - convert sysdev_class to a regular subsystem
    sh: intc - convert sysdev_class to a regular subsystem
    power: suspend - convert sysdev_class to a regular subsystem
    power: qe_ic - convert sysdev_class to a regular subsystem
    power: cmm - convert sysdev_class to a regular subsystem
    s390: time - convert sysdev_class to a regular subsystem
    ...

    Fix up conflicts with 'struct sysdev' removal from various platform
    drivers that got changed:
    - arch/arm/mach-exynos/cpu.c
    - arch/arm/mach-exynos/irq-eint.c
    - arch/arm/mach-s3c64xx/common.c
    - arch/arm/mach-s3c64xx/cpu.c
    - arch/arm/mach-s5p64x0/cpu.c
    - arch/arm/mach-s5pv210/common.c
    - arch/arm/plat-samsung/include/plat/cpu.h
    - arch/powerpc/kernel/sysfs.c
    and fix up cpu_is_hotpluggable() as per Greg in include/linux/cpu.h

    Linus Torvalds
     

07 Jan, 2012

9 commits

  • …ostedt/linux-trace into perf/core

    Ingo Molnar
     
  • * 'x86-mce-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
    x86: add IRQ context simulation in module mce-inject
    x86, mce, therm_throt: Don't report power limit and package level thermal throttle events in mcelog
    x86, MCE: Drain mcelog buffer
    x86, mce: Add wrappers for registering on the decode chain

    Linus Torvalds
     
  • * 'x86-cpu-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
    x86, centaur: Enable cx8 for VIA Eden too

    Linus Torvalds
     
  • * 'x86-cleanups-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
    x86: Use "do { } while(0)" for empty lock_cmos()/unlock_cmos() macros
    x86: Use "do { } while(0)" for empty flush_tlb_fix_spurious_fault() macro
    x86, CPU: Drop superfluous get_cpu_cap() prototype
    arch/x86/mm/pageattr.c: Quiet sparse noise; local functions should be static
    arch/x86/kernel/ptrace.c: Quiet sparse noise
    x86: Use kmemdup() in copy_thread(), rather than duplicating its implementation
    x86: Replace the EVT_TO_HPET_DEV() macro with an inline function

    Linus Torvalds
     
  • * 'x86-asm-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: (21 commits)
    x86: Fix atomic64_xxx_cx8() functions
    x86: Fix and improve cmpxchg_double{,_local}()
    x86_64, asm: Optimise fls(), ffs() and fls64()
    x86, bitops: Move fls64.h inside __KERNEL__
    x86: Fix and improve percpu_cmpxchg{8,16}b_double()
    x86: Report cpb and eff_freq_ro flags correctly
    x86/i386: Use less assembly in strlen(), speed things up a bit
    x86: Use the same node_distance for 32 and 64-bit
    x86: Fix rflags in FAKE_STACK_FRAME
    x86: Clean up and extend do_int3()
    x86: Call do_notify_resume() with interrupts enabled
    x86/div64: Add a micro-optimization shortcut if base is power of two
    x86-64: Cleanup some assembly entry points
    x86-64: Slightly shorten line system call entry and exit paths
    x86-64: Reduce amount of redundant code generated for invalidate_interruptNN
    x86-64: Slightly shorten int_ret_from_sys_call
    x86, efi: Convert efi_phys_get_time() args to physical addresses
    x86: Default to vsyscall=emulate
    x86-64: Set siginfo and context on vsyscall emulation faults
    x86: consolidate xchg and xadd macros
    ...

    Linus Torvalds
     
  • * 'x86-apic-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
    x86: Skip cpus with apic-ids >= 255 in !x2apic_mode
    x86, x2apic: Allow "nox2apic" to disable x2apic mode setup by BIOS
    x86, x2apic: Fallback to xapic when BIOS doesn't setup interrupt-remapping
    x86, acpi: Skip acpi x2apic entries if the x2apic feature is not present
    x86, apic: Add probe() for apic_flat
    x86: Simplify code by removing a !SMP #ifdefs from 'struct cpuinfo_x86'
    x86: Convert per-cpu counter icr_read_retry_count into a member of irq_stat
    x86: Add per-cpu stat counter for APIC ICR read tries
    pci, x86/io-apic: Allow PCI_IOAPIC to be user configurable on x86
    x86: Fix the !CONFIG_NUMA build of the new CPU ID fixup code support
    x86: Add NumaChip support
    x86: Add x86_init platform override to fix up NUMA core numbering
    x86: Make flat_init_apic_ldr() available

    Linus Torvalds
     
  • This resolves the conflict in the arch/arm/mach-s3c64xx/s3c6400.c file,
    and it fixes the build error in the arch/x86/kernel/microcode_core.c
    file, that the merge did not catch.

    The microcode_core.c patch was provided by Stephen Rothwell
    who was invaluable in the merge issues involved
    with the large sysdev removal process in the driver-core tree.

    Signed-off-by: Greg Kroah-Hartman

    Greg Kroah-Hartman
     
  • * 'perf-core-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: (106 commits)
    perf kvm: Fix copy & paste error in description
    perf script: Kill script_spec__delete
    perf top: Fix a memory leak
    perf stat: Introduce get_ratio_color() helper
    perf session: Remove impossible condition check
    perf tools: Fix feature-bits rework fallout, remove unused variable
    perf script: Add generic perl handler to process events
    perf tools: Use for_each_set_bit() to iterate over feature flags
    perf tools: Unify handling of features when writing feature section
    perf report: Accept fifos as input file
    perf tools: Moving code in some files
    perf tools: Fix out-of-bound access to struct perf_session
    perf tools: Continue processing header on unknown features
    perf tools: Improve macros for struct feature_ops
    perf: builtin-record: Document and check that mmap_pages must be a power of two.
    perf: builtin-record: Provide advice if mmap'ing fails with EPERM.
    perf tools: Fix truncated annotation
    perf script: look up thread using tid instead of pid
    perf tools: Look up thread names for system wide profiling
    perf tools: Fix comm for processes with named threads
    ...

    Linus Torvalds
     
  • * 'core-rcu-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: (64 commits)
    cpu: Export cpu_up()
    rcu: Apply ACCESS_ONCE() to rcu_boost() return value
    Revert "rcu: Permit rt_mutex_unlock() with irqs disabled"
    docs: Additional LWN links to RCU API
    rcu: Augment rcu_batch_end tracing for idle and callback state
    rcu: Add rcutorture tests for srcu_read_lock_raw()
    rcu: Make rcutorture test for hotpluggability before offlining CPUs
    driver-core/cpu: Expose hotpluggability to the rest of the kernel
    rcu: Remove redundant rcu_cpu_stall_suppress declaration
    rcu: Adaptive dyntick-idle preparation
    rcu: Keep invoking callbacks if CPU otherwise idle
    rcu: Irq nesting is always 0 on rcu_enter_idle_common
    rcu: Don't check irq nesting from rcu idle entry/exit
    rcu: Permit dyntick-idle with callbacks pending
    rcu: Document same-context read-side constraints
    rcu: Identify dyntick-idle CPUs on first force_quiescent_state() pass
    rcu: Remove dynticks false positives and RCU failures
    rcu: Reduce latency of rcu_prepare_for_idle()
    rcu: Eliminate RCU_FAST_NO_HZ grace-period hang
    rcu: Avoid needlessly IPIing CPUs at GP end
    ...

    Linus Torvalds
     

04 Jan, 2012

1 commit


24 Dec, 2011

1 commit


22 Dec, 2011

3 commits

  • This moves the 'cpu sysdev_class' over to a regular 'cpu' subsystem
    and converts the devices to regular devices. The sysdev drivers are
    implemented as subsystem interfaces now.

    After all sysdev classes are ported to regular driver core entities, the
    sysdev implementation will be entirely removed from the kernel.

    Userspace relies on events and generic sysfs subsystem infrastructure
    from sysdev devices, which are made available with this conversion.

    Cc: Haavard Skinnemoen
    Cc: Hans-Christian Egtvedt
    Cc: Tony Luck
    Cc: Fenghua Yu
    Cc: Arnd Bergmann
    Cc: Benjamin Herrenschmidt
    Cc: Paul Mackerras
    Cc: Martin Schwidefsky
    Cc: Heiko Carstens
    Cc: Paul Mundt
    Cc: "David S. Miller"
    Cc: Chris Metcalf
    Cc: Thomas Gleixner
    Cc: Ingo Molnar
    Cc: "H. Peter Anvin"
    Cc: Borislav Petkov
    Cc: Tigran Aivazian
    Cc: Len Brown
    Cc: Zhang Rui
    Cc: Dave Jones
    Cc: Peter Zijlstra
    Cc: Russell King
    Cc: Andrew Morton
    Cc: Arjan van de Ven
    Cc: "Rafael J. Wysocki"
    Cc: "Srivatsa S. Bhat"
    Signed-off-by: Kay Sievers
    Signed-off-by: Greg Kroah-Hartman

    Kay Sievers
     
  • Mathieu Desnoyers pointed out a case that can cause issues with
    NMIs running on the debug stack:

    int3 -> interrupt -> NMI -> int3

    Because the interrupt changes the stack, the NMI will not see that
    it preempted the debug stack. Looking deeper at this case,
    interrupts only happen when the int3 is from userspace or in
    an a location in the exception table (fixup).

    userspace -> int3 -> interurpt -> NMI -> int3

    All other int3s that happen in the kernel should be processed
    without ever enabling interrupts, as the do_trap() call will
    panic the kernel if it is called to process any other location
    within the kernel.

    Adding a counter around the sections that enable interrupts while
    using the debug stack allows the NMI to also check that case.
    If the NMI sees that it either interrupted a task using the debug
    stack or the debug counter is non-zero, then it will have to
    change the IDT table to make the int3 not change stacks (which will
    corrupt the stack if it does).

    Note, I had to move the debug_usage functions out of processor.h
    and into debugreg.h because of the static inlined functions to
    inc and dec the debug_usage counter. __get_cpu_var() requires
    smp.h which includes processor.h, and would fail to build.

    Link: http://lkml.kernel.org/r/1323976535.23971.112.camel@gandalf.stny.rr.com

    Reported-by: Mathieu Desnoyers
    Cc: Linus Torvalds
    Cc: Peter Zijlstra
    Cc: H. Peter Anvin
    Cc: Thomas Gleixner
    Cc: Paul Turner
    Cc: Frederic Weisbecker
    Signed-off-by: Steven Rostedt

    Steven Rostedt
     
  • We want to allow NMI handlers to have breakpoints to be able to
    remove stop_machine from ftrace, kprobes and jump_labels. But if
    an NMI interrupts a current breakpoint, and then it triggers a
    breakpoint itself, it will switch to the breakpoint stack and
    corrupt the data on it for the breakpoint processing that it
    interrupted.

    Instead, have the NMI check if it interrupted breakpoint processing
    by checking if the stack that is currently used is a breakpoint
    stack. If it is, then load a special IDT that changes the IST
    for the debug exception to keep the same stack in kernel context.
    When the NMI is done, it puts it back.

    This way, if the NMI does trigger a breakpoint, it will keep
    using the same stack and not stomp on the breakpoint data for
    the breakpoint it interrupted.

    Suggested-by: Peter Zijlstra
    Signed-off-by: Steven Rostedt

    Steven Rostedt
     

21 Dec, 2011

4 commits

  • Add event maps for Intel x86 processors (with architected PMU v2 or later).

    On AMD, there is frequency scaling but no Turbo. There is no core
    cycle event not subject to frequency scaling, therefore we do not
    provide a mapping.

    Signed-off-by: Stephane Eranian
    Signed-off-by: Peter Zijlstra
    Link: http://lkml.kernel.org/r/1323559734-3488-4-git-send-email-eranian@google.com
    Signed-off-by: Ingo Molnar

    Stephane Eranian
     
  • This patch adds the encoding and definitions necessary for the
    unhalted_reference_cycles event avaialble since Intel Core 2 processors.

    Signed-off-by: Stephane Eranian
    Signed-off-by: Peter Zijlstra
    Link: http://lkml.kernel.org/r/1323559734-3488-2-git-send-email-eranian@google.com
    Signed-off-by: Ingo Molnar

    Stephane Eranian
     
  • Several fields in struct cpuinfo_x86 were not defined for the
    !SMP case, likely to save space. However, those fields still
    have some meaning for UP, and keeping them allows some #ifdef
    removal from other files. The additional size of the UP kernel
    from this change is not significant enough to worry about
    keeping up the distinction:

    text data bss dec hex filename
    4737168 506459 972040 6215667 5ed7f3 vmlinux.o.before
    4737444 506459 972040 6215943 5ed907 vmlinux.o.after

    for a difference of 276 bytes for an example UP config.

    If someone wants those 276 bytes back badly then it should
    be implemented in a cleaner way.

    Signed-off-by: Kevin Winchester
    Cc: Steffen Persvold
    Link: http://lkml.kernel.org/r/1324428742-12498-1-git-send-email-kjwinchester@gmail.com
    Signed-off-by: Ingo Molnar

    Kevin Winchester
     
  • Merge reason: Update with the latest fixes.

    Signed-off-by: Ingo Molnar

    Ingo Molnar
     

18 Dec, 2011

1 commit


17 Dec, 2011

1 commit

  • mce-inject provides a mechanism to simulate errors so that test
    scripts can check for correct operation of the kernel without
    requiring any specialized hardware to create rare events.

    The existing code can simulate events in normal process context
    and also in NMI context - but not in IRQ context. This patch
    fills that gap.

    Link: https://lkml.org/lkml/2011/12/7/537
    Signed-off-by: Chen Gong
    Signed-off-by: Tony Luck

    Chen Gong
     

16 Dec, 2011

1 commit

  • My box with following cpuinfo needs the cx8 enabling still:

    vendor_id : CentaurHauls
    cpu family : 6
    model : 13
    model name : VIA Eden Processor 1200MHz
    stepping : 0
    cpu MHz : 1199.940
    cache size : 128 KB

    This fixes valgrind to work on my box (it requires and checks
    cx8 from cpuinfo).

    Signed-off-by: Timo Teräs
    Link: http://lkml.kernel.org/r/1323961888-10223-1-git-send-email-timo.teras@iki.fi
    Signed-off-by: H. Peter Anvin

    Timo Teräs
     

15 Dec, 2011

3 commits

  • Add the flags to get rid of the [9] and [10] feature names
    in cpuinfo's 'power management' fields and replace them with
    meaningful names.

    Signed-off-by: Joerg Roedel
    Link: http://lkml.kernel.org/r/1323875574-17881-1-git-send-email-joerg.roedel@amd.com
    Signed-off-by: Ingo Molnar

    Joerg Roedel
     
  • Ingo Molnar
     
  • Thermal throttle and power limit events are not defined as MCE errors in x86
    architecture and should not generate MCE errors in mcelog.

    Current kernel generates fake software defined MCE errors for these events.
    This may confuse users because they may think the machine has real MCE errors
    while actually only thermal throttle or power limit events happen.

    To make it worse, buggy firmware on some platforms may falsely generate
    the events. Therefore, kernel reports MCE errors which users think as real
    hardware errors. Although the firmware bugs should be fixed, on the other hand,
    kernel should not report MCE errors either.

    So mcelog is not a good mechanism to report these events. To report the events, we count them in respective counters (core_power_limit_count,
    package_power_limit_count, core_throttle_count, and package_throttle_count) in
    /sys/devices/system/cpu/cpu#/thermal_throttle/. Users can check the counters
    for each event on each CPU. Please note that all CPU's on one package report
    duplicate counters. It's user application's responsibity to retrieve a package
    level counter for one package.

    This patch doesn't report package level power limit, core level power limit, and
    package level thermal throttle events in mcelog. When the events happen, only
    report them in respective counters in sysfs.

    Since core level thermal throttle has been legacy code in kernel for a while and
    users accepted it as MCE error in mcelog, core level thermal throttle is still
    reported in mcelog. In the mean time, the event is counted in a counter in sysfs
    as well.

    Signed-off-by: Fenghua Yu
    Acked-by: Borislav Petkov
    Acked-by: Tony Luck
    Link: http://lkml.kernel.org/r/20111215001945.GA21009@linux-os.sc.intel.com
    Signed-off-by: H. Peter Anvin

    Fenghua Yu
     

14 Dec, 2011

2 commits


12 Dec, 2011

1 commit

  • Interrupts notify the idle exit state before calling irq_enter().
    But the notifier code calls rcu_read_lock() and this is not
    allowed while rcu is in an extended quiescent state. We need
    to wait for irq_enter() -> rcu_idle_exit() to be called before
    doing so otherwise this results in a grumpy RCU:

    [ 0.099991] WARNING: at include/linux/rcupdate.h:194 __atomic_notifier_call_chain+0xd2/0x110()
    [ 0.099991] Hardware name: AMD690VM-FMH
    [ 0.099991] Modules linked in:
    [ 0.099991] Pid: 0, comm: swapper Not tainted 3.0.0-rc6+ #255
    [ 0.099991] Call Trace:
    [ 0.099991] [] warn_slowpath_common+0x7a/0xb0
    [ 0.099991] [] warn_slowpath_null+0x15/0x20
    [ 0.099991] [] __atomic_notifier_call_chain+0xd2/0x110
    [ 0.099991] [] atomic_notifier_call_chain+0x11/0x20
    [ 0.099991] [] exit_idle+0x43/0x50
    [ 0.099991] [] smp_apic_timer_interrupt+0x39/0xa0
    [ 0.099991] [] apic_timer_interrupt+0x13/0x20
    [ 0.099991] [] ? default_idle+0xa7/0x350
    [ 0.099991] [] ? default_idle+0xa5/0x350
    [ 0.099991] [] amd_e400_idle+0x8b/0x110
    [ 0.099991] [] ? rcu_enter_nohz+0x8f/0x160
    [ 0.099991] [] cpu_idle+0xb0/0x110
    [ 0.099991] [] rest_init+0xe5/0x140
    [ 0.099991] [] ? rest_init+0x48/0x140
    [ 0.099991] [] start_kernel+0x3d1/0x3dc
    [ 0.099991] [] x86_64_start_reservations+0x131/0x135
    [ 0.099991] [] x86_64_start_kernel+0xed/0xf4

    Signed-off-by: Frederic Weisbecker
    Cc: Paul E. McKenney
    Cc: Ingo Molnar
    Cc: Thomas Gleixner
    Cc: H. Peter Anvin
    Cc: Andy Henroid
    Signed-off-by: Paul E. McKenney
    Reviewed-by: Josh Triplett

    Frederic Weisbecker
     

09 Dec, 2011

1 commit


07 Dec, 2011

3 commits

  • KVM needs to know perf capability to decide which PMU it can expose to a
    guest.

    Signed-off-by: Gleb Natapov
    Signed-off-by: Peter Zijlstra
    Link: http://lkml.kernel.org/r/1320929850-10480-8-git-send-email-gleb@redhat.com
    Signed-off-by: Ingo Molnar

    Gleb Natapov
     
  • Implement the disabling of arch events as a quirk so that we can print
    a message along with it. This creates some visibility into the problem
    space and could allow us to work on adding more work-around like the
    AAJ80 one.

    Requested-by: Ingo Molnar
    Cc: Gleb Natapov
    Signed-off-by: Peter Zijlstra
    Link: http://lkml.kernel.org/n/tip-wcja2z48wklzu1b0nkz0a5y7@git.kernel.org
    Signed-off-by: Ingo Molnar

    Peter Zijlstra
     
  • Intel CPUs report non-available architectural events in cpuid leaf
    0AH.EBX. Use it to disable events that are not available according
    to CPU.

    Signed-off-by: Gleb Natapov
    Signed-off-by: Peter Zijlstra
    Link: http://lkml.kernel.org/r/1320929850-10480-7-git-send-email-gleb@redhat.com
    Signed-off-by: Ingo Molnar

    Gleb Natapov
     

06 Dec, 2011

4 commits

  • This avoids a scheduling failure for cases like:

    cycles, cycles, instructions, instructions (on Core2)

    Which would end up being programmed like:

    PMC0, PMC1, FP-instructions, fail

    Because all events will have the same weight.

    Signed-off-by: Peter Zijlstra
    Link: http://lkml.kernel.org/n/tip-8tnwb92asqj7xajqqoty4gel@git.kernel.org
    Signed-off-by: Ingo Molnar

    Peter Zijlstra
     
  • The current x86 event scheduler fails to resolve scheduling problems
    of certain combinations of events and constraints. This happens if the
    counter mask of such an event is not a subset of any other counter
    mask of a constraint with an equal or higher weight, e.g. constraints
    of the AMD family 15h pmu:

    counter mask weight

    amd_f15_PMC30 0x09 2 overlap.
    * Reimplementation using perf scheduling helper functions.

    V3:
    * Added WARN_ON_ONCE() if out of save states.
    * Changed function interface of perf_sched_restore_state() to use bool
    as return value.

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

    Robert Richter
     
  • This patch introduces x86 perf scheduler code helper functions. We
    need this to later add more complex functionality to support
    overlapping counter constraints (next patch).

    The algorithm is modified so that the range of weight values is now
    generated from the constraints. There shouldn't be other functional
    changes.

    With the helper functions the scheduler is controlled. There are
    functions to initialize, traverse the event list, find unused counters
    etc. The scheduler keeps its own state.

    V3:
    * Added macro for_each_set_bit_cont().
    * Changed functions interfaces of perf_sched_find_counter() and
    perf_sched_next_event() to use bool as return value.
    * Added some comments to make code better understandable.

    V4:
    * Fix broken event assignment if weight of the first event is not
    wmin (perf_sched_init()).

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

    Robert Richter
     
  • I used "ifdef CONFIG_NUMA" simply because it doesn't make
    sense in a non-numa configuration even with SMP enabled.

    Besides, the only place where it is called right now is
    in kernel/cpu/amd.c:srat_detect_node() within the
    "CONFIG_NUMA" protected part.

    Signed-off-by: Steffen Persvold
    Cc: Daniel J Blueman
    Cc: Jesse Barnes
    Link: http://lkml.kernel.org/r/1323073238-32686-2-git-send-email-daniel@numascale-asia.com
    Signed-off-by: Ingo Molnar

    Steffen Persvold