1. 19 11月, 2012 2 次提交
    • F
      vtime: Explicitly account pending user time on process tick · bcebdf84
      Frederic Weisbecker 提交于
      All vtime implementations just flush the user time on process
      tick. Consolidate that in generic code by calling a user time
      accounting helper. This avoids an indirect call in ia64 and
      prepare to also consolidate vtime context switch code.
      Signed-off-by: NFrederic Weisbecker <fweisbec@gmail.com>
      Reviewed-by: NSteven Rostedt <rostedt@goodmis.org>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Ingo Molnar <mingo@kernel.org>
      Cc: Thomas Gleixner <tglx@linutronix.de>
      Cc: Steven Rostedt <rostedt@goodmis.org>
      Cc: Paul Gortmaker <paul.gortmaker@windriver.com>
      Cc: Tony Luck <tony.luck@intel.com>
      Cc: Fenghua Yu <fenghua.yu@intel.com>
      Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
      Cc: Paul Mackerras <paulus@samba.org>
      Cc: Martin Schwidefsky <schwidefsky@de.ibm.com>
      Cc: Heiko Carstens <heiko.carstens@de.ibm.com>
      bcebdf84
    • F
      vtime: Remove the underscore prefix invasion · fd25b4c2
      Frederic Weisbecker 提交于
      Prepending irq-unsafe vtime APIs with underscores was actually
      a bad idea as the result is a big mess in the API namespace that
      is even waiting to be further extended. Also these helpers
      are always called from irq safe callers except kvm. Just
      provide a vtime_account_system_irqsafe() for this specific
      case so that we can remove the underscore prefix on other
      vtime functions.
      Signed-off-by: NFrederic Weisbecker <fweisbec@gmail.com>
      Reviewed-by: NSteven Rostedt <rostedt@goodmis.org>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Ingo Molnar <mingo@kernel.org>
      Cc: Thomas Gleixner <tglx@linutronix.de>
      Cc: Steven Rostedt <rostedt@goodmis.org>
      Cc: Paul Gortmaker <paul.gortmaker@windriver.com>
      Cc: Tony Luck <tony.luck@intel.com>
      Cc: Fenghua Yu <fenghua.yu@intel.com>
      Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
      Cc: Paul Mackerras <paulus@samba.org>
      Cc: Martin Schwidefsky <schwidefsky@de.ibm.com>
      Cc: Heiko Carstens <heiko.carstens@de.ibm.com>
      fd25b4c2
  2. 30 10月, 2012 6 次提交
    • I
      Merge tag 'cputime-cleanups-for-mingo' of... · 38ca9c92
      Ingo Molnar 提交于
      Merge tag 'cputime-cleanups-for-mingo' of git://git.kernel.org/pub/scm/linux/kernel/git/frederic/linux-dynticks into sched/core
      
      Pull cputime cleanups and optimizations from Frederic Weisbecker:
      
       * Gather vtime headers that were a bit scattered around
      
       * Separate irqtime and vtime namespaces that were
         colliding, resulting in useless calls to irqtime accounting.
      
       * Slightly optimize irq and guest vtime accounting.
      Signed-off-by: NFrederic Weisbecker <fweisbec@gmail.com>
      Signed-off-by: NIngo Molnar <mingo@kernel.org>
      38ca9c92
    • F
      cputime: Separate irqtime accounting from generic vtime · 3e1df4f5
      Frederic Weisbecker 提交于
      vtime_account() doesn't have the same role in
      CONFIG_VIRT_CPU_ACCOUNTING and CONFIG_IRQ_TIME_ACCOUNTING.
      
      In the first case it handles time accounting in any context. In
      the second case it only handles irq time accounting.
      
      So when vtime_account() is called from outside vtime_account_irq_*()
      this call is pointless to CONFIG_IRQ_TIME_ACCOUNTING.
      
      To fix the confusion, change vtime_account() to irqtime_account_irq()
      in CONFIG_IRQ_TIME_ACCOUNTING. This way we ensure future account_vtime()
      calls won't waste useless cycles in the irqtime APIs.
      Signed-off-by: NFrederic Weisbecker <fweisbec@gmail.com>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Ingo Molnar <mingo@kernel.org>
      Cc: Thomas Gleixner <tglx@linutronix.de>
      Cc: Steven Rostedt <rostedt@goodmis.org>
      Cc: Paul Gortmaker <paul.gortmaker@windriver.com>
      3e1df4f5
    • F
      cputime: Specialize irq vtime hooks · fa5058f3
      Frederic Weisbecker 提交于
      With CONFIG_VIRT_CPU_ACCOUNTING, when vtime_account()
      is called in irq entry/exit, we perform a check on the
      context: if we are interrupting the idle task we
      account the pending cputime to idle, otherwise account
      to system time or its sub-areas: tsk->stime, hardirq time,
      softirq time, ...
      
      However this check for idle only concerns the hardirq entry
      and softirq entry:
      
      * Hardirq may directly interrupt the idle task, in which case
      we need to flush the pending CPU time to idle.
      
      * The idle task may be directly interrupted by a softirq if
      it calls local_bh_enable(). There is probably no such call
      in any idle task but we need to cover every case. Ksoftirqd
      is not concerned because the idle time is flushed on context
      switch and softirq in the end of hardirq have the idle time
      already flushed from the hardirq entry.
      
      In the other cases we always account to system/irq time:
      
      * On hardirq exit we account the time to hardirq time.
      * On softirq exit we account the time to softirq time.
      
      To optimize this and avoid the indirect call to vtime_account()
      and the checks it performs, specialize the vtime irq APIs and
      only perform the check on irq entry. Irq exit can directly call
      vtime_account_system().
      
      CONFIG_IRQ_TIME_ACCOUNTING behaviour doesn't change and directly
      maps to its own vtime_account() implementation. One may want
      to take benefits from the new APIs to optimize irq time accounting
      as well in the future.
      Signed-off-by: NFrederic Weisbecker <fweisbec@gmail.com>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Ingo Molnar <mingo@kernel.org>
      Cc: Thomas Gleixner <tglx@linutronix.de>
      Cc: Steven Rostedt <rostedt@goodmis.org>
      Cc: Paul Gortmaker <paul.gortmaker@windriver.com>
      fa5058f3
    • F
      kvm: Directly account vtime to system on guest switch · b080935c
      Frederic Weisbecker 提交于
      Switching to or from guest context is done on ioctl context.
      So by the time we call kvm_guest_enter() or kvm_guest_exit()
      we know we are not running the idle task.
      
      As a result, we can directly account the cputime using
      vtime_account_system().
      
      There are two good reasons to do this:
      
      * We avoid some useless checks on guest switch. It optimizes
      a bit this fast path.
      
      * In the case of CONFIG_IRQ_TIME_ACCOUNTING, calling vtime_account()
      checks for irq time to account. This is pointless since we know
      we are not in an irq on guest switch. This is wasting cpu cycles
      for no good reason. vtime_account_system() OTOH is a no-op in
      this config option.
      
      * We can remove the irq disable/enable around kvm guest switch in s390.
      
      A further optimization may consist in introducing a vtime_account_guest()
      that directly calls account_guest_time().
      Signed-off-by: NFrederic Weisbecker <fweisbec@gmail.com>
      Cc: Tony Luck <tony.luck@intel.com>
      Cc: Fenghua Yu <fenghua.yu@intel.com>
      Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
      Cc: Paul Mackerras <paulus@samba.org>
      Cc: Heiko Carstens <heiko.carstens@de.ibm.com>
      Cc: Martin Schwidefsky <schwidefsky@de.ibm.com>
      Cc: Avi Kivity <avi@redhat.com>
      Cc: Marcelo Tosatti <mtosatti@redhat.com>
      Cc: Joerg Roedel <joerg.roedel@amd.com>
      Cc: Alexander Graf <agraf@suse.de>
      Cc: Xiantao Zhang <xiantao.zhang@intel.com>
      Cc: Christian Borntraeger <borntraeger@de.ibm.com>
      Cc: Cornelia Huck <cornelia.huck@de.ibm.com>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Ingo Molnar <mingo@kernel.org>
      Cc: Thomas Gleixner <tglx@linutronix.de>
      Cc: Steven Rostedt <rostedt@goodmis.org>
      Cc: Paul Gortmaker <paul.gortmaker@windriver.com>
      b080935c
    • F
      vtime: Make vtime_account_system() irqsafe · 11113334
      Frederic Weisbecker 提交于
      vtime_account_system() currently has only one caller with
      vtime_account() which is irq safe.
      
      Now we are going to call it from other places like kvm where
      irqs are not always disabled by the time we account the cputime.
      
      So let's make it irqsafe. The arch implementation part is now
      prefixed with "__".
      
      vtime_account_idle() arch implementation is prefixed accordingly
      to stay consistent.
      Signed-off-by: NFrederic Weisbecker <fweisbec@gmail.com>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Ingo Molnar <mingo@kernel.org>
      Cc: Thomas Gleixner <tglx@linutronix.de>
      Cc: Steven Rostedt <rostedt@goodmis.org>
      Cc: Paul Gortmaker <paul.gortmaker@windriver.com>
      Cc: Tony Luck <tony.luck@intel.com>
      Cc: Fenghua Yu <fenghua.yu@intel.com>
      Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
      Cc: Paul Mackerras <paulus@samba.org>
      Cc: Martin Schwidefsky <schwidefsky@de.ibm.com>
      Cc: Heiko Carstens <heiko.carstens@de.ibm.com>
      11113334
    • F
      vtime: Gather vtime declarations to their own header file · dcbf832e
      Frederic Weisbecker 提交于
      These APIs are scattered around and are going to expand a bit.
      Let's create a dedicated header file for sanity.
      Signed-off-by: NFrederic Weisbecker <fweisbec@gmail.com>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Ingo Molnar <mingo@kernel.org>
      Cc: Thomas Gleixner <tglx@linutronix.de>
      Cc: Steven Rostedt <rostedt@goodmis.org>
      Cc: Paul Gortmaker <paul.gortmaker@windriver.com>
      dcbf832e
  3. 24 10月, 2012 24 次提交
  4. 23 10月, 2012 8 次提交
    • C
      arch/tile: avoid build warnings from duplicate ELF_R_xxx #defines · 78059633
      Chris Metcalf 提交于
      These are now provided in <asm-generic/module.h>, so clean up warnings
      by not re-defining them in module.c.
      Signed-off-by: NChris Metcalf <cmetcalf@tilera.com>
      Acked-by: NRusty Russell <rusty@rustcorp.com.au>
      78059633
    • C
      arch/tile: avoid generating .eh_frame information in modules · 627072b0
      Chris Metcalf 提交于
      The tile tool chain uses the .eh_frame information for backtracing.
      The vmlinux build drops any .eh_frame sections at link time, but when
      present in kernel modules, it causes a module load failure due to the
      presence of unsupported pc-relative relocations.  When compiling to
      use compiler feedback support, the compiler by default omits .eh_frame
      information, so we don't see this problem.  But when not using feedback,
      we need to explicitly suppress the .eh_frame.
      Signed-off-by: NChris Metcalf <cmetcalf@tilera.com>
      Cc: stable@vger.kernel.org
      627072b0
    • L
      Merge branch 'drm-fixes' of git://people.freedesktop.org/~airlied/linux · 2d1f4c8e
      Linus Torvalds 提交于
      Pull drm fixes from Dave Airlie:
       "Fixes for intel and nouveau mainly.
      
         - intel: disable HSW by default, sdvo fixes, link train regression
           fix
         - nouveau: acpi rom loading regression fix, with a few other fixes
           from the rework
         -core: just other minor fixes and race fixes for ttm."
      
      * 'drm-fixes' of git://people.freedesktop.org/~airlied/linux: (24 commits)
        drm/ttm: Fix a theoretical race in ttm_bo_cleanup_refs()
        drm/ttm: Fix a theoretical race
        drm: platform: Don't initialize driver-private data
        drm/debugfs: remove redundant info from gem_names
        drm: fb: cma: Fail gracefully on allocation failure
        drm: fb: cma: Fix typo in debug message
        drm/nouveau/clock: fix missing pll type/addr when matching default entry
        drm/nouveau/fb: fix reporting of memory type on GF8+ IGPs
        drm/nv41/vm: don't init hw pciegart on boards with agp bridge
        drm/nouveau/bios: fetch full 4KiB block to determine ACPI ROM image size
        drm/nouveau: validate vbios size
        drm/nouveau: warn when trying to free mm which is still in use
        drm/nouveau: fix nouveau_mm/nouveau_mm_node leak
        drm/nouveau/bios: improve error handling when reading the vbios from ACPI
        drm/nouveau: handle same-fb page flips
        drm/i915: Initialize obj->pages before use by i915_gem_object_do_bit17_swizzle()
        drm/i915: Add no-lvds quirk for Supermicro X7SPA-H
        drm/i915: Insert i915_preliminary_hw_support variable.
        drm/i915: shut up spurious WARN in the gtt fault handler
        Revert "drm/i915: Try harder to complete DP training pattern 1"
        ...
      2d1f4c8e
    • L
      Merge tag 'jfs-3.7-2' of git://github.com/kleikamp/linux-shaggy · d888af96
      Linus Torvalds 提交于
      Pull jfs fix from Dave Kleikamp:
       "Bug fix: Fix FITRIM argument handling"
      
      * tag 'jfs-3.7-2' of git://github.com/kleikamp/linux-shaggy:
        jfs: Fix FITRIM argument handling
      d888af96
    • L
      Merge tag 'ext4_for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tytso/ext4 · e589db7a
      Linus Torvalds 提交于
      Pull ext4 fixes from Ted Ts'o:
       "Various bug fixes for ext4.  The most serious of them fixes a security
        bug (CVE-2012-4508) which leads to stale data exposure when we have
        fallocate racing against writes to files undergoing delayed
        allocation.  We also have two fixes for the metadata checksum feature,
        the most serious of which can cause the superblock to have a invalid
        checksum after a power failure."
      
      * tag 'ext4_for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tytso/ext4:
        ext4: Avoid underflow in ext4_trim_fs()
        ext4: Checksum the block bitmap properly with bigalloc enabled
        ext4: fix undefined bit shift result in ext4_fill_flex_info
        ext4: fix metadata checksum calculation for the superblock
        ext4: race-condition protection for ext4_convert_unwritten_extents_endio
        ext4: serialize fallocate with ext4_convert_unwritten_extents
      e589db7a
    • L
      Merge tag 'nfs-for-3.7-2' of git://git.linux-nfs.org/projects/trondmy/linux-nfs · 344ba37b
      Linus Torvalds 提交于
      Pull NFS client bugfixes from Trond Myklebust:
       - Do not call pnfs_return_layout() from an rpciod context
       - nfs4_ds_disconnect can cause Oopses.  Kill it...
       - Fix the return value for nfs_callback_start_svc
       - Fix a number of compile warnings
      
      * tag 'nfs-for-3.7-2' of git://git.linux-nfs.org/projects/trondmy/linux-nfs:
        NFSv4: Fix the return value for nfs_callback_start_svc
        NFSv4.1: Declare osd_pri_2_pnfs_err(), objio_init_read/write to be static
        NFSv4: fs/nfs/nfs4getroot.c needs to include "internal.h"
        NFSv4.1: Use kcalloc() to allocate zeroed arrays instead of kzalloc()
        NFSv4.1: Do not call pnfs_return_layout() from an rpciod context
        NFSv4.1: Kill nfs4_ds_disconnect()
      344ba37b
    • L
      Merge tag 'regmap-fix-mmio' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/regmap · c52f1dd5
      Linus Torvalds 提交于
      Pull regmap fix from Mark Brown:
       "regmap: Fix for dependencies for MMIO
      
        Trivial dependency issue, not noticed before as the only user of MMIO
        also needs I2C."
      
      * tag 'regmap-fix-mmio' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/regmap:
        regmap: select REGMAP if REGMAP_MMIO and REGMAP_IRQ enabled
      c52f1dd5
    • T
      drm/ttm: Fix a theoretical race in ttm_bo_cleanup_refs() · b8e902f2
      Thomas Hellstrom 提交于
      In theory, that function could release the lru lock between
      checking for bo on ddestroy list and a successful reserve if the bo
      was already reserved, and the function was called with waiting reserves
      allowed.
      However, all current reservers of a bo on the ddestroy list would
      atomically take the bo off the list after a successful reserve so this
      race should not have been hit, so no need to backport for stable.
      
      This patch also fixes a case found by Maarten Lankhorst where
      ttm_mem_evict_first called with no_wait_gpu would incorrectly
      spin waiting for bo idle if trying to evict a busy buffer that
      also sits on the ddestroy list.
      Signed-off-by: NThomas Hellstrom <thellstrom@vmware.com>
      Signed-off-by: NDave Airlie <airlied@redhat.com>
      b8e902f2