1. 19 2月, 2011 7 次提交
    • T
      genirq: Rremove redundant check · b008207c
      Thomas Gleixner 提交于
      IRQ_NO_BALANCING is already checked in irq_can_set_affinity() above,
      no need to check it again.
      Signed-off-by: NThomas Gleixner <tglx@linutronix.de>
      b008207c
    • T
      genirq: Simplify affinity related code · 1fa46f1f
      Thomas Gleixner 提交于
      There is lot of #ifdef CONFIG_GENERIC_PENDING_IRQ along with
      duplicated code in the irq core. Move the #ifdeffery into one place
      and cleanup the code so it's readable. No functional change.
      Signed-off-by: NThomas Gleixner <tglx@linutronix.de>
      1fa46f1f
    • T
      genirq: Namespace cleanup · a0cd9ca2
      Thomas Gleixner 提交于
      The irq namespace has become quite convoluted. My bad.  Clean it up
      and deprecate the old functions. All new functions follow the scheme:
      
      irq number based:
          irq_set/get/xxx/_xxx(unsigned int irq, ...)
      
      irq_data based:
      	 irq_data_set/get/xxx/_xxx(struct irq_data *d, ....)
      
      irq_desc based:
      	 irq_desc_get_xxx(struct irq_desc *desc)
      Signed-off-by: NThomas Gleixner <tglx@linutronix.de>
      a0cd9ca2
    • T
      genirq: Add missing buslock to set_irq_type(), set_irq_wake() · 43abe43c
      Thomas Gleixner 提交于
      chips behind a slow bus cannot update the chip under desc->lock, but
      we miss the chip_buslock/chip_bus_sync_unlock() calls around the set
      type and set wake functions.
      Signed-off-by: NThomas Gleixner <tglx@linutronix.de>
      43abe43c
    • T
      genirq: Make nr_irqs runtime expandable · e7bcecb7
      Thomas Gleixner 提交于
      We face more and more the requirement to expand nr_irqs at
      runtime. The reason are irq expanders which can not be detected in the
      early boot stage. So we speculate nr_irqs to have enough room. Further
      Xen needs extra irq numbers and we really want to avoid adding more
      "detection" code into the early boot. There is no real good reason why
      we need to limit nr_irqs at early boot.
      
      Allow the allocation code to expand nr_irqs. We have already 8k extra
      number space in the allocation bitmap, so lets use it.
      Signed-off-by: NThomas Gleixner <tglx@linutronix.de>
      e7bcecb7
    • T
      genirq: Disable the SHIRQ_DEBUG call in request_threaded_irq for now · 6d83f94d
      Thomas Gleixner 提交于
      With CONFIG_SHIRQ_DEBUG=y we call a newly installed interrupt handler
      in request_threaded_irq().
      
      The original implementation (commit a304e1b8) called the handler
      _BEFORE_ it was installed, but that caused problems with handlers
      calling disable_irq_nosync(). See commit 377bf1e4.
      
      It's braindead in the first place to call disable_irq_nosync in shared
      handlers, but ....
      
      Moving this call after we installed the handler looks innocent, but it
      is very subtle broken on SMP.
      
      Interrupt handlers rely on the fact, that the irq core prevents
      reentrancy.
      
      Now this debug call violates that promise because we run the handler
      w/o the IRQ_INPROGRESS protection - which we cannot apply here because
      that would result in a possibly forever masked interrupt line.
      
      A concurrent real hardware interrupt on a different CPU results in
      handler reentrancy and can lead to complete wreckage, which was
      unfortunately observed in reality and took a fricking long time to
      debug.
      
      Leave the code here for now. We want this debug feature, but that's
      not easy to fix. We really should get rid of those
      disable_irq_nosync() abusers and remove that function completely.
      Signed-off-by: NThomas Gleixner <tglx@linutronix.de>
      Cc: Anton Vorontsov <avorontsov@ru.mvista.com>
      Cc: David Woodhouse <dwmw2@infradead.org>
      Cc: Arjan van de Ven <arjan@infradead.org>
      Cc: stable@kernel.org # .28 -> .37
      6d83f94d
    • T
      genirq: Prevent access beyond allocated_irqs bitmap · c1ee6264
      Thomas Gleixner 提交于
      Lars-Peter Clausen pointed out:
      
         I stumbled upon this while looking through the existing archs using
         SPARSE_IRQ.  Even with SPARSE_IRQ the NR_IRQS is still the upper
         limit for the number of IRQs.
      
         Both PXA and MMP set NR_IRQS to IRQ_BOARD_START, with
         IRQ_BOARD_START being the number of IRQs used by the core.
      
         In various machine files the nr_irqs field of the ARM machine
         defintion struct is then set to "IRQ_BOARD_START + NR_BOARD_IRQS".
      
         As a result "nr_irqs" will greater then NR_IRQS which then again
         causes the "allocated_irqs" bitmap in the core irq code to be
         accessed beyond its size overwriting unrelated data.
      
      The core code really misses a sanity check there.
      
      This went unnoticed so far as by chance the compiler/linker places
      data behind that bitmap which gets initialized later on those affected
      platforms.
      
      So the obvious fix would be to add a sanity check in early_irq_init()
      and break all affected platforms. Though that check wants to be
      backported to stable as well, which will require to fix all known
      problematic platforms and probably some more yet not known ones as
      well. Lots of churn.
      
      A way simpler solution is to allocate a slightly larger bitmap and
      avoid the whole churn w/o breaking anything. Add a few warnings when
      an arch returns utter crap.
      Reported-by: NLars-Peter Clausen <lars@metafoo.de>
      Signed-off-by: NThomas Gleixner <tglx@linutronix.de>
      Cc: stable@kernel.org # .37
      Cc: Haojian Zhuang <haojian.zhuang@marvell.com>
      Cc: Eric Miao <eric.y.miao@gmail.com>
      Cc: Peter Zijlstra <peterz@infradead.org>
      c1ee6264
  2. 11 2月, 2011 1 次提交
    • D
      genirq: Call bus_lock/unlock functions in setup_irq() · 986c011d
      David Daney 提交于
      irq_chips that supply .irq_bus_lock/.irq_bus_sync_unlock functions,
      expect that the other chip methods will be called inside of calls to
      the pair.  If this expectation is not met, things tend to not work.
      
      Make setup_irq() call chip_bus_lock()/chip_bus_sync_unlock() too.
      
      For the vast majority of irq_chips, this will be a NOP as most don't
      have these bus lock functions.
      
      [ tglx: No we don't want to call that in __setup_irq(). Way too many
        	error exit pathes. ]
      Signed-off-by: NDavid Daney <ddaney@caviumnetworks.com>
      LKML-Reference: <1297296265-18680-1-git-send-email-ddaney@caviumnetworks.com>
      Signed-off-by: NThomas Gleixner <tglx@linutronix.de>
      986c011d
  3. 09 2月, 2011 1 次提交
  4. 08 2月, 2011 1 次提交
  5. 03 2月, 2011 1 次提交
    • T
      genirq: Prevent irq storm on migration · f1a06390
      Thomas Gleixner 提交于
      move_native_irq() masks and unmasks the interrupt line
      unconditionally, but the interrupt line might be masked due to a
      threaded oneshot handler in progress. Unmasking the line in that case
      can lead to interrupt storms. Observed on PREEMPT_RT.
      
      Originally-from: Ingo Molnar <mingo@elte.hu>
      Signed-off-by: NThomas Gleixner <tglx@linutronix.de>
      Cc: stable@kernel.org
      f1a06390
  6. 31 1月, 2011 1 次提交
  7. 23 1月, 2011 1 次提交
    • B
      genirq: Add IRQ affinity notifiers · cd7eab44
      Ben Hutchings 提交于
      When initiating I/O on a multiqueue and multi-IRQ device, we may want
      to select a queue for which the response will be handled on the same
      or a nearby CPU.  This requires a reverse-map of IRQ affinity.  Add a
      notification mechanism to support this.
      
      This is based closely on work by Thomas Gleixner <tglx@linutronix.de>.
      Signed-off-by: NBen Hutchings <bhutchings@solarflare.com>
      Cc: linux-net-drivers@solarflare.com
      Cc: Tom Herbert <therbert@google.com>
      Cc: David Miller <davem@davemloft.net>
      LKML-Reference: <1295470904.11126.84.camel@bwh-desktop>
      Signed-off-by: NThomas Gleixner <tglx@linutronix.de>
      cd7eab44
  8. 21 1月, 2011 1 次提交
  9. 14 1月, 2011 1 次提交
    • E
      irq: use per_cpu kstat_irqs · 6c9ae009
      Eric Dumazet 提交于
      Use modern per_cpu API to increment {soft|hard}irq counters, and use
      per_cpu allocation for (struct irq_desc)->kstats_irq instead of an array.
      
      This gives better SMP/NUMA locality and saves few instructions per irq.
      
      With small nr_cpuids values (8 for example), kstats_irq was a small array
      (less than L1_CACHE_BYTES), potentially source of false sharing.
      
      In the !CONFIG_SPARSE_IRQ case, remove the huge, NUMA/cache unfriendly
      kstat_irqs_all[NR_IRQS][NR_CPUS] array.
      
      Note: we still populate kstats_irq for all possible irqs in
      early_irq_init().  We probably could use on-demand allocations.  (Code
      included in alloc_descs()).  Problem is not all IRQS are used with a prior
      alloc_descs() call.
      
      kstat_irqs_this_cpu() is not used anymore, remove it.
      Signed-off-by: NEric Dumazet <eric.dumazet@gmail.com>
      Reviewed-by: NChristoph Lameter <cl@linux.com>
      Cc: Ingo Molnar <mingo@elte.hu>
      Cc: Andi Kleen <andi@firstfloor.org>
      Cc: Tejun Heo <tj@kernel.org>
      Cc: Thomas Gleixner <tglx@linutronix.de>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      6c9ae009
  10. 07 1月, 2011 1 次提交
  11. 01 12月, 2010 1 次提交
  12. 28 10月, 2010 1 次提交
    • K
      /proc/stat: fix scalability of irq sum of all cpu · 478735e3
      KAMEZAWA Hiroyuki 提交于
      In /proc/stat, the number of per-IRQ event is shown by making a sum each
      irq's events on all cpus.  But we can make use of kstat_irqs().
      
      kstat_irqs() do the same calculation, If !CONFIG_GENERIC_HARDIRQ,
      it's not a big cost. (Both of the number of cpus and irqs are small.)
      
      If a system is very big and CONFIG_GENERIC_HARDIRQ, it does
      
      	for_each_irq()
      		for_each_cpu()
      			- look up a radix tree
      			- read desc->irq_stat[cpu]
      This seems not efficient. This patch adds kstat_irqs() for
      CONFIG_GENRIC_HARDIRQ and change the calculation as
      
      	for_each_irq()
      		look up radix tree
      		for_each_cpu()
      			- read desc->irq_stat[cpu]
      
      This reduces cost.
      
      A test on (4096cpusp, 256 nodes, 4592 irqs) host (by Jack Steiner)
      
      %time cat /proc/stat > /dev/null
      
      Before Patch:	 2.459 sec
      After Patch :	  .561 sec
      
      [akpm@linux-foundation.org: unexport kstat_irqs, coding-style tweaks]
      [akpm@linux-foundation.org: fix unused variable 'per_irq_sum']
      Signed-off-by: NKAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>
      Tested-by: NJack Steiner <steiner@sgi.com>
      Acked-by: NJack Steiner <steiner@sgi.com>
      Cc: Yinghai Lu <yinghai@kernel.org>
      Cc: Ingo Molnar <mingo@elte.hu>
      Cc: Thomas Gleixner <tglx@linutronix.de>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      478735e3
  13. 23 10月, 2010 1 次提交
  14. 22 10月, 2010 1 次提交
  15. 13 10月, 2010 1 次提交
  16. 12 10月, 2010 18 次提交
  17. 04 10月, 2010 1 次提交