1. 03 10月, 2011 1 次提交
    • M
      genirq: Add support for per-cpu dev_id interrupts · 31d9d9b6
      Marc Zyngier 提交于
      The ARM GIC interrupt controller offers per CPU interrupts (PPIs),
      which are usually used to connect local timers to each core. Each CPU
      has its own private interface to the GIC, and only sees the PPIs that
      are directly connect to it.
      
      While these timers are separate devices and have a separate interrupt
      line to a core, they all use the same IRQ number.
      
      For these devices, request_irq() is not the right API as it assumes
      that an IRQ number is visible by a number of CPUs (through the
      affinity setting), but makes it very awkward to express that an IRQ
      number can be handled by all CPUs, and yet be a different interrupt
      line on each CPU, requiring a different dev_id cookie to be passed
      back to the handler.
      
      The *_percpu_irq() functions is designed to overcome these
      limitations, by providing a per-cpu dev_id vector:
      
      int request_percpu_irq(unsigned int irq, irq_handler_t handler,
      		   const char *devname, void __percpu *percpu_dev_id);
      void free_percpu_irq(unsigned int, void __percpu *);
      int setup_percpu_irq(unsigned int irq, struct irqaction *new);
      void remove_percpu_irq(unsigned int irq, struct irqaction *act);
      void enable_percpu_irq(unsigned int irq);
      void disable_percpu_irq(unsigned int irq);
      
      The API has a number of limitations:
      - no interrupt sharing
      - no threading
      - common handler across all the CPUs
      
      Once the interrupt is requested using setup_percpu_irq() or
      request_percpu_irq(), it must be enabled by each core that wishes its
      local interrupt to be delivered.
      
      Based on an initial patch by Thomas Gleixner.
      Signed-off-by: NMarc Zyngier <marc.zyngier@arm.com>
      Cc: linux-arm-kernel@lists.infradead.org
      Link: http://lkml.kernel.org/r/1316793788-14500-2-git-send-email-marc.zyngier@arm.comSigned-off-by: NThomas Gleixner <tglx@linutronix.de>
      31d9d9b6
  2. 19 8月, 2011 1 次提交
  3. 28 7月, 2011 1 次提交
  4. 03 6月, 2011 2 次提交
  5. 18 5月, 2011 3 次提交
  6. 28 3月, 2011 1 次提交
  7. 27 3月, 2011 1 次提交
  8. 24 3月, 2011 1 次提交
  9. 22 2月, 2011 1 次提交
    • Y
      genirq: Use IRQ_BITMAP_BITS as search size in irq_alloc_descs() · ed4dea6e
      Yinghai Lu 提交于
      The runtime expansion of nr_irqs does not take into account that
      bitmap_find_next_zero_area() returns "start" + size in case the search
      for an matching zero area fails. That results in a start value which
      can be completely off and is not covered by the following
      expand_nr_irqs() and possibly outside of the absolute limit. But we
      use it without further checking.
      
      Use IRQ_BITMAP_BITS as the limit for the bitmap search and expand
      nr_irqs when the start bit is beyond nr_irqs. So start is always
      pointing to the correct area in the bitmap. nr_irqs is just the limit
      for irq enumerations, not the real limit for the irq space.
      
      [ tglx: Let irq_expand_nr_irqs() take the new upper end so we do not
        	expand nr_irqs more than necessary. Made changelog readable ]
      Signed-off-by: NYinghai Lu <yinghai@kernel.org>
      LKML-Reference: <4D6014F9.8040605@kernel.org>
      Signed-off-by: NThomas Gleixner <tglx@linutronix.de>
      ed4dea6e
  10. 19 2月, 2011 6 次提交
    • T
      genirq: Implement irq_get/put_desc_[bus]locked/unlock() · d5eb4ad2
      Thomas Gleixner 提交于
      Most of the managing functions get the irq descriptor and lock it -
      either with or without buslock. Instead of open coding this over and
      over provide a common function to do that.
      Signed-off-by: NThomas Gleixner <tglx@linutronix.de>
      d5eb4ad2
    • T
      genirq: Force wrapped access to desc->status in core code · f9e4989e
      Thomas Gleixner 提交于
      Force the usage of wrappers by another nasty CPP substitution.
      Signed-off-by: NThomas Gleixner <tglx@linutronix.de>
      f9e4989e
    • T
      genirq: Move IRQ_DISABLED to core · c1594b77
      Thomas Gleixner 提交于
      Keep status in sync until all abusers are fixed.
      Signed-off-by: NThomas Gleixner <tglx@linutronix.de>
      c1594b77
    • T
      genirq: Protect tglx from tripping over his own feet · e6bea9c4
      Thomas Gleixner 提交于
      The irq_desc.status field will either go away or renamed to
      settings. Anyway we need to maintain compatibility to avoid breaking
      the world and some more. While moving bits into the core, I need to
      avoid that I use any of the still existing IRQ_ bits in the core code
      by typos. So that file will hold the inline wrappers and some nasty
      CPP tricks to break the build when typoed.
      Signed-off-by: NThomas Gleixner <tglx@linutronix.de>
      e6bea9c4
    • 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: 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
  11. 09 2月, 2011 1 次提交
  12. 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
  13. 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
  14. 13 10月, 2010 1 次提交
  15. 12 10月, 2010 15 次提交