03 Feb, 2011
1 commit
-
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
Signed-off-by: Thomas Gleixner
Cc: stable@kernel.org
21 Jan, 2011
1 commit
-
All architectures are finally converted. Remove the cruft.
Signed-off-by: Thomas Gleixner
Cc: Richard Henderson
Cc: Mike Frysinger
Cc: David Howells
Cc: Tony Luck
Cc: Greg Ungerer
Cc: Michal Simek
Acked-by: David Howells
Cc: Kyle McMartin
Acked-by: Benjamin Herrenschmidt
Cc: Chen Liqin
Cc: "David S. Miller"
Cc: Chris Metcalf
Cc: Jeff Dike
14 Jan, 2011
1 commit
-
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: Eric Dumazet
Reviewed-by: Christoph Lameter
Cc: Ingo Molnar
Cc: Andi Kleen
Cc: Tejun Heo
Cc: Thomas Gleixner
Signed-off-by: Andrew Morton
Signed-off-by: Linus Torvalds
07 Jan, 2011
1 commit
-
Function-scope statics are discouraged because they are
easily overlooked and can cause subtle bugs/races due to
their global (non-SMP safe) nature.Linus noticed that we did this for sched_param - at minimum
make the const.Suggested-by: Linus Torvalds
Signed-off-by: Peter Zijlstra
LKML-Reference: Message-ID:
Signed-off-by: Ingo Molnar
09 Dec, 2010
1 commit
-
Merge reason: we want to queue up dependent cleanup
Signed-off-by: Ingo Molnar
01 Dec, 2010
1 commit
-
Since commit a1afb637(switch /proc/irq/*/spurious to seq_file) all
/proc/irq/XX/spurious files show the information of irq 0.Current irq_spurious_proc_open() passes on NULL as the 3rd argument,
which is used as an IRQ number in irq_spurious_proc_show(), to the
single_open(). Because of this, all the /proc/irq/XX/spurious file
shows IRQ 0 information regardless of the IRQ number.To fix the problem, irq_spurious_proc_open() must pass on the
appropreate data (IRQ number) to single_open().Signed-off-by: Kenji Kaneshige
Reviewed-by: Yong Zhang
LKML-Reference:
Cc: stable@kernel.org [2.6.33+]
Signed-off-by: Thomas Gleixner
18 Nov, 2010
1 commit
-
Merge reason: Move to a .37-rc base.
Signed-off-by: Ingo Molnar
01 Nov, 2010
1 commit
-
…rnel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip
* 'irq-core-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip:
genirq: Fix up irq_node() for irq_data changes.
genirq: Add single IRQ reservation helper
genirq: Warn if enable_irq is called before irq is set up* 'core-locking-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip:
semaphore: Remove mutex emulation
staging: Final semaphore cleanup
jbd2: Convert jbd2_slab_create_sem to mutex
hpfs: Convert sbi->hpfs_creation_de to mutexFix up trivial change/delete conflicts with deleted 'dream' drivers
(drivers/staging/dream/camera/{mt9d112.c,mt9p012_fox.c,mt9t013.c,s5k3e2fx.c})
28 Oct, 2010
1 commit
-
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 asfor_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: KAMEZAWA Hiroyuki
Tested-by: Jack Steiner
Acked-by: Jack Steiner
Cc: Yinghai Lu
Cc: Ingo Molnar
Cc: Thomas Gleixner
Signed-off-by: Andrew Morton
Signed-off-by: Linus Torvalds
23 Oct, 2010
1 commit
-
Andrew Morton pointed out almost all sched_setscheduler() callers are
using fixed parameters and can be converted to static. It reduces runtime
memory use a little.Signed-off-by: KOSAKI Motohiro
Reported-by: Andrew Morton
Acked-by: James Morris
Cc: Ingo Molnar
Cc: Steven Rostedt
Signed-off-by: Andrew Morton
Signed-off-by: Thomas Gleixner
Signed-off-by: Ingo Molnar
22 Oct, 2010
1 commit
-
The recent changes in the genirq core unearthed a bug in arch/um which
called enable_irq() before the interrupt was set up.Warn and return instead of crashing the machine with a NULL pointer
dereference.Signed-off-by: Thomas Gleixner
Cc: Richard Weinberger
13 Oct, 2010
1 commit
-
This option can be set to verify the full conversion to the new chip
functions. Fix the fallout of the patch rework, so the core code
compiles and works with it.Signed-off-by: Thomas Gleixner
12 Oct, 2010
18 commits
-
The allocator functions are now called outside of preempt disabled
regions. Switch to GFP_KERNEL.Signed-off-by: Thomas Gleixner
Reviewed-by: Ingo Molnar -
No callers from atomic regions.
Signed-off-by: Thomas Gleixner
Reviewed-by: Ingo Molnar -
The move_irq_desc() function was only used due to the problem that the
allocator did not free the old descriptors. So the descriptors had to
be moved in create_irq_nr(). That's history.The code would have never been able to move active interrupt
descriptors on affinity settings. That can be done in a completely
different way w/o all this horror.Remove all of it.
Signed-off-by: Thomas Gleixner
Reviewed-by: Ingo Molnar -
Use the cleanup functions of the dynamic allocator. No need to have
separate implementations.Signed-off-by: Thomas Gleixner
Reviewed-by: Ingo Molnar -
This function should have not been there in the first place.
Signed-off-by: Thomas Gleixner
Reviewed-by: Ingo Molnar -
sparse irq sets up NR_IRQS_LEGACY irq descriptors and archs then go
ahead and allocate more.Use the unused return value of arch_probe_nr_irqs() to let the
architecture return the number of early allocations. Fix up all users.Signed-off-by: Thomas Gleixner
Reviewed-by: Ingo Molnar -
Make irq_to_desc_alloc_node() a wrapper around the new allocator.
Signed-off-by: Thomas Gleixner
Reviewed-by: Ingo Molnar -
Mark a range of interrupts as allocated. In the SPARSE_IRQ=n case we
need this to update the bitmap for the legacy irqs so the enumerator
via irq_get_next_irq() works.Signed-off-by: Thomas Gleixner
-
Use the allocator bitmap to lookup active interrupts.
Signed-off-by: Thomas Gleixner
Reviewed-by: Ingo Molnar -
/proc/irq never removes any entries, but when irq descriptors can be
freed for real this is necessary. Otherwise we'd reference a freed
descriptor in /proc/irq/NSigned-off-by: Thomas Gleixner
Reviewed-by: Ingo Molnar -
The current sparse_irq allocator has several short comings due to
failures in the design or the lack of it:- Requires iteration over the number of active irqs to find a free slot
(Some architectures have grown their own workarounds for this)
- Removal of entries is not possible
- Racy between create_irq_nr and destroy_irq (plugged by horrible
callbacks)
- Migration of active irq descriptors is not possible
- No bulk allocation of irq ranges
- Sprinkeled irq_desc references all over the place outside of kernel/irq/
(The previous chip functions series is addressing this issue)Implement a sane allocator which fixes the above short comings (though
migration of active descriptors needs a full tree wide cleanup of the
direct and mostly unlocked access to irq_desc).The new allocator still uses a radix_tree, but uses a bitmap for
keeping track of allocated irq numbers. That allows:- Fast lookup of a free slot
- Allows the removal of descriptors
- Prevents the create/destroy race
- Bulk allocation of consecutive irq ranges
- Basic design is ready for migration of life descriptors after
further cleanupsThe bitmap is also used in the SPARSE_IRQ=n case for lookup and
raceless (de)allocation of irq numbers. So it removes the requirement
for looping through the descriptor array to find slots.Right now it uses sparse_irq_lock to protect the bitmap and the radix
tree, but after cleaning up all users we should be able convert that
to a mutex and to switch the radix_tree and decriptor allocations to
GFP_KERNEL.[ Folded in a bugfix from Yinghai Lu ]
Signed-off-by: Thomas Gleixner
Reviewed-by: Ingo Molnar -
Arch code sets it's own irq_desc.status flags right after boot and for
dynamically allocated interrupts. That might involve iterating over a
huge array.Allow ARCH_IRQ_INIT_FLAGS to set separate flags aside of IRQ_DISABLED
which is the default.Signed-off-by: Thomas Gleixner
Reviewed-by: Ingo Molnar -
The statistics accessor is only used by proc/stats and
show_interrupts(). Both are compiled in.Signed-off-by: Thomas Gleixner
Reviewed-by: Ingo Molnar -
early_init_irq_lock_class() is called way before anything touches the
irq descriptors. In case of SPARSE_IRQ=y this is a NOP operation
because the radix tree is empty at this point. For the SPARSE_IRQ=n
case it's sufficient to set the lock class in early_init_irq().Signed-off-by: Thomas Gleixner
Reviewed-by: Ingo Molnar -
kernel/irq/handle.c has become a dumpground for random code in random
order. Split out the irq descriptor management and the dummy irq_chip
implementation into separate files. Cleanup the include maze while at
it.No code change.
Signed-off-by: Thomas Gleixner
Reviewed-by: Ingo Molnar -
Get the data structure from the core and provide inline wrappers to
access the irq_data members.Provide accessor inlines for irq_data as well.
Signed-off-by: Thomas Gleixner
Reviewed-by: Ingo Molnar -
Provide a irq_desc.status modifier function to cleanup the direct
access to irq_desc in arch and driver code.Signed-off-by: Thomas Gleixner
Reviewed-by: Ingo Molnar -
Move irq_desc and internal functions out of irq.h
Signed-off-by: Thomas Gleixner
Reviewed-by: Ingo Molnar
04 Oct, 2010
10 commits
-
This option covers now the old chip functions and the irq_desc data
fields which are moving to struct irq_data. More stuff will follow.Pretty handy for testing a conversion, whether something broke or not.
Signed-off-by: Thomas Gleixner
Reviewed-by: Ingo Molnar -
Wrap the old chip function retrigger() until the migration is complete
and the old chip functions are removed.Signed-off-by: Thomas Gleixner
Cc: Peter Zijlstra
LKML-Reference:
Reviewed-by: H. Peter Anvin
Reviewed-by: Ingo Molnar -
Wrap the old chip function set_wake() until the migration is complete
and the old chip functions are removed.Signed-off-by: Thomas Gleixner
Cc: Peter Zijlstra
LKML-Reference:
Reviewed-by: H. Peter Anvin
Reviewed-by: Ingo Molnar -
Wrap the old chip function set_type() until the migration is complete
and the old chip functions are removed.Signed-off-by: Thomas Gleixner
Cc: Peter Zijlstra
LKML-Reference:
Reviewed-by: H. Peter Anvin
Reviewed-by: Ingo Molnar -
Wrap the old chip function set_affinity() until the migration is
complete and the old chip functions are removed.Signed-off-by: Thomas Gleixner
Cc: Peter Zijlstra
LKML-Reference:
Reviewed-by: H. Peter Anvin
Reviewed-by: Ingo Molnar -
Wrap the old chip function startup() until the migration is complete and
the old chip functions are removed.Signed-off-by: Thomas Gleixner
Cc: Peter Zijlstra
LKML-Reference:
Reviewed-by: H. Peter Anvin
Reviewed-by: Ingo Molnar -
Wrap the old chip functions disable() and shutdown() until the
migration is complete and the old chip functions are removed.Signed-off-by: Thomas Gleixner
Cc: Peter Zijlstra
LKML-Reference:
Reviewed-by: H. Peter Anvin
Reviewed-by: Ingo Molnar -
Wrap the old chip function enable() until the migration is complete and
the old chip functions are removed.Signed-off-by: Thomas Gleixner
Cc: Peter Zijlstra
LKML-Reference:
Reviewed-by: H. Peter Anvin
Reviewed-by: Ingo Molnar -
Wrap the old chip function eoi() until the migration is complete and
the old chip functions are removed.Signed-off-by: Thomas Gleixner
Cc: Peter Zijlstra
LKML-Reference:
Reviewed-by: H. Peter Anvin
Reviewed-by: Ingo Molnar -
Wrap the old chip function mask_ack() until the migration is complete
and the old chip functions are removed.Signed-off-by: Thomas Gleixner
Cc: Peter Zijlstra
LKML-Reference:
Reviewed-by: H. Peter Anvin
Reviewed-by: Ingo Molnar