#
81aa7175 |
| 02-Mar-2008 |
Jeff Roberson <jeff@FreeBSD.org> |
- Remove the old smp cpu topology specification with a new, more flexible tree structure that encodes the level of cache sharing and other properties. - Provide several convenience functions f
- Remove the old smp cpu topology specification with a new, more flexible tree structure that encodes the level of cache sharing and other properties. - Provide several convenience functions for creating one and two level cpu trees as well as a default flat topology. The system now always has some topology. - On i386 and amd64 create a seperate level in the hierarchy for HTT and multi-core cpus. This will allow the scheduler to intelligently load balance non-uniform cores. Presently we don't detect what level of the cache hierarchy is shared at each level in the topology. - Add a mechanism for testing common topologies that have more information than the MD code is able to provide via the kern.smp.topology tunable. This should be considered a debugging tool only and not a stable api.
Sponsored by: Nokia
show more ...
|
Revision tags: release/7.0.0_cvs, release/7.0.0, release/6.3.0_cvs, release/6.3.0 |
|
#
f53d15fe |
| 08-Nov-2007 |
Stephan Uphoff <ups@FreeBSD.org> |
Initial checkin for rmlock (read mostly lock) a multi reader single writer lock optimized for almost exclusive reader access. (see also rmlock.9)
TODO: Convert to per cpu variables linkerset as
Initial checkin for rmlock (read mostly lock) a multi reader single writer lock optimized for almost exclusive reader access. (see also rmlock.9)
TODO: Convert to per cpu variables linkerset as soon as it is available. Optimize UP (single processor) case.
show more ...
|
Revision tags: release/6.2.0_cvs, release/6.2.0, release/5.5.0_cvs, release/5.5.0, release/6.1.0_cvs, release/6.1.0, release/6.0.0_cvs, release/6.0.0 |
|
#
58553b99 |
| 24-Oct-2005 |
John Baldwin <jhb@FreeBSD.org> |
Rename the KDB_STOP_NMI kernel option to STOP_NMI and make it apply to all IPI_STOP IPIs. - Change the i386 and amd64 MD IPI code to send an NMI if STOP_NMI is enabled if an attempt is made to send
Rename the KDB_STOP_NMI kernel option to STOP_NMI and make it apply to all IPI_STOP IPIs. - Change the i386 and amd64 MD IPI code to send an NMI if STOP_NMI is enabled if an attempt is made to send an IPI_STOP IPI. If the kernel option is enabled, there is also a sysctl to change the behavior at runtime (debug.stop_cpus_with_nmi which defaults to enabled). This includes removing stop_cpus_nmi() and making ipi_nmi_selected() a private function for i386 and amd64. - Fix ipi_all(), ipi_all_but_self(), and ipi_self() on i386 and amd64 to properly handle bitmapped IPIs as well as IPI_STOP IPIs when STOP_NMI is enabled. - Fix ipi_nmi_handler() to execute the restart function on the first CPU that is restarted making use of atomic_readandclear() rather than assuming that the BSP is always included in the set of restarted CPUs. Also, the NMI handler didn't clear the function pointer meaning that subsequent stop and restarts could execute the function again. - Define a new macro HAVE_STOPPEDPCBS on i386 and amd64 to control the use of stoppedpcbs[] and always enable it for i386 and amd64 instead of being dependent on KDB_STOP_NMI. It works fine in both the NMI and non-NMI cases.
show more ...
|
Revision tags: release/5.4.0_cvs, release/5.4.0 |
|
#
fdc9713b |
| 30-Apr-2005 |
Doug White <dwhite@FreeBSD.org> |
Implement an alternate method to stop CPUs when entering DDB. Normally we use a regular IPI vector, but this vector is blocked when interrupts are disabled. With "options KDB_STOP_NMI" and debug.kdb.
Implement an alternate method to stop CPUs when entering DDB. Normally we use a regular IPI vector, but this vector is blocked when interrupts are disabled. With "options KDB_STOP_NMI" and debug.kdb.stop_cpus_with_nmi set, KDB will send an NMI to each CPU instead. The code also has a context-stuffing feature which helps ddb extract the state of processes running on the stopped CPUs.
KDB_STOP_NMI is only useful with SMP and complains if SMP is not defined. This feature only applies to i386 and amd64 at the moment, but could be used on other architectures with the appropriate MD bits.
Submitted by: ups
show more ...
|
Revision tags: release/4.11.0_cvs, release/4.11.0 |
|
#
60727d8b |
| 07-Jan-2005 |
Warner Losh <imp@FreeBSD.org> |
/* -> /*- for license, minor formatting changes
|
Revision tags: release/5.3.0_cvs, release/5.3.0 |
|
#
293968d8 |
| 03-Sep-2004 |
Julian Elischer <julian@FreeBSD.org> |
ooops finish last commit. moved the variables but not the declarations.
|
#
82a1dfc1 |
| 03-Sep-2004 |
Julian Elischer <julian@FreeBSD.org> |
Move 4bsd specific experimental IP code into the 4bsd file. Move the sysctls into kern.sched
|
#
6804a3ab |
| 01-Sep-2004 |
Julian Elischer <julian@FreeBSD.org> |
Give the 4bsd scheduler the ability to wake up idle processors when there is new work to be done.
MFC after: 5 days
|
#
dd68efd0 |
| 28-Aug-2004 |
David E. O'Brien <obrien@FreeBSD.org> |
s/smp_rv_mtx/smp_ipi_mtx/g
Requested by: jhb
|
#
f1009e1e |
| 23-Aug-2004 |
Peter Wemm <peter@FreeBSD.org> |
Commit Doug White and Alan Cox's fix for the cross-ipi smp deadlock. We were obtaining different spin mutexes (which disable interrupts after aquisition) and spin waiting for delivery. For example,
Commit Doug White and Alan Cox's fix for the cross-ipi smp deadlock. We were obtaining different spin mutexes (which disable interrupts after aquisition) and spin waiting for delivery. For example, KSE processes do LDT operations which use smp_rendezvous, while other parts of the system are doing things like tlb shootdowns with a different mutex.
This patch uses the common smp_rendezvous mutex for all MD home-grown IPIs that spinwait for delivery. Having the single mutex means that the spinloop to aquire it will enable interrupts periodically, thus avoiding the cross-ipi deadlock.
Obtained from: dwhite, alc Reviewed by: jhb
show more ...
|
Revision tags: release/4.10.0_cvs, release/4.10.0 |
|
#
b2ae7ed7 |
| 27-Mar-2004 |
Marcel Moolenaar <marcel@FreeBSD.org> |
Change the type of the various CPU masks to cpumask_t. Note that as long as there are still explicit uses of int, whether in types or in function names (such as atomic_set_int() in sched_ule.c), we c
Change the type of the various CPU masks to cpumask_t. Note that as long as there are still explicit uses of int, whether in types or in function names (such as atomic_set_int() in sched_ule.c), we can not change cpumask_t to be anything other than u_int. See also the commit log for sys/sys/types.h, revision 1.84.
show more ...
|
Revision tags: release/5.2.1_cvs, release/5.2.1, release/5.2.0_cvs, release/5.2.0 |
|
#
b6c71225 |
| 03-Dec-2003 |
John Baldwin <jhb@FreeBSD.org> |
Fix all users of mp_maxid to use the same semantics, namely:
1) mp_maxid is a valid FreeBSD CPU ID in the range 0 .. MAXCPU - 1. 2) For all active CPUs in the system, PCPU_GET(cpuid) <= mp_maxid.
A
Fix all users of mp_maxid to use the same semantics, namely:
1) mp_maxid is a valid FreeBSD CPU ID in the range 0 .. MAXCPU - 1. 2) For all active CPUs in the system, PCPU_GET(cpuid) <= mp_maxid.
Approved by: re (scottl) Tested on: i386, amd64, alpha
show more ...
|
#
45c1c90f |
| 03-Dec-2003 |
John Baldwin <jhb@FreeBSD.org> |
Export a few SMP related symbols in UP kernels as well. This is needed to aid other kernel code, especially code which can be in a module such as the acpi_cpu(4) driver, to work properly with both S
Export a few SMP related symbols in UP kernels as well. This is needed to aid other kernel code, especially code which can be in a module such as the acpi_cpu(4) driver, to work properly with both SMP and UP kernels. The exported symbols include mp_ncpus, all_cpus, mp_maxid, smp_started, and the smp_rendezvous() function. This also means that CPU_ABSENT() is now always implemented the same on all kernels.
Approved by: re (scottl)
show more ...
|
#
798a4596 |
| 21-Nov-2003 |
John Baldwin <jhb@FreeBSD.org> |
- Split cpu_mp_probe() into two parts. cpu_mp_setmaxid() is still called very early (SI_SUB_TUNABLES - 1) and is responsible for setting mp_maxid. cpu_mp_probe() is now called at SI_SUB_CPU and
- Split cpu_mp_probe() into two parts. cpu_mp_setmaxid() is still called very early (SI_SUB_TUNABLES - 1) and is responsible for setting mp_maxid. cpu_mp_probe() is now called at SI_SUB_CPU and determines if SMP is actually present and sets mp_ncpus and all_cpus. Splitting these up allows an architecture to probe CPUs later than SI_SUB_TUNABLES by just setting mp_maxid to MAXCPU in cpu_mp_setmaxid(). This could allow the CPU probing code to live in a module, for example, since modules sysinit's in modules cannot be invoked prior to SI_SUB_KLD. This is needed to re-enable the ACPI module on i386. - For the alpha SMP probing code, use LOCATE_PCS() instead of duplicating its contents in a few places. Also, add a smp_cpu_enabled() function to avoid duplicating some code. There is room for further code reduction later since much of this code is also present in cpu_mp_start(). - All archs besides i386 still set mp_maxid to the same values they set it to before this change. i386 now sets mp_maxid to MAXCPU.
Tested on: alpha, amd64, i386, ia64, sparc64 Approved by: re (scottl)
show more ...
|
Revision tags: release/4.9.0_cvs, release/4.9.0 |
|
#
107902b8 |
| 29-Jun-2003 |
Jeff Roberson <jeff@FreeBSD.org> |
- Add structures for defining cpu topologies more complex than SMP. smp_topology may be left NULL by architectures which have vanilla SMP setups.
|
Revision tags: release/5.1.0_cvs, release/5.1.0, release/4.8.0_cvs, release/4.8.0, release/5.0.0_cvs, release/5.0.0, release/4.7.0_cvs, release/4.6.2_cvs, release/4.6.2, release/4.6.1, release/4.6.0_cvs |
|
#
0f33dc7b |
| 20-May-2002 |
Jake Burkholder <jake@FreeBSD.org> |
Forward declare struct thread.
|
#
752dff3d |
| 07-Mar-2002 |
Jake Burkholder <jake@FreeBSD.org> |
Add needed includes of machine/smp.h, remove nested include in sys/smp.h so that inlines in machine/smp.h can use variables declared in sys/smp.h.
|
#
88c99cfb |
| 05-Mar-2002 |
Jeff Roberson <jeff@FreeBSD.org> |
Add a new variable mp_maxid. This is used so that per cpu datastructures may be allocated as arrays indexed by the cpu id. Previously the only reliable way to know the max cpu id was through MAXCPU
Add a new variable mp_maxid. This is used so that per cpu datastructures may be allocated as arrays indexed by the cpu id. Previously the only reliable way to know the max cpu id was through MAXCPU. mp_ncpus isn't useful here because cpu ids may be sparsely mapped, although x86 and alpha do not do this.
Also, call cpu_mp_probe much earlier so the max cpu id is known before the VM starts up. This is intended to help support per cpu queues for the new allocator, but may be useful elsewhere.
Reviewed by: jake Approved by: jake
show more ...
|
Revision tags: release/4.5.0_cvs, release/4.4.0_cvs |
|
#
8b3e7871 |
| 31-Oct-2001 |
Marcel Moolenaar <marcel@FreeBSD.org> |
Make smp_started volatile in sys/smp.h and remove the volatile declaration in subr_smp.c. This solves a compile problem with gcc 3.0.1 (ia64 cross-build).
Reviewed: jhb
|
#
b40ce416 |
| 12-Sep-2001 |
Julian Elischer <julian@FreeBSD.org> |
KSE Milestone 2 Note ALL MODULES MUST BE RECOMPILED make the kernel aware that there are smaller units of scheduling than the process. (but only allow one thread per process at this time). This is fu
KSE Milestone 2 Note ALL MODULES MUST BE RECOMPILED make the kernel aware that there are smaller units of scheduling than the process. (but only allow one thread per process at this time). This is functionally equivalent to teh previousl -current except that there is a thread associated with each process.
Sorry john! (your next MFC will be a doosie!)
Reviewed by: peter@freebsd.org, dillon@freebsd.org
X-MFC after: ha ha ha ha
show more ...
|
#
bb6f838c |
| 01-Aug-2001 |
Bosko Milekic <bmilekic@FreeBSD.org> |
Move CPU_ABSENT() macro to smp.h, where it belongs anyway. It will be defined to 0 in the non-SMP case, which very much makes sense as it permits its usage in per-CPU initialization loops (for an exa
Move CPU_ABSENT() macro to smp.h, where it belongs anyway. It will be defined to 0 in the non-SMP case, which very much makes sense as it permits its usage in per-CPU initialization loops (for an example, check out subr_mbuf.c). Further, on a UP system, make mb_alloc always use the first per-CPU container, regardless of cpuid (i.e. remove reliability on cpuid in the UP case).
Requested by: alfred
show more ...
|
#
ba228f6d |
| 10-May-2001 |
John Baldwin <jhb@FreeBSD.org> |
- Split out the support for per-CPU data from the SMP code. UP kernels have per-CPU data and gdb on the i386 at least needs access to it. - Clean up includes in kern_idle.c and subr_smp.c.
Review
- Split out the support for per-CPU data from the SMP code. UP kernels have per-CPU data and gdb on the i386 at least needs access to it. - Clean up includes in kern_idle.c and subr_smp.c.
Reviewed by: jake
show more ...
|
#
6caa8a15 |
| 27-Apr-2001 |
John Baldwin <jhb@FreeBSD.org> |
Overhaul of the SMP code. Several portions of the SMP kernel support have been made machine independent and various other adjustments have been made to support Alpha SMP.
- It splits the per-proces
Overhaul of the SMP code. Several portions of the SMP kernel support have been made machine independent and various other adjustments have been made to support Alpha SMP.
- It splits the per-process portions of hardclock() and statclock() off into hardclock_process() and statclock_process() respectively. hardclock() and statclock() call the *_process() functions for the current process so that UP systems will run as before. For SMP systems, it is simply necessary to ensure that all other processors execute the *_process() functions when the main clock functions are triggered on one CPU by an interrupt. For the alpha 4100, clock interrupts are delievered in a staggered broadcast fashion, so we simply call hardclock/statclock on the boot CPU and call the *_process() functions on the secondaries. For x86, we call statclock and hardclock as usual and then call forward_hardclock/statclock in the MD code to send an IPI to cause the AP's to execute forwared_hardclock/statclock which then call the *_process() functions. - forward_signal() and forward_roundrobin() have been reworked to be MI and to involve less hackery. Now the cpu doing the forward sets any flags, etc. and sends a very simple IPI_AST to the other cpu(s). AST IPIs now just basically return so that they can execute ast() and don't bother with setting the astpending or needresched flags themselves. This also removes the loop in forward_signal() as sched_lock closes the race condition that the loop worked around. - need_resched(), resched_wanted() and clear_resched() have been changed to take a process to act on rather than assuming curproc so that they can be used to implement forward_roundrobin() as described above. - Various other SMP variables have been moved to a MI subr_smp.c and a new header sys/smp.h declares MI SMP variables and API's. The IPI API's from machine/ipl.h have moved to machine/smp.h which is included by sys/smp.h. - The globaldata_register() and globaldata_find() functions as well as the SLIST of globaldata structures has become MI and moved into subr_smp.c. Also, the globaldata list is only available if SMP support is compiled in.
Reviewed by: jake, peter Looked over by: eivind
show more ...
|
Revision tags: release/4.3.0_cvs, release/4.3.0 |
|
#
ca7ef17c |
| 10-Apr-2001 |
John Baldwin <jhb@FreeBSD.org> |
Remove the BETTER_CLOCK #ifdef's. The code is on by default and is here to stay for the foreseeable future.
OK'd by: peter (the idea)
|
#
48bed924 |
| 28-Jan-2001 |
Tor Egge <tegge@FreeBSD.org> |
Defer assignment of low level interrupt handlers for PCI interrupts described in the MP table until something asks for the interrupt number later on.
|