1. 18 5月, 2009 2 次提交
    • P
      perf_counter: powerpc: initialize cpuhw pointer before use · c0daaf3f
      Paul Mackerras 提交于
      Commit 9e35ad38 ("perf_counter: Rework the perf counter
      disable/enable") added code to the powerpc hw_perf_enable (renamed
      from hw_perf_restore) to test cpuhw->disabled and return immediately
      if it is not set (i.e. if the PMU is already enabled).
      
      Unfortunately the test got added before cpuhw was initialized,
      resulting in an oops the first time hw_perf_enable got called.
      This fixes it by moving the initialization of cpuhw to before
      cpuhw->disabled is tested.
      
      [ Impact: fix oops-causing bug on powerpc ]
      Signed-off-by: NPaul Mackerras <paulus@samba.org>
      Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
      Cc: Corey Ashford <cjashfor@linux.vnet.ibm.com>
      LKML-Reference: <18960.56772.869734.304631@drongo.ozlabs.ibm.com>
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      c0daaf3f
    • I
      Merge commit 'v2.6.30-rc6' into perfcounters/core · dc3f81b1
      Ingo Molnar 提交于
      Merge reason: this branch was on an -rc4 base, merge it up to -rc6
                    to get the latest upstream fixes.
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      dc3f81b1
  2. 17 5月, 2009 4 次提交
    • I
      perf_counter, x86: fix zero irq_period counters · d2517a49
      Ingo Molnar 提交于
      The quirk to irq_period unearthed an unrobustness we had in the
      hw_counter initialization sequence: we left irq_period at 0, which
      was then quirked up to 2 ... which then generated a _lot_ of
      interrupts during 'perf stat' runs, slowed them down and skewed
      the counter results in general.
      
      Initialize irq_period to the maximum instead.
      
      [ Impact: fix perf stat results ]
      
      Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
      Cc: Srivatsa Vaddagiri <vatsa@in.ibm.com>
      Cc: Paul Mackerras <paulus@samba.org>
      Cc: Corey Ashford <cjashfor@linux.vnet.ibm.com>
      Cc: Arnaldo Carvalho de Melo <acme@redhat.com>
      Cc: Marcelo Tosatti <mtosatti@redhat.com>
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      d2517a49
    • I
      perf_counter: fix threaded task exit · 0203026b
      Ingo Molnar 提交于
      Flushing counters in __exit_signal() with irqs disabled is not
      a good idea as perf_counter_exit_task() acquires mutexes. So
      flush it before acquiring the tasklist lock.
      
      (Note, we still need a fix for when the PID has been unhashed.)
      
      [ Impact: fix crash with inherited counters ]
      
      Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
      Cc: Srivatsa Vaddagiri <vatsa@in.ibm.com>
      Cc: Paul Mackerras <paulus@samba.org>
      Cc: Corey Ashford <cjashfor@linux.vnet.ibm.com>
      Cc: Arnaldo Carvalho de Melo <acme@redhat.com>
      Cc: Marcelo Tosatti <mtosatti@redhat.com>
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      0203026b
    • P
      perf_counter: Fix counter inheritance · 856d56b9
      Peter Zijlstra 提交于
      Srivatsa Vaddagiri reported that a Java workload triggers this
      warning in kernel/exit.c:
      
         WARN_ON_ONCE(!list_empty(&tsk->perf_counter_ctx.counter_list));
      
      Add the inherited counter propagation on self-detach, this could
      cause counter leaks and incomplete stats in threaded code like
      the below:
      
        #include <pthread.h>
        #include <unistd.h>
      
        void *thread(void *arg)
        {
                sleep(5);
                return NULL;
        }
      
        void main(void)
        {
                pthread_t thr;
                pthread_create(&thr, NULL, thread, NULL);
        }
      Reported-by: NSrivatsa Vaddagiri <vatsa@in.ibm.com>
      Signed-off-by: NPeter Zijlstra <a.p.zijlstra@chello.nl>
      Cc: Paul Mackerras <paulus@samba.org>
      Cc: Corey Ashford <cjashfor@linux.vnet.ibm.com>
      Cc: Arnaldo Carvalho de Melo <acme@redhat.com>
      Cc: Marcelo Tosatti <mtosatti@redhat.com>
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      856d56b9
    • P
      perf_counter: Fix inheritance cleanup code · 8bc20959
      Peter Zijlstra 提交于
      Clean up code that open-coded the list_{add,del}_counter() code in
      __perf_counter_exit_task() which consequently diverged. This could
      lead to software counter crashes.
      
      Also, fold the ctx->nr_counter inc/dec into those functions and clean
      up some of the related code.
      
      [ Impact: fix potential sw counter crash, cleanup ]
      Signed-off-by: NPeter Zijlstra <a.p.zijlstra@chello.nl>
      Cc: Srivatsa Vaddagiri <vatsa@in.ibm.com>
      Cc: Paul Mackerras <paulus@samba.org>
      Cc: Corey Ashford <cjashfor@linux.vnet.ibm.com>
      Cc: Arnaldo Carvalho de Melo <acme@redhat.com>
      Cc: Marcelo Tosatti <mtosatti@redhat.com>
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      8bc20959
  3. 16 5月, 2009 12 次提交
  4. 15 5月, 2009 22 次提交
    • L
      Merge branch 'for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tytso/ext4 · 5d41343a
      Linus Torvalds 提交于
      * 'for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tytso/ext4:
        ext4: Fix race in ext4_inode_info.i_cached_extent
        ext4: Clear the unwritten buffer_head flag after the extent is initialized
        ext4: Use a fake block number for delayed new buffer_head
        ext4: Fix sub-block zeroing for writes into preallocated extents
      5d41343a
    • L
      Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound-2.6 · c244450d
      Linus Torvalds 提交于
      * 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound-2.6:
        ASoC: DaVinci EVM board support buildfixes
        ASoC: DaVinci I2S updates
        ASoC: davinci-pcm buildfixes
        ALSA: pcsp: fix printk format warning
        ALSA: riptide: postfix increment and off by one
        pxa2xx-ac97: fix reset gpio mode setting
        ASoC: soc-core: fix crash when removing not instantiated card
      c244450d
    • L
      Merge branch 'for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jwessel/linux-2.6-kgdb · ade385e4
      Linus Torvalds 提交于
      * 'for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jwessel/linux-2.6-kgdb:
        kgdb: gdb documentation fix
        kgdb,i386: use address that SP register points to in the exception frame
        sysrq, intel_fb: fix sysrq g collision
      ade385e4
    • L
      Merge branch 'for-linus' of git://git.kernel.dk/linux-2.6-block · c6538499
      Linus Torvalds 提交于
      * 'for-linus' of git://git.kernel.dk/linux-2.6-block:
        Revert "mm: add /proc controls for pdflush threads"
        viocd: needs to depend on BLOCK
        block: fix the bio_vec array index out-of-bounds test
      c6538499
    • L
      Merge branch 'merge' of git://git.kernel.org/pub/scm/linux/kernel/git/benh/powerpc · 662f11cf
      Linus Torvalds 提交于
      * 'merge' of git://git.kernel.org/pub/scm/linux/kernel/git/benh/powerpc:
        powerpc: Fix PCI ROM access
        powerpc/pseries: Really fix the oprofile CPU type on pseries
        serial/nwpserial: Fix wrong register read address and add interrupt acknowledge.
        powerpc/cell: Make ptcal more reliable
        powerpc: Allow mem=x cmdline to work with 4G+
        powerpc/mpic: Fix incorrect allocation of interrupt rev-map
        powerpc: Fix oprofile sampling of marked events on POWER7
        powerpc/iseries: Fix pci breakage due to bad dma_data initialization
        powerpc: Fix mktree build error on Mac OS X host
        powerpc/virtex: Fix duplicate level irq events.
        powerpc/virtex: Add uImage to the default images list
        powerpc/boot: add simpleImage.* to clean-files list
        powerpc/8xx: Update defconfigs
        powerpc/embedded6xx: Update defconfigs
        powerpc/86xx: Update defconfigs
        powerpc/85xx: Update defconfigs
        powerpc/83xx: Update defconfigs
        powerpc/fsl_soc: Remove mpc83xx_wdt_init, again
      662f11cf
    • S
      devpts: correctly set default options · 1f71ebed
      Sukadev Bhattiprolu 提交于
      devpts_get_sb() calls memset(0) to clear mount options and calls
      parse_mount_options() if user specified any mount options.
      
      The memset(0) is bogus since the 'mode' and 'ptmxmode' options are
      non-zero by default.  parse_mount_options() restores options to default
      anyway and can properly deal with NULL mount options.
      
      So in devpts_get_sb() remove memset(0) and call parse_mount_options() even
      for NULL mount options.
      
      Bug reported by Eric Paris: http://lkml.org/lkml/2009/5/7/448.
      Signed-off-by: NSukadev Bhattiprolu <sukadev@us.ibm.com>
      Tested-by: NMarc Dionne <marc.c.dionne@gmail.com>
      Reported-by: NEric Paris <eparis@redhat.com>
      Cc: Christoph Hellwig <hch@lst.de>
      Cc: Alan Cox <alan@lxorguk.ukuu.org.uk>
      Acked-by: NSerge Hallyn <serue@us.ibm.com>
      Cc: Al Viro <viro@zeniv.linux.org.uk>
      Cc: "Rafael J. Wysocki" <rjw@sisk.pl>
      Reviewed-by: N"H. Peter Anvin" <hpa@zytor.com>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      1f71ebed
    • P
      perf_counter: powerpc: supply more precise information on counter overflow events · 0bbd0d4b
      Paul Mackerras 提交于
      This uses values from the MMCRA, SIAR and SDAR registers on
      powerpc to supply more precise information for overflow events,
      including a data address when PERF_RECORD_ADDR is specified.
      
      Since POWER6 uses different bit positions in MMCRA from earlier
      processors, this converts the struct power_pmu limited_pmc5_6
      field, which only had 0/1 values, into a flags field and
      defines bit values for its previous use (PPMU_LIMITED_PMC5_6)
      and a new flag (PPMU_ALT_SIPR) to indicate that the processor
      uses the POWER6 bit positions rather than the earlier
      positions.  It also adds definitions in reg.h for the new and
      old positions of the bit that indicates that the SIAR and SDAR
      values come from the same instruction.
      
      For the data address, the SDAR value is supplied if we are not
      doing instruction sampling.  In that case there is no guarantee
      that the address given in the PERF_RECORD_ADDR subrecord will
      correspond to the instruction whose address is given in the
      PERF_RECORD_IP subrecord.
      
      If instruction sampling is enabled (e.g. because this counter
      is counting a marked instruction event), then we only supply
      the SDAR value for the PERF_RECORD_ADDR subrecord if it
      corresponds to the instruction whose address is in the
      PERF_RECORD_IP subrecord.  Otherwise we supply 0.
      
      [ Impact: support more PMU hardware features on PowerPC ]
      Signed-off-by: NPaul Mackerras <paulus@samba.org>
      Acked-by: NPeter Zijlstra <a.p.zijlstra@chello.nl>
      Cc: Corey Ashford <cjashfor@linux.vnet.ibm.com>
      Cc: Arnaldo Carvalho de Melo <acme@redhat.com>
      LKML-Reference: <18955.37028.48861.555309@drongo.ozlabs.ibm.com>
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      0bbd0d4b
    • P
      perf_counter: allow arch to supply event misc flags and instruction pointer · 9d23a90a
      Paul Mackerras 提交于
      At present the values we put in overflow events for the misc
      flags indicating processor mode and the instruction pointer are
      obtained using the standard user_mode() and
      instruction_pointer() functions. Those functions tell you where
      the performance monitor interrupt was taken, which might not be
      exactly where the counter overflow occurred, for example
      because interrupts were disabled at the point where the
      overflow occurred, or because the processor had many
      instructions in flight and chose to complete some more
      instructions beyond the one that caused the counter overflow.
      
      Some architectures (e.g. powerpc) can supply more precise
      information about where the counter overflow occurred and the
      processor mode at that point.  This introduces new functions,
      perf_misc_flags() and perf_instruction_pointer(), which arch
      code can override to provide more precise information if
      available.  They have default implementations which are
      identical to the existing code.
      
      This also adds a new misc flag value,
      PERF_EVENT_MISC_HYPERVISOR, for the case where a counter
      overflow occurred in the hypervisor.  We encode the processor
      mode in the 2 bits previously used to indicate user or kernel
      mode; the values for user and kernel mode are unchanged and
      hypervisor mode is indicated by both bits being set.
      
      [ Impact: generalize perfcounter core facilities ]
      Signed-off-by: NPaul Mackerras <paulus@samba.org>
      Acked-by: NPeter Zijlstra <a.p.zijlstra@chello.nl>
      Cc: Corey Ashford <cjashfor@linux.vnet.ibm.com>
      Cc: Arnaldo Carvalho de Melo <acme@redhat.com>
      LKML-Reference: <18956.1272.818511.561835@cargo.ozlabs.ibm.com>
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      9d23a90a
    • P
      perf_counter: powerpc: use u64 for event codes internally · ef923214
      Paul Mackerras 提交于
      Although the perf_counter API allows 63-bit raw event codes,
      internally in the powerpc back-end we had been using 32-bit
      event codes.  This expands them to 64 bits so that we can add
      bits for specifying threshold start/stop events and instruction
      sampling modes later.
      
      This also corrects the return value of can_go_on_limited_pmc;
      we were returning an event code rather than just a 0/1 value in
      some circumstances. That didn't particularly matter while event
      codes were 32-bit, but now that event codes are 64-bit it
      might, so this fixes it.
      
      [ Impact: extend PowerPC perfcounter interfaces from u32 to u64 ]
      Signed-off-by: NPaul Mackerras <paulus@samba.org>
      Acked-by: NPeter Zijlstra <a.p.zijlstra@chello.nl>
      Cc: Corey Ashford <cjashfor@linux.vnet.ibm.com>
      Cc: Arnaldo Carvalho de Melo <acme@redhat.com>
      LKML-Reference: <18955.36874.472452.353104@drongo.ozlabs.ibm.com>
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      ef923214
    • P
      perf_counter: frequency based adaptive irq_period, 32-bit fix · 2e569d36
      Peter Zijlstra 提交于
      fix:
      
        kernel/built-in.o: In function `perf_counter_alloc':
        perf_counter.c:(.text+0x7ddc7): undefined reference to `__udivdi3'
      
      [ Impact: build fix on 32-bit systems ]
      Reported-by: NIngo Molnar <mingo@elte.hu>
      Signed-off-by: NPeter Zijlstra <a.p.zijlstra@chello.nl>
      Cc: Paul Mackerras <paulus@samba.org>
      Cc: Corey Ashford <cjashfor@linux.vnet.ibm.com>
      Cc: Arnaldo Carvalho de Melo <acme@redhat.com>
      Cc: Thomas Gleixner <tglx@linutronix.de>
      LKML-Reference: <1242394667.6642.1887.camel@laptop>
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      2e569d36
    • T
      Merge branch 'fix/asoc' into for-linus · 60befb97
      Takashi Iwai 提交于
      * fix/asoc:
        ASoC: DaVinci EVM board support buildfixes
        ASoC: DaVinci I2S updates
        ASoC: davinci-pcm buildfixes
        pxa2xx-ac97: fix reset gpio mode setting
        ASoC: soc-core: fix crash when removing not instantiated card
      60befb97
    • T
      Merge branch 'fix/misc' into for-linus · a3d2b755
      Takashi Iwai 提交于
      * fix/misc:
        ALSA: pcsp: fix printk format warning
        ALSA: riptide: postfix increment and off by one
      a3d2b755
    • P
      perf top: update to use the new freq interface · f5456a6b
      Peter Zijlstra 提交于
      Provide perf top -F as alternative to -c.
      
      [ Impact: new 'perf top' feature ]
      Signed-off-by: NPeter Zijlstra <a.p.zijlstra@chello.nl>
      Cc: Paul Mackerras <paulus@samba.org>
      Cc: Corey Ashford <cjashfor@linux.vnet.ibm.com>
      Cc: Arnaldo Carvalho de Melo <acme@redhat.com>
      LKML-Reference: <20090515132018.707922166@chello.nl>
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      f5456a6b
    • P
      perf_counter: frequency based adaptive irq_period · 60db5e09
      Peter Zijlstra 提交于
      Instead of specifying the irq_period for a counter, provide a target interrupt
      frequency and dynamically adapt the irq_period to match this frequency.
      
      [ Impact: new perf-counter attribute/feature ]
      Signed-off-by: NPeter Zijlstra <a.p.zijlstra@chello.nl>
      Cc: Paul Mackerras <paulus@samba.org>
      Cc: Corey Ashford <cjashfor@linux.vnet.ibm.com>
      Cc: Arnaldo Carvalho de Melo <acme@redhat.com>
      LKML-Reference: <20090515132018.646195868@chello.nl>
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      60db5e09
    • P
      perf_counter: per user mlock gift · 789f90fc
      Peter Zijlstra 提交于
      Instead of a per-process mlock gift for perf-counters, use a
      per-user gift so that there is less of a DoS potential.
      
      [ Impact: allow less worst-case unprivileged memory consumption ]
      Signed-off-by: NPeter Zijlstra <a.p.zijlstra@chello.nl>
      Cc: Paul Mackerras <paulus@samba.org>
      Cc: Corey Ashford <cjashfor@linux.vnet.ibm.com>
      Cc: Arnaldo Carvalho de Melo <acme@redhat.com>
      LKML-Reference: <20090515132018.496182835@chello.nl>
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      789f90fc
    • P
      perf_counter: remove perf_disable/enable exports · 548e1ddf
      Peter Zijlstra 提交于
      Now that ACPI idle doesn't use it anymore, remove the exports.
      
      [ Impact: remove dead code/data ]
      Signed-off-by: NPeter Zijlstra <a.p.zijlstra@chello.nl>
      Cc: Paul Mackerras <paulus@samba.org>
      Cc: Corey Ashford <cjashfor@linux.vnet.ibm.com>
      Cc: Arnaldo Carvalho de Melo <acme@redhat.com>
      LKML-Reference: <20090515132018.429826617@chello.nl>
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      548e1ddf
    • T
      ext4: Fix race in ext4_inode_info.i_cached_extent · 2ec0ae3a
      Theodore Ts'o 提交于
      If two CPU's simultaneously call ext4_ext_get_blocks() at the same
      time, there is nothing protecting the i_cached_extent structure from
      being used and updated at the same time.  This could potentially cause
      the wrong location on disk to be read or written to, including
      potentially causing the corruption of the block group descriptors
      and/or inode table.
      
      This bug has been in the ext4 code since almost the very beginning of
      ext4's development.  Fortunately once the data is stored in the page
      cache cache, ext4_get_blocks() doesn't need to be called, so trying to
      replicate this problem to the point where we could identify its root
      cause was *extremely* difficult.  Many thanks to Kevin Shanahan for
      working over several months to be able to reproduce this easily so we
      could finally nail down the cause of the corruption.
      Signed-off-by: N"Theodore Ts'o" <tytso@mit.edu>
      Reviewed-by: N"Aneesh Kumar K.V" <aneesh.kumar@linux.vnet.ibm.com>
      2ec0ae3a
    • F
      kgdb: gdb documentation fix · d34a792d
      Frank Rowand 提交于
      gdb command "set remote debug 1" is not valid, change to correct command.
      Signed-off-by: NFrank Rowand <frank.rowand@am.sony.com>
      Signed-off-by: NJason Wessel <jason.wessel@windriver.com>
      d34a792d
    • J
      kgdb,i386: use address that SP register points to in the exception frame · 33ab1979
      Jason Wessel 提交于
      The treatment of the SP register is different on x86_64 and i386.
      This is a regression fix that lived outside the mainline kernel from
      2.6.27 to now.  The regression was a result of the original merge
      consolidation of the i386 and x86_64 archs to x86.
      
      The incorrectly reported SP on i386 prevented stack tracebacks from
      working correctly in gdb.
      Signed-off-by: NJason Wessel <jason.wessel@windriver.com>
      33ab1979
    • J
      sysrq, intel_fb: fix sysrq g collision · 364b5b7b
      Jason Wessel 提交于
      Commit 79e53945 introduced a
      regression where you cannot use sysrq 'g' to enter kgdb.  The solution
      is to move the intel fb sysrq over to V for video instead of G for
      graphics.  The SMP VOYAGER code to register for the sysrq-v is not
      anywhere to be found in the mainline kernel, so the comments in the
      code were cleaned up as well.
      
      This patch also cleans up the sysrq definitions for kgdb to make it
      generic for the kernel debugger, such that the sysrq 'g' can be used
      in the future to enter a gdbstub or another kernel debugger.
      Signed-off-by: NJason Wessel <jason.wessel@windriver.com>
      Acked-by: NJesse Barnes <jbarnes@virtuousgeek.org>
      Acked-by: NRandy Dunlap <randy.dunlap@oracle.com>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      364b5b7b
    • I
      perf stat: handle Ctrl-C · 58d7e993
      Ingo Molnar 提交于
      Before this change, if a long-running perf stat workload was Ctrl-C-ed,
      the utility exited without displaying statistics.
      
      After the change, the Ctrl-C gets propagated into the workload (and
      causes its early exit there), but perf stat itself will still continue
      to run and will display counter results.
      
      This is useful to run open-ended workloads, let them run for
      a while, then Ctrl-C them to get the stats.
      
      [ Impact: extend perf stat with new functionality ]
      
      Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
      Cc: Paul Mackerras <paulus@samba.org>
      Cc: Corey Ashford <cjashfor@linux.vnet.ibm.com>
      Cc: Arnaldo Carvalho de Melo <acme@redhat.com>
      LKML-Reference: <new-submission>
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      58d7e993
    • J
      Revert "mm: add /proc controls for pdflush threads" · cd17cbfd
      Jens Axboe 提交于
      This reverts commit fafd688e.
      
      Work is progressing to switch away from pdflush as the process backing
      for flushing out dirty data. So it seems pointless to add more knobs
      to control pdflush threads. The original author of the patch did not
      have any specific use cases for adding the knobs, so we can easily
      revert this before 2.6.30 to avoid having to maintain this API
      forever.
      Signed-off-by: NJens Axboe <jens.axboe@oracle.com>
      cd17cbfd