forked from Minki/linux
2f75d9e1c9
Implement the infrastructure for a simple bitmap based allocator, which will replace the x86 vector allocator. It's in the core code as other architectures might be able to reuse/extend it. For now it only implements allocations for single CPUs, but it's simple to add multi CPU allocation support if required. The concept is rather simple: Global information: system_vector bitmap global accounting PerCPU information: allocation bitmap managed allocation bitmap local accounting The system vector bitmap is used to exclude vectors system wide from the allocation space. The allocation bitmap is used to keep track of per cpu used vectors. The managed allocation bitmap is used to reserve vectors for managed interrupts. When a regular (non managed) interrupt allocation happens then the following rule applies: tmpmap = system_map | alloc_map | managed_map find_zero_bit(tmpmap) Oring the bitmaps together gives the real available space. The same rule applies for reserving a managed interrupt vector. But contrary to the regular interrupts the reservation only marks the bit in the managed map and therefor excludes it from the regular allocations. The managed map is only cleaned out when the a managed interrupt is completely released and it stays alive accross CPU offline/online operations. For managed interrupt allocations the rule is: tmpmap = managed_map & ~alloc_map find_first_bit(tmpmap) This returns the first bit which is in the managed map, but not yet allocated in the allocation map. The allocation marks it in the allocation map and hands it back to the caller for use. The rest of the code are helper functions to handle the various requirements and the accounting which are necessary to replace the x86 vector allocation code. The result is a single patch as the evolution of this infrastructure cannot be represented in bits and pieces. Signed-off-by: Thomas Gleixner <tglx@linutronix.de> Tested-by: Juergen Gross <jgross@suse.com> Tested-by: Yu Chen <yu.c.chen@intel.com> Acked-by: Juergen Gross <jgross@suse.com> Cc: Boris Ostrovsky <boris.ostrovsky@oracle.com> Cc: Tony Luck <tony.luck@intel.com> Cc: Marc Zyngier <marc.zyngier@arm.com> Cc: Alok Kataria <akataria@vmware.com> Cc: Joerg Roedel <joro@8bytes.org> Cc: "Rafael J. Wysocki" <rjw@rjwysocki.net> Cc: Steven Rostedt <rostedt@goodmis.org> Cc: Christoph Hellwig <hch@lst.de> Cc: Peter Zijlstra <peterz@infradead.org> Cc: Borislav Petkov <bp@alien8.de> Cc: Paolo Bonzini <pbonzini@redhat.com> Cc: Rui Zhang <rui.zhang@intel.com> Cc: "K. Y. Srinivasan" <kys@microsoft.com> Cc: Arjan van de Ven <arjan@linux.intel.com> Cc: Dan Williams <dan.j.williams@intel.com> Cc: Chris Metcalf <cmetcalf@mellanox.com> Cc: Len Brown <lenb@kernel.org> Link: https://lkml.kernel.org/r/20170913213153.185437174@linutronix.de
142 lines
3.2 KiB
Plaintext
142 lines
3.2 KiB
Plaintext
menu "IRQ subsystem"
|
|
# Options selectable by the architecture code
|
|
|
|
# Make sparse irq Kconfig switch below available
|
|
config MAY_HAVE_SPARSE_IRQ
|
|
bool
|
|
|
|
# Legacy support, required for itanic
|
|
config GENERIC_IRQ_LEGACY
|
|
bool
|
|
|
|
# Enable the generic irq autoprobe mechanism
|
|
config GENERIC_IRQ_PROBE
|
|
bool
|
|
|
|
# Use the generic /proc/interrupts implementation
|
|
config GENERIC_IRQ_SHOW
|
|
bool
|
|
|
|
# Print level/edge extra information
|
|
config GENERIC_IRQ_SHOW_LEVEL
|
|
bool
|
|
|
|
# Supports effective affinity mask
|
|
config GENERIC_IRQ_EFFECTIVE_AFF_MASK
|
|
bool
|
|
|
|
# Facility to allocate a hardware interrupt. This is legacy support
|
|
# and should not be used in new code. Use irq domains instead.
|
|
config GENERIC_IRQ_LEGACY_ALLOC_HWIRQ
|
|
bool
|
|
|
|
# Support for delayed migration from interrupt context
|
|
config GENERIC_PENDING_IRQ
|
|
bool
|
|
|
|
# Support for generic irq migrating off cpu before the cpu is offline.
|
|
config GENERIC_IRQ_MIGRATION
|
|
bool
|
|
|
|
# Alpha specific irq affinity mechanism
|
|
config AUTO_IRQ_AFFINITY
|
|
bool
|
|
|
|
# Tasklet based software resend for pending interrupts on enable_irq()
|
|
config HARDIRQS_SW_RESEND
|
|
bool
|
|
|
|
# Preflow handler support for fasteoi (sparc64)
|
|
config IRQ_PREFLOW_FASTEOI
|
|
bool
|
|
|
|
# Edge style eoi based handler (cell)
|
|
config IRQ_EDGE_EOI_HANDLER
|
|
bool
|
|
|
|
# Generic configurable interrupt chip implementation
|
|
config GENERIC_IRQ_CHIP
|
|
bool
|
|
select IRQ_DOMAIN
|
|
|
|
# Generic irq_domain hw <--> linux irq number translation
|
|
config IRQ_DOMAIN
|
|
bool
|
|
|
|
# Support for simulated interrupts
|
|
config IRQ_SIM
|
|
bool
|
|
select IRQ_WORK
|
|
|
|
# Support for hierarchical irq domains
|
|
config IRQ_DOMAIN_HIERARCHY
|
|
bool
|
|
select IRQ_DOMAIN
|
|
|
|
# Support for hierarchical fasteoi+edge and fasteoi+level handlers
|
|
config IRQ_FASTEOI_HIERARCHY_HANDLERS
|
|
bool
|
|
|
|
# Generic IRQ IPI support
|
|
config GENERIC_IRQ_IPI
|
|
bool
|
|
|
|
# Generic MSI interrupt support
|
|
config GENERIC_MSI_IRQ
|
|
bool
|
|
|
|
# Generic MSI hierarchical interrupt domain support
|
|
config GENERIC_MSI_IRQ_DOMAIN
|
|
bool
|
|
select IRQ_DOMAIN_HIERARCHY
|
|
select GENERIC_MSI_IRQ
|
|
|
|
config HANDLE_DOMAIN_IRQ
|
|
bool
|
|
|
|
config IRQ_TIMINGS
|
|
bool
|
|
|
|
config GENERIC_IRQ_MATRIX_ALLOCATOR
|
|
bool
|
|
|
|
config IRQ_DOMAIN_DEBUG
|
|
bool "Expose hardware/virtual IRQ mapping via debugfs"
|
|
depends on IRQ_DOMAIN && DEBUG_FS
|
|
help
|
|
This option will show the mapping relationship between hardware irq
|
|
numbers and Linux irq numbers. The mapping is exposed via debugfs
|
|
in the file "irq_domain_mapping".
|
|
|
|
If you don't know what this means you don't need it.
|
|
|
|
# Support forced irq threading
|
|
config IRQ_FORCED_THREADING
|
|
bool
|
|
|
|
config SPARSE_IRQ
|
|
bool "Support sparse irq numbering" if MAY_HAVE_SPARSE_IRQ
|
|
---help---
|
|
|
|
Sparse irq numbering is useful for distro kernels that want
|
|
to define a high CONFIG_NR_CPUS value but still want to have
|
|
low kernel memory footprint on smaller machines.
|
|
|
|
( Sparse irqs can also be beneficial on NUMA boxes, as they spread
|
|
out the interrupt descriptors in a more NUMA-friendly way. )
|
|
|
|
If you don't know what to do here, say N.
|
|
|
|
config GENERIC_IRQ_DEBUGFS
|
|
bool "Expose irq internals in debugfs"
|
|
depends on DEBUG_FS
|
|
default n
|
|
---help---
|
|
|
|
Exposes internal state information through debugfs. Mostly for
|
|
developers and debugging of hard to diagnose interrupt problems.
|
|
|
|
If you don't know what to do here, say N.
|
|
|
|
endmenu
|