1. 03 9月, 2010 1 次提交
    • D
      perf, x86: Fix accidentally ack'ing a second event on intel perf counter · 2e556b5b
      Don Zickus 提交于
      During testing of a patch to stop having the perf subsytem
      swallow nmis, it was uncovered that Nehalem boxes were randomly
      getting unknown nmis when using the perf tool.
      
      Moving the ack'ing of the PMI closer to when we get the status
      allows the hardware to properly re-set the PMU bit signaling
      another PMI was triggered during the processing of the first
      PMI.  This allows the new logic for dealing with the
      shortcomings of multiple PMIs to handle the extra NMI by
      'eat'ing it later.
      
      Now one can wonder why are we getting a second PMI when we
      disable all the PMUs in the begining of the NMI handler to
      prevent such a case, for that I do not know.  But I know the fix
      below helps deal with this quirk.
      
      Tested on multiple Nehalems where the problem was occuring.
      With the patch, the code now loops a second time to handle the
      second PMI (whereas before it was not).
      Signed-off-by: NDon Zickus <dzickus@redhat.com>
      Cc: peterz@infradead.org
      Cc: robert.richter@amd.com
      Cc: gorcunov@gmail.com
      Cc: fweisbec@gmail.com
      Cc: ying.huang@intel.com
      Cc: ming.m.lin@intel.com
      Cc: eranian@google.com
      LKML-Reference: <1283454469-1909-2-git-send-email-dzickus@redhat.com>
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      2e556b5b
  2. 02 9月, 2010 2 次提交
  3. 01 9月, 2010 2 次提交
    • D
      lockup_detector: Sync touch_*_watchdog back to old semantics · 68d3f1d8
      Don Zickus 提交于
      During my rewrite, the semantics of touch_nmi_watchdog and
      touch_softlockup_watchdog changed enough to break some drivers
      (mostly over preemptable regions).
      
      These are cases where long delays on one CPU (due to
      print_delay for example) can cause long delays on other
      CPUs - so we must 'touch' the nmi_watchdog flag of those
      other CPUs as well.
      
      This change brings those touch_*_watchdog() functions back in line
      with to how they used to work.
      Signed-off-by: NDon Zickus <dzickus@redhat.com>
      Acked-by: NCyrill Gorcunov <gorcunov@openvz.org>
      Cc: peterz@infradead.org
      Cc: fweisbec@gmail.com
      LKML-Reference: <1283310009-22168-2-git-send-email-dzickus@redhat.com>
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      68d3f1d8
    • L
      tracing: Fix a race in function profile · 3aaba20f
      Li Zefan 提交于
      While we are reading trace_stat/functionX and someone just
      disabled function_profile at that time, we can trigger this:
      
      	divide error: 0000 [#1] PREEMPT SMP
      	...
      	EIP is at function_stat_show+0x90/0x230
      	...
      
      This fix just takes the ftrace_profile_lock and checks if
      rec->counter is 0. If it's 0, we know the profile buffer
      has been reset.
      Signed-off-by: NLi Zefan <lizf@cn.fujitsu.com>
      Cc: stable@kernel.org
      LKML-Reference: <4C723644.4040708@cn.fujitsu.com>
      Signed-off-by: NSteven Rostedt <rostedt@goodmis.org>
      3aaba20f
  4. 31 8月, 2010 1 次提交
  5. 30 8月, 2010 1 次提交
    • S
      perf_events: Fix time tracking for events with pid != -1 and cpu != -1 · fa66f07a
      Stephane Eranian 提交于
      Per-thread events with a cpu filter, i.e., cpu != -1, were not
      reporting correct timings when the thread never ran on the
      monitored cpu. The time enabled was reported as a negative
      value.
      
      This patch fixes the problem by updating tstamp_stopped,
      tstamp_running in event_sched_out() for events with filters and
      which are marked as INACTIVE.
      
      The function group_sched_out() is modified to systematically
      call into event_sched_out() to avoid duplicating the timing
      adjustment code twice.
      
      With the patch, I now get:
      
      $ task_cpu -i -e unhalted_core_cycles,unhalted_core_cycles
      noploop 2 noploop for 2 seconds
      CPU0 0		   unhalted_core_cycles (ena=1,991,136,594, run=0)
      CPU0 0		   unhalted_core_cycles (ena=1,991,136,594, run=0)
      
      CPU1 0		   unhalted_core_cycles (ena=1,991,136,594, run=0)
      CPU1 0		   unhalted_core_cycles (ena=1,991,136,594, run=0)
      
      CPU2 0		   unhalted_core_cycles (ena=1,991,136,594, run=0)
      CPU2 0		   unhalted_core_cycles (ena=1,991,136,594, run=0)
      
      CPU3 4,747,990,931 unhalted_core_cycles (ena=1,991,136,594, run=1,991,136,594)
      CPU3 4,747,990,931 unhalted_core_cycles (ena=1,991,136,594, run=1,991,136,594)
      Signed-off-by: NStephane Eranian <eranian@gmail.com>
      Acked-by: NPeter Zijlstra <a.p.zijlstra@chello.nl>
      Cc: paulus@samba.org
      Cc: davem@davemloft.net
      Cc: fweisbec@gmail.com
      Cc: perfmon2-devel@lists.sf.net
      Cc: eranian@google.com
      LKML-Reference: <4c76802d.aae9d80a.115d.70fe@mx.google.com>
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      fa66f07a
  6. 27 8月, 2010 1 次提交
    • F
      perf: Initialize callchains roots's childen hits · 5225c458
      Frederic Weisbecker 提交于
      Each histogram entry has a callchain root that stores the
      callchain samples. However we forgot to initialize the
      tracking of children hits of these roots, which then got
      random values on their creation.
      
      The root children hits is multiplied by the minimum percentage
      of hits provided by the user, and the result becomes the minimum
      hits expected from children branches. If the random value due
      to the uninitialization is big enough, then this minimum number
      of hits can be huge and eventually filter every children branches.
      
      The end result was invisible callchains. All we need to
      fix this is to initialize the children hits of the root.
      Reported-by: NChristoph Hellwig <hch@infradead.org>
      Signed-off-by: NFrederic Weisbecker <fweisbec@gmail.com>
      Cc: Ingo Molnar <mingo@elte.hu>
      Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
      Cc: Arnaldo Carvalho de Melo <acme@redhat.com>
      Cc: Paul Mackerras <paulus@samba.org>
      Cc: 2.6.32.x-2.6.35.y <stable@kernel.org>
      5225c458
  7. 25 8月, 2010 12 次提交
  8. 24 8月, 2010 20 次提交
    • M
      [S390] fix tlb flushing vs. concurrent /proc accesses · 050eef36
      Martin Schwidefsky 提交于
      The tlb flushing code uses the mm_users field of the mm_struct to
      decide if each page table entry needs to be flushed individually with
      IPTE or if a global flush for the mm_struct is sufficient after all page
      table updates have been done. The comment for mm_users says "How many
      users with user space?" but the /proc code increases mm_users after it
      found the process structure by pid without creating a new user process.
      Which makes mm_users useless for the decision between the two tlb
      flusing methods. The current code can be confused to not flush tlb
      entries by a concurrent access to /proc files if e.g. a fork is in
      progres. The solution for this problem is to make the tlb flushing
      logic independent from the mm_users field.
      Signed-off-by: NMartin Schwidefsky <schwidefsky@de.ibm.com>
      050eef36
    • L
      Merge git://git.kernel.org/pub/scm/linux/kernel/git/benh/powerpc · bd45fe53
      Linus Torvalds 提交于
      * git://git.kernel.org/pub/scm/linux/kernel/git/benh/powerpc: (25 commits)
        powerpc: Fix config dependency problem with MPIC_U3_HT_IRQS
        via-pmu: Add compat_pmu_ioctl
        powerpc: Wire up fanotify_init, fanotify_mark, prlimit64 syscalls
        powerpc/pci: Fix checking for child bridges in PCI code.
        powerpc: Fix typo in uImage target
        powerpc: Initialise paca->kstack before early_setup_secondary
        powerpc: Fix bogus it_blocksize in VIO iommu code
        powerpc: Inline ppc64_runlatch_off
        powerpc: Correct smt_enabled=X boot option for > 2 threads per core
        powerpc: Silence xics_migrate_irqs_away() during cpu offline
        powerpc: Silence __cpu_up() under normal operation
        powerpc: Re-enable preemption before cpu_die()
        powerpc/pci: Drop unnecessary null test
        powerpc/powermac: Drop unnecessary null test
        powerpc/powermac: Drop unnecessary of_node_put
        powerpc/kdump: Stop all other CPUs before running crash handlers
        powerpc/mm: Fix vsid_scrample typo
        powerpc: Use is_32bit_task() helper to test 32 bit binary
        powerpc: Export memstart_addr and kernstart_addr on ppc64
        powerpc: Make rwsem use "long" type
        ...
      bd45fe53
    • S
      [S390] s390: fix build error (sys_execve) · 7af048dc
      Sebastian Ott 提交于
      fix this build error:
      arch/s390/kernel/process.c:272: error: conflicting types for 'sys_execve'
      arch/s390/kernel/entry.h:45: error: previous declaration of 'sys_execve' was here
      make[1]: *** [arch/s390/kernel/process.o] Error 1
      make: *** [arch/s390/kernel] Error 2
      
      introduced by d7627467Signed-off-by: NSebastian Ott <sebott@linux.vnet.ibm.com>
      Signed-off-by: NMartin Schwidefsky <schwidefsky@de.ibm.com>
      7af048dc
    • L
      Merge git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging-2.6 · e1f1f073
      Linus Torvalds 提交于
      * git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging-2.6:
        Staging: sep: remove driver
        Staging: batman-adv: Don't write in not allocated packet_buff
        Staging: batman-adv: Don't use net_dev after dev_put
        Staging: batman-adv: Create batman_if only on register event
        Staging: batman-adv: fix own mac address detection
        Staging: batman-adv: always reply batman icmp packets with primary mac
        Staging: batman-adv: fix batman icmp originating from secondary interface
        Staging: batman-adv: unify orig_hash_lock spinlock handling to avoid deadlocks
        Staging: batman-adv: Fix merge of linus tree
        Staging: spectra: removes unused functions
        Staging: spectra: initializa lblk variable
        Staging: spectra: removes unused variable
        Staging: spectra: remove duplicate GLOB_VERSION definition
        Staging: spectra: don't use locked_ioctl, fix build
        Staging: use new REQ_FLUSH flag, fix build breakage
        Staging: spectra: removes q->prepare_flush_fn, fix build breakage
      e1f1f073
    • L
      Merge git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/tty-2.6 · 472e449c
      Linus Torvalds 提交于
      * git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/tty-2.6:
        68328serial: check return value of copy_*_user() instead of access_ok()
        synclink: add mutex_unlock() on error path
        rocket: add a mutex_unlock()
        ip2: return -EFAULT on copy_to_user errors
        ip2: remove unneeded NULL check
        serial: print early console device address in hex
      472e449c
    • L
      Merge git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/driver-core-2.6 · 6d87f207
      Linus Torvalds 提交于
      * git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/driver-core-2.6:
        kobject_uevent: fix typo in comments
        firmware_class: fix typo in error path
        kobject: Break the kobject namespace defs into their own header
      6d87f207
    • L
      Merge git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb-2.6 · d20de763
      Linus Torvalds 提交于
      * git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb-2.6: (29 commits)
        ARM: imx: fix build failure concerning otg/ulpi
        USB: ftdi_sio: add product ID for Lenz LI-USB
        USB: adutux: fix misuse of return value of copy_to_user()
        USB: iowarrior: fix misuse of return value of copy_to_user()
        USB: xHCI: update ring dequeue pointer when process missed tds
        USB: xhci: Remove buggy assignment in next_trb()
        USB: ftdi_sio: Add ID for Ionics PlugComputer
        USB: serial: io_ti.c: don't return 0 if writing the download record failed
        USB: otg: twl4030: fix wrong assumption of starting state
        USB: gadget: Return -ENOMEM on memory allocation failure
        USB: gadget: fix composite kernel-doc warnings
        USB: ssu100: set tty_flags in ssu100_process_packet
        USB: ssu100: add disconnect function for ssu100
        USB: serial: export symbol usb_serial_generic_disconnect
        USB: ssu100: rework logic for TIOCMIWAIT
        USB: ssu100: add register parameter to ssu100_setregister
        USB: ssu100: remove duplicate #defines in ssu100
        USB: ssu100: refine process_packet in ssu100
        USB: ssu100: add locking for port private data in ssu100
        USB: r8a66597-udc: return -ENOMEM if kzalloc() fails
        ...
      d20de763
    • D
      sparc64: Get rid of indirect p1275 PROM call buffer. · 25edd694
      David S. Miller 提交于
      This is based upon a report by Meelis Roos showing that it's possible
      that we'll try to fetch a property that is 32K in size with some
      devices.  With the current fixed 3K buffer we use for moving data in
      and out of the firmware during PROM calls, that simply won't work.
      
      In fact, it will scramble random kernel data during bootup.
      
      The reasoning behind the temporary buffer is entirely historical.  It
      used to be the case that we had problems referencing dynamic kernel
      memory (including the stack) early in the boot process before we
      explicitly told the firwmare to switch us over to the kernel trap
      table.
      
      So what we did was always give the firmware buffers that were locked
      into the main kernel image.
      
      But we no longer have problems like that, so get rid of all of this
      indirect bounce buffering.
      
      Besides fixing Meelis's bug, this also makes the kernel data about 3K
      smaller.
      
      It was also discovered during these conversions that the
      implementation of prom_retain() was completely wrong, so that was
      fixed here as well.  Currently that interface is not in use.
      Reported-by: NMeelis Roos <mroos@linux.ee>
      Tested-by: NMeelis Roos <mroos@linux.ee>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      25edd694
    • A
      powerpc: Fix config dependency problem with MPIC_U3_HT_IRQS · 314b389b
      Andreas Schwab 提交于
      MPIC_U3_HT_IRQS is selected both by PPC_PMAC64 and PPC_MAPLE, but depends
      on PPC_MAPLE, so a PPC_PMAC64-only config gets this warning:
      
      warning: (PPC_PMAC64 && PPC_PMAC && POWER4 || PPC_MAPLE && PPC64 && PPC_BOOK3S) selects MPIC_U3_HT_IRQS which has unmet direct dependencies (PPC_MAPLE)
      
      Fix that by removing the dependency on PPC_MAPLE.
      Signed-off-by: NAndreas Schwab <schwab@linux-m68k.org>
      Signed-off-by: NBenjamin Herrenschmidt <benh@kernel.crashing.org>
      314b389b
    • A
      via-pmu: Add compat_pmu_ioctl · 4cc4587f
      Andreas Schwab 提交于
      The ioctls are actually compatible, but due to historical mistake the
      numbers differ between 32bit and 64bit.
      Signed-off-by: NAndreas Schwab <schwab@linux-m68k.org>
      Acked-by: NArnd Bergmann <arnd@arndb.de>
      Signed-off-by: NBenjamin Herrenschmidt <benh@kernel.crashing.org>
      4cc4587f
    • A
    • G
      powerpc/pci: Fix checking for child bridges in PCI code. · 76ec01db
      Grant Likely 提交于
      pci_device_to_OF_node() can return null, and list_for_each_entry will
      never enter the loop when dev is NULL, so it looks like this test is
      a typo.
      Reported-by: NJulia Lawall <julia@diku.dk>
      Signed-off-by: NGrant Likely <grant.likely@secretlab.ca>
      Signed-off-by: NBenjamin Herrenschmidt <benh@kernel.crashing.org>
      76ec01db
    • A
      powerpc: Fix typo in uImage target · c686ecf5
      Anatolij Gustschin 提交于
      Commit e32e78c5
      (powerpc: fix build with make 3.82) introduced a
      typo in uImage target and broke building uImage:
      
      make: *** No rule to make target `uImage'.  Stop.
      Signed-off-by: NAnatolij Gustschin <agust@denx.de>
      Cc: stable <stable@kernel.org>
      Signed-off-by: NBenjamin Herrenschmidt <benh@kernel.crashing.org>
      c686ecf5
    • M
      powerpc: Initialise paca->kstack before early_setup_secondary · f761622e
      Matt Evans 提交于
      As early setup calls down to slb_initialize(), we must have kstack
      initialised before checking "should we add a bolted SLB entry for our kstack?"
      
      Failing to do so means stack access requires an SLB miss exception to refill
      an entry dynamically, if the stack isn't accessible via SLB(0) (kernel text
      & static data).  It's not always allowable to take such a miss, and
      intermittent crashes will result.
      
      Primary CPUs don't have this issue; an SLB entry is not bolted for their
      stack anyway (as that lives within SLB(0)).  This patch therefore only
      affects the init of secondaries.
      Signed-off-by: NMatt Evans <matt@ozlabs.org>
      Cc: stable <stable@kernel.org>
      Signed-off-by: NBenjamin Herrenschmidt <benh@kernel.crashing.org>
      f761622e
    • A
      powerpc: Fix bogus it_blocksize in VIO iommu code · 7aa241fd
      Anton Blanchard 提交于
      When looking at some issues with the virtual ethernet driver I noticed
      that TCE allocation was following a very strange pattern:
      
      address 00e9000 length 2048
      address 0409000 length 2048 <-----
      address 0429000 length 2048
      address 0449000 length 2048
      address 0469000 length 2048
      address 0489000 length 2048
      address 04a9000 length 2048
      address 04c9000 length 2048
      address 04e9000 length 2048
      address 4009000 length 2048 <-----
      address 4029000 length 2048
      
      Huge unexplained gaps in what should be an empty TCE table. It turns out
      it_blocksize, the amount we want to align the next allocation to, was
      c0000000fe903b20. Completely bogus.
      
      Initialise it to something reasonable in the VIO IOMMU code, and use kzalloc
      everywhere to protect against this when we next add a non compulsary
      field to iommu code and forget to initialise it.
      Signed-off-by: NAnton Blanchard <anton@samba.org>
      Signed-off-by: NBenjamin Herrenschmidt <benh@kernel.crashing.org>
      7aa241fd
    • A
      powerpc: Inline ppc64_runlatch_off · 4138d653
      Anton Blanchard 提交于
      I'm sick of seeing ppc64_runlatch_off in our profiles, so inline it
      into the callers. To avoid a mess of circular includes I didn't add
      it as an inline function.
      Signed-off-by: NAnton Blanchard <anton@samba.org>
      Acked-by: NOlof Johansson <olof@lixom.net>
      Signed-off-by: NBenjamin Herrenschmidt <benh@kernel.crashing.org>
      4138d653
    • N
      powerpc: Correct smt_enabled=X boot option for > 2 threads per core · 954e6da5
      Nathan Fontenot 提交于
      The 'smt_enabled=X' boot option does not handle values of X > 2.
      For Power 7 processors with smt modes of 0,1,2,3, and 4 this does
      not work.  This patch allows the smt_enabled option to be set to
      any value limited to a max equal to the number of threads per
      core.
      Signed-off-by: NNathan Fontenot <nfont@austin.ibm.com>
      Signed-off-by: NBenjamin Herrenschmidt <benh@kernel.crashing.org>
      954e6da5
    • S
      powerpc: Silence xics_migrate_irqs_away() during cpu offline · 1afb56cf
      Signed-off-by: Darren Hart 提交于
      All IRQs are migrated away from a CPU that is being offlined so the
      following messages suggest a problem when the system is behaving as
      designed:
      
      IRQ 262 affinity broken off cpu 1
      IRQ 17 affinity broken off cpu 0
      IRQ 18 affinity broken off cpu 0
      IRQ 19 affinity broken off cpu 0
      IRQ 256 affinity broken off cpu 0
      IRQ 261 affinity broken off cpu 0
      IRQ 262 affinity broken off cpu 0
      
      Don't print these messages when the CPU is not online.
      Signed-off-by: NDarren Hart <dvhltc@us.ibm.com>
      Acked-by: NWill Schmidt <will_schmidt@vnet.ibm.com>
      Cc: Thomas Gleixner <tglx@linutronix.de>
      Cc: Nathan Fontenot <nfont@austin.ibm.com>
      Cc: Robert Jennings <rcj@linux.vnet.ibm.com>
      Cc: Brian King <brking@linux.vnet.ibm.com>
      Signed-off-by: NBenjamin Herrenschmidt <benh@kernel.crashing.org>
      1afb56cf
    • S
      powerpc: Silence __cpu_up() under normal operation · 6685a477
      Signed-off-by: Darren Hart 提交于
      During CPU offline/online tests __cpu_up would flood the logs with
      the following message:
      
      Processor 0 found.
      
      This provides no useful information to the user as there is no context
      provided, and since the operation was a success (to this point) it is expected
      that the CPU will come back online, providing all the feedback necessary.
      
      Change the "Processor found" message to DBG() similar to other such messages in
      the same function. Also, add an appropriate log level for the "Processor is
      stuck" message.
      Signed-off-by: NDarren Hart <dvhltc@us.ibm.com>
      Acked-by: NWill Schmidt <will_schmidt@vnet.ibm.com>
      Cc: Thomas Gleixner <tglx@linutronix.de>
      Cc: Nathan Fontenot <nfont@austin.ibm.com>
      Cc: Robert Jennings <rcj@linux.vnet.ibm.com>
      Cc: Brian King <brking@linux.vnet.ibm.com>
      Signed-off-by: NBenjamin Herrenschmidt <benh@kernel.crashing.org>
      6685a477
    • S
      powerpc: Re-enable preemption before cpu_die() · a7c2bb82
      Signed-off-by: Darren Hart 提交于
      start_secondary() is called shortly after _start and also via
      
      cpu_idle()->cpu_die()->pseries_mach_cpu_die()
      
      start_secondary() expects a preempt_count() of 0. pseries_mach_cpu_die() is
      called via the cpu_idle() routine with preemption disabled, resulting in the
      following repeating message during rapid cpu offline/online tests
      with CONFIG_PREEMPT=y:
      
      BUG: scheduling while atomic: swapper/0/0x00000002
      Modules linked in: autofs4 binfmt_misc dm_mirror dm_region_hash dm_log [last unloaded: scsi_wait_scan]
      Call Trace:
      [c00000010e7079c0] [c0000000000133ec] .show_stack+0xd8/0x218 (unreliable)
      [c00000010e707aa0] [c0000000006a47f0] .dump_stack+0x28/0x3c
      [c00000010e707b20] [c00000000006e7a4] .__schedule_bug+0x7c/0x9c
      [c00000010e707bb0] [c000000000699d9c] .schedule+0x104/0x800
      [c00000010e707cd0] [c000000000015b24] .cpu_idle+0x1c4/0x1d8
      [c00000010e707d70] [c0000000006aa1b4] .start_secondary+0x398/0x3d4
      [c00000010e707e30] [c000000000008278] .start_secondary_resume+0x10/0x14
      
      Move the cpu_die() call inside the existing preemption enabled block of
      cpu_idle(). This is safe as the idle task is affined to a single CPU so the
      debug_smp_processor_id() tests (from cpu_should_die()) won't trigger as we are
      in a "migration disabled" region.
      Signed-off-by: NDarren Hart <dvhltc@us.ibm.com>
      Acked-by: NWill Schmidt <will_schmidt@vnet.ibm.com>
      Cc: Thomas Gleixner <tglx@linutronix.de>
      Cc: Nathan Fontenot <nfont@austin.ibm.com>
      Cc: Robert Jennings <rcj@linux.vnet.ibm.com>
      Cc: Brian King <brking@linux.vnet.ibm.com>
      Signed-off-by: NBenjamin Herrenschmidt <benh@kernel.crashing.org>
      a7c2bb82