diff options
author | John Baldwin <jhb@FreeBSD.org> | 2016-05-02 18:00:38 +0000 |
---|---|---|
committer | John Baldwin <jhb@FreeBSD.org> | 2016-05-02 18:00:38 +0000 |
commit | bc153c692ff962bda50532211fdc0086a58e6c52 (patch) | |
tree | 65727b36586900faeb960b9b98fb030c3ec20bd8 /sys/amd64 | |
parent | 207332450ebe1df184818ab11115dcd7b95a5bc5 (diff) | |
download | src-bc153c692ff962bda50532211fdc0086a58e6c52.tar.gz src-bc153c692ff962bda50532211fdc0086a58e6c52.zip |
Add a new bus method to fetch device-specific CPU sets.
bus_get_cpus() returns a specified set of CPUs for a device. It accepts
an enum for the second parameter that indicates the type of cpuset to
request. Currently two valus are supported:
- LOCAL_CPUS (on x86 this returns all the CPUs in the package closest to
the device when DEVICE_NUMA is enabled)
- INTR_CPUS (like LOCAL_CPUS but only returns 1 SMT thread for each core)
For systems that do not support NUMA (or if it is not enabled in the kernel
config), LOCAL_CPUS fails with EINVAL. INTR_CPUS is mapped to 'all_cpus'
by default. The idea is that INTR_CPUS should always return a valid set.
Device drivers which want to use per-CPU interrupts should start using
INTR_CPUS instead of simply assigning interrupts to all available CPUs.
In the future we may wish to add tunables to control the policy of
INTR_CPUS (e.g. should it be local-only or global, should it ignore
SMT threads or not).
The x86 nexus driver exposes the internal set of interrupt CPUs from the
the x86 interrupt code via INTR_CPUS.
The ACPI bus driver and PCI bridge drivers use _PXM to return a suitable
LOCAL_CPUS set when _PXM exists and DEVICE_NUMA is enabled. They also and
the global INTR_CPUS set from the nexus driver with the per-domain set from
_PXM to generate a local INTR_CPUS set for child devices.
Reviewed by: wblock (manpage)
Differential Revision: https://reviews.freebsd.org/D5519
Notes
Notes:
svn path=/head/; revision=298933
Diffstat (limited to 'sys/amd64')
-rw-r--r-- | sys/amd64/include/intr_machdep.h | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/sys/amd64/include/intr_machdep.h b/sys/amd64/include/intr_machdep.h index 22f9a49c1d65..8de839b188e7 100644 --- a/sys/amd64/include/intr_machdep.h +++ b/sys/amd64/include/intr_machdep.h @@ -143,6 +143,9 @@ struct nmi_pcpu { register_t __padding; /* pad to 16 bytes */ }; +#ifdef SMP +extern cpuset_t intr_cpus; +#endif extern struct mtx icu_lock; extern int elcr_found; |