26 Sep, 2006

40 commits

  • For NUMA optimization and some other algorithms it is useful to have a fast
    to get the current CPU and node numbers in user space.

    x86-64 added a fast way to do this in a vsyscall. This adds a generic
    syscall for other architectures to make it a generic portable facility.

    I expect some of them will also implement it as a faster vsyscall.

    The cache is an optimization for the x86-64 vsyscall optimization. Since
    what the syscall returns is an approximation anyways and user space
    often wants very fast results it can be cached for some time. The norma
    methods to get this information in user space are relatively slow

    The vsyscall is in a better position to manage the cache because it has direct
    access to a fast time stamp (jiffies). For the generic syscall optimization
    it doesn't help much, but enforce a valid argument to keep programs
    portable

    I only added an i386 syscall entry for now. Other architectures can follow
    as needed.

    AK: Also added some cleanups from Andrew Morton

    Signed-off-by: Andi Kleen

    Andi Kleen
     
  • This patch adds a vgetcpu vsyscall, which depending on the CPU RDTSCP
    capability uses either the RDTSCP or CPUID to obtain a CPU and node
    numbers and pass them to the program.

    AK: Lots of changes over Vojtech's original code:
    Better prototype for vgetcpu()
    It's better to pass the cpu / node numbers as separate arguments
    to avoid mistakes when going from SMP to NUMA.
    Also add a fast time stamp based cache using a user supplied
    argument to speed things more up.
    Use fast method from Chuck Ebbert to retrieve node/cpu from
    GDT limit instead of CPUID
    Made sure RDTSCP init is always executed after node is known.
    Drop printk

    Signed-off-by: Vojtech Pavlik
    Signed-off-by: Andi Kleen

    Vojtech Pavlik
     
  • This patch adds initalization of the RDTSCP auxilliary values to CPU numbers
    to time.c. If RDTSCP is available, the MSRs are written with the respective
    values. It can be later used to initalize per-cpu timekeeping variables.

    AK: Some cleanups. Move externs into headers and fix CPU hotplug.

    Signed-off-by: Vojtech Pavlik
    Signed-off-by: Andi Kleen

    Vojtech Pavlik
     
  • This patch adds macros for reading tsc via the RDTSCP instruction, as well
    as writing the auxilliary MSR read by RDTSCP to msr.h

    [AK: changed rdtscp definition for old binutils]

    Signed-off-by: Vojtech Pavlik
    Signed-off-by: Andi Kleen

    Vojtech Pavlik
     
  • AK: This redoes the changes I temporarily reverted.

    Intel now has support for Architectural Performance Monitoring Counters
    ( Refer to IA-32 Intel Architecture Software Developer's Manual
    http://www.intel.com/design/pentium4/manuals/253669.htm ). This
    feature is present starting from Intel Core Duo and Intel Core Solo processors.

    What this means is, the performance monitoring counters and some performance
    monitoring events are now defined in an architectural way (using cpuid).
    And there will be no need to check for family/model etc for these architectural
    events.

    Below is the patch to use this performance counters in nmi watchdog driver.
    Patch handles both i386 and x86-64 kernels.

    Signed-off-by: Venkatesh Pallipadi
    Signed-off-by: Andi Kleen

    Venkatesh Pallipadi
     
  • I've had good experiences with having this on by default on x86-64.
    It turns nasty hangs into easier to debug oopses.

    Enable the local APIC wdog by default for systems newer than 2004.

    This comes from a strange compromise: according to arjan the reason
    it was off by default was some old IBM systems that corrupted
    registered when NMI happened in SMI. Can't remember more specific,
    but >= 2004 should avoid these. It's probably overly broad
    because most older systems should be ok (and the really old systems
    won't be supported by the local apic watchdog anyways)

    Signed-off-by: Andi Kleen

    Andi Kleen
     
  • After a crash we should wait for NMI IPI event and not for external NMI or
    NMI watchdog tick.

    Signed-off-by: Vivek Goyal
    Signed-off-by: Andi Kleen
    Cc: Don Zickus
    Cc: Andi Kleen
    Signed-off-by: Andrew Morton

    Vivek Goyal
     
  • After a crash we should wait for NMI IPI event and not for external NMI or
    NMI watchdog tick.

    Signed-off-by: Vivek Goyal
    Signed-off-by: Andi Kleen
    Cc: Don Zickus
    Cc: Andi Kleen
    Signed-off-by: Andrew Morton

    Vivek Goyal
     
  • This patch makes the following needlessly global functions static:
    - nmi_int.c: profile_exceptions_notify()
    - nmi_timer_int.c: profile_timer_exceptions_notify()

    Signed-off-by: Adrian Bunk
    Signed-off-by: Andi Kleen

    Adrian Bunk
     
  • When a unknown NMI happened the panic would claim a NMI watchdog timeout.
    Also it would check the variable set by nmi_watchdog=panic and panic then.

    Fix up the panic message to be generic
    Unconditionally panic on unknown NMI when panic on unknown nmi is enabled.

    Noticed by Jan Beulich

    Cc: jbeulich@novell.com

    Signed-off-by: Andi Kleen

    Andi Kleen
     
  • Making NMI suspend/resume work with SMP. We use CPU hotplug to offline
    APs in SMP suspend/resume. Only BSP executes sysdev's .suspend/.resume
    method. APs should follow CPU hotplug code path.

    And:

    +From: Don Zickus

    Makes the start/stop paths of nmi watchdog more robust to handle the
    suspend/resume cases more gracefully.

    AK: I merged the two patches together

    Signed-off-by: Shaohua Li
    Signed-off-by: Andi Kleen
    Cc: Don Zickus
    Cc: Andi Kleen
    Signed-off-by: Andrew Morton

    Shaohua Li
     
  • Clean up some of the output messages on the nmi error paths to make more
    sense when they are displayed. This is mainly a cosmetic fix and
    shouldn't impact any normal code path.

    Signed-off-by: Don Zickus
    Signed-off-by: Andi Kleen

    Don Zickus
     
  • To quote Alan Cox:

    The default Linux behaviour on an NMI of either memory or unknown is to
    continue operation. For many environments such as scientific computing
    it is preferable that the box is taken out and the error dealt with than
    an uncorrected parity/ECC error get propogated.

    A small number of systems do generate NMI's for bizarre random reasons
    such as power management so the default is unchanged. In other respects
    the new proc/sys entry works like the existing panic controls already in
    that directory.

    This is separate to the edac support - EDAC allows supported chipsets to
    handle ECC errors well, this change allows unsupported cases to at least
    panic rather than cause problems further down the line.

    Signed-off-by: Don Zickus
    Signed-off-by: Andi Kleen

    Don Zickus
     
  • Adds a new /proc/sys/kernel/nmi_watchdog call that will enable/disable the
    nmi watchdog.

    By entering a non-zero value here, a user can enable the nmi watchdog to
    monitor the online cpus in the system. By entering a zero value here, a
    user can disable the nmi watchdog and free up a performance counter which
    could then be utilized by the oprofile subsystem, otherwise oprofile may be
    short a counter when in use.

    Signed-off-by: Don Zickus
    Signed-off-by: Andi Kleen
    Cc: Andi Kleen
    Signed-off-by: Andrew Morton

    Don Zickus
     
  • Adds a new /proc/sys/kernel/nmi call that will enable/disable the nmi
    watchdog.

    Signed-off-by: Don Zickus
    Signed-off-by: Andi Kleen

    Don Zickus
     
  • Removes the un/set_nmi_callback and reserve/release_lapic_nmi functions as
    they are no longer needed. The various subsystems are modified to register
    with the die_notifier instead.

    Also includes compile fixes by Andrew Morton.

    Signed-off-by: Don Zickus
    Signed-off-by: Andi Kleen

    Don Zickus
     
  • Needed TIF_RESTORE_SIGMASK first

    Signed-off-by: Andi Kleen

    Andi Kleen
     
  • We need TIF_RESTORE_SIGMASK in order to support ppoll() and pselect()
    system calls. This patch originally came from Andi, and was based
    heavily on David Howells' implementation of same on i386. I fixed a typo
    which was causing do_signal() to use the wrong signal mask.

    Signed-off-by: David Woodhouse
    Signed-off-by: Andi Kleen

    Andi Kleen
     
  • This patch cleans up the NMI interrupt path. Instead of being gated by if
    the 'nmi callback' is set, the interrupt handler now calls everyone who is
    registered on the die_chain and additionally checks the nmi watchdog,
    reseting it if enabled. This allows more subsystems to hook into the NMI if
    they need to (without being block by set_nmi_callback).

    Signed-off-by: Don Zickus
    Signed-off-by: Andi Kleen

    Don Zickus
     
  • This patch includes the changes to make the nmi watchdog on i386 SMP aware.
    A bunch of code was moved around to make it simpler to read. In addition,
    it is now possible to determine if a particular NMI was the result of the
    watchdog or not. This feature allows the kernel to filter out unknown NMIs
    easier.

    Signed-off-by: Don Zickus
    Signed-off-by: Andi Kleen

    Don Zickus
     
  • This patch includes the changes to make the nmi watchdog on x86_64 SMP
    aware. A bunch of code was moved around to make it simpler to read. In
    addition, it is now possible to determine if a particular NMI was the result
    of the watchdog or not. This feature allows the kernel to filter out
    unknown NMIs easier.

    Signed-off-by: Don Zickus
    Signed-off-by: Andi Kleen

    Don Zickus
     
  • Incorporates the new performance counter reservation system in oprofile.
    Also cleans up a lot of the initialization code. The code original zero'd
    out every register associated with performance counters regardless if those
    registers were used or not. This causes issues with the nmi watchdog.
    Now oprofile tries to reserve registers and gives up if it can't get them.

    Cc: levon@movementarian.org
    Cc: oprofile-list@lists.sf.net

    Signed-off-by: Don Zickus
    Signed-off-by: Andi Kleen

    Don Zickus
     
  • Adds basic infrastructure to allow subsystems to reserve performance
    counters on the x86 chips. Only UP kernels are supported in this patch to
    make reviewing easier. The SMP portion makes a lot more changes.

    Think of this as a locking mechanism where each bit represents a different
    counter. In addition, each subsystem should also reserve an appropriate
    event selection register that will correspond to the performance counter it
    will be using (this is mainly neccessary for the Pentium 4 chips as they
    break the 1:1 relationship to performance counters).

    This will help prevent subsystems like oprofile from interfering with the
    nmi watchdog.

    Signed-off-by: Don Zickus
    Signed-off-by: Andi Kleen

    Don Zickus
     
  • This makes merging easier. They are readded a few patches later.

    Signed-off-by: Andi Kleen

    Andi Kleen
     
  • There are some machines around (large xSeries or Unisys ES7000) that
    need physical IO-APIC destination mode to access all of their IO
    devices. This currently doesn't work in UP kernels as used in
    distribution installers.

    This patch allows to compile even UP kernels as GENERICARCH which
    allows to use physical or clustered APIC mode.

    Signed-off-by: Andi Kleen

    Andi Kleen
     
  • This is based on the x86-64 defconfig which works on a wide range of systems.

    Signed-off-by: Andi Kleen

    Andi Kleen
     
  • Signed-off-by: Andi Kleen

    Andi Kleen
     
  • * master.kernel.org:/pub/scm/linux/kernel/git/davem/net-2.6:
    [NetLabel]: update docs with website information
    [NetLabel]: rework the Netlink attribute handling (part 2)
    [NetLabel]: rework the Netlink attribute handling (part 1)
    [Netlink]: add nla_validate_nested()
    [NETLINK]: add nla_for_each_nested() to the interface list
    [NetLabel]: change the SELinux permissions
    [NetLabel]: make the CIPSOv4 cache spinlocks bottom half safe
    [NetLabel]: correct improper handling of non-NetLabel peer contexts
    [TCP]: make cubic the default
    [TCP]: default congestion control menu
    [ATM] he: Fix __init/__devinit conflict
    [NETFILTER]: Add dscp,DSCP headers to header-y
    [DCCP]: Introduce dccp_probe
    [DCCP]: Use constants for CCIDs
    [DCCP]: Introduce constants for CCID numbers
    [DCCP]: Allow default/fallback service code.

    Linus Torvalds
     
  • * master.kernel.org:/pub/scm/linux/kernel/git/davem/sparc-2.6:
    [SOUND] sparc/amd7930: Use __devinit and __devinitdata as needed.
    [SUNLANCE]: Mark sparc_lance_probe_one as __devinit.
    [SPARC64]: Fix section-mismatch errors in solaris emul module.

    Linus Torvalds
     
  • The v4l2 API documentation for VIDIOC_ENUMSTD says:

    To enumerate all standards applications shall begin at index
    zero, incrementing by one until the driver returns EINVAL.

    The actual code, however, tests the index this way:

    if (index= vfd->tvnormsize) {
    ret=-EINVAL;

    So any application which passes in index=0 gets EINVAL right off the bat
    - and, in fact, this is what happens to mplayer. So I think the
    following patch is called for, and maybe even appropriate for a 2.6.18.x
    stable release.

    Signed-off-by: Jonathan Corbet
    Cc: Mauro Carvalho Chehab
    Cc:
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Jonathan Corbet
     
  • Invoking load_module() before param_sysfs_init() is called crashes in
    mod_sysfs_setup(), since the kset in module_subsys is not initialized yet.

    In my case, net-pf-1 is getting modprobed as a result of hotplug trying to
    create a UNIX socket. Calls to hotplug begin after the topology_init
    initcall.

    Another patch for the same symptom (module_subsys-initialize-earlier.patch)
    moves param_sysfs_init() to the subsys initcalls, but this is still not
    early enough in the boot process in some cases. In particular,
    topology_init() causes /sbin/hotplug to run, which requests net-pf-1 (the
    UNIX socket protocol) which can be compiled as a module. Moving
    param_sysfs_init() to the postcore initcalls fixes this particular race,
    but there might well be other cases where a usermodehelper causes a module
    to load earlier still.

    The patch makes load_module() return an error rather than crashing the
    kernel if invoked before module_subsys is initialized.

    Cc: Mark Huang
    Cc: Greg KH
    Cc:
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Ed Swierk
     
  • If there is only 1 node in the system cpus should think they are apart of
    some other node.

    If cases where a real numa system boots the Flat numa option make sure the
    cpus don't claim to be apart on a non-existent node.

    Signed-off-by: Keith Mannthey
    Cc: Andy Whitcroft
    Cc: Dave Hansen
    Cc: Andi Kleen
    Cc:
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    keith mannthey
     
  • Assume that a cpu is *physically* offlined at boot time...

    Because smpboot.c::smp_boot_cpu_map() canoot find cpu's sapicid,
    numa.c::build_cpu_to_node_map() cannot build cpunode map for
    offlined cpu.

    For such cpus, cpu_to_node map should be fixed at cpu-hot-add.
    This mapping should be done before cpu onlining.

    This patch also handles cpu hotremove case.

    Signed-off-by: KAMEZAWA Hiroyuki
    Cc: "Luck, Tony"
    Cc:
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    KAMEZAWA Hiroyuki
     
  • Problem description:

    We have additional_cpus= option for allocating possible_cpus. But nid
    for possible cpus are not fixed at boot time. cpus which is offlined at
    boot or cpus which is not on SRAT is not tied to its node. This will
    cause panic at cpu onlining.

    Usually, pxm_to_nid() mapping is fixed at boot time by SRAT.

    But, unfortunately, some system (my system!) do not include
    full SRAT table for possible cpus. (Then, I use
    additiona_cpus= option.)

    For such possible cpus, pxmnid should be fixed at
    hot-add. We now have acpi_map_pxm_to_node() which is also
    used at boot. It's suitable here.

    Signed-off-by: KAMEZAWA Hiroyuki
    Cc: "Luck, Tony"
    Cc:
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    KAMEZAWA Hiroyuki
     
  • Seems like not all drivers use the framebuffer_alloc() function and won't
    have an initialized mutex. But those don't have a backlight, anyway.

    Signed-off-by: Michael Hanselmann
    Cc: Olaf Hering
    Cc: "Antonino A. Daplas"
    Cc: Daniel R Thompson
    Cc: Jon Smirl
    Cc:
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Michael Hanselmann
     
  • Stops panic associated with attempting to free a non slab-allocated
    per_cpu_pageset.

    Signed-off-by: David Rientjes
    Acked-by: Christoph Lameter
    Cc:
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    David Rientjes
     
  • With CONFIG_PHYSICAL_START set to a non default values the i386
    boot_ioremap code calculated its pte index wrong and users of boot_ioremap
    have their areas incorrectly mapped (for me SRAT table not mapped during
    early boot). This patch removes the addr < BOOT_PTE_PTRS constraint.

    [ Keith says this is applicable to 2.6.16 and 2.6.17 as well ]

    Signed-off-by: Keith Mannthey
    Cc: Vivek Goyal
    Cc: Dave Hansen
    Cc:
    Cc: Adrian Bunk
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    keith mannthey
     
  • BUG: warning at kernel/lockdep.c:1816/trace_hardirqs_on() (Not tainted)
    [] show_trace_log_lvl+0x58/0x171
    [] show_trace+0xd/0x10
    [] dump_stack+0x19/0x1b
    [] trace_hardirqs_on+0xa2/0x11e
    [] _spin_unlock_irq+0x22/0x26
    [] rtc_get_rtc_time+0x32/0x176
    [] hpet_rtc_interrupt+0x92/0x14d
    [] handle_IRQ_event+0x20/0x4d
    [] __do_IRQ+0x94/0xef
    [] do_IRQ+0x9e/0xbd
    [] common_interrupt+0x25/0x2c
    DWARF2 unwinder stuck at common_interrupt+0x25/0x2c

    Signed-off-by: Peter Zijlstra
    Acked-by: Ingo Molnar
    Cc:
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Peter Zijlstra
     
  • If the timeout of an autofs mount is set to zero then umounts are disabled.
    This works fine, however the kernel module checks the expire timeout and
    goes no further if it is zero. This is not the right thing to do at
    shutdown as the module is passed an option to expire mounts regardless of
    their timeout setting.

    This patch allows autofs to honor the force expire option.

    Signed-off-by: Ian Kent
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Ian Kent
     
  • Fixes section-mismatch errors.

    Signed-off-by: David S. Miller

    David S. Miller