Changeset View
Changeset View
Standalone View
Standalone View
share/man/man4/smp.4
Show All 17 Lines | |||||
.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) | .\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) | ||||
.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT | .\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT | ||||
.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY | .\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY | ||||
.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF | .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF | ||||
.\" SUCH DAMAGE. | .\" SUCH DAMAGE. | ||||
.\" | .\" | ||||
.\" $FreeBSD$ | .\" $FreeBSD$ | ||||
.\" | .\" | ||||
.Dd January 6, 2018 | .Dd November 23, 2018 | ||||
.Dt SMP 4 | .Dt SMP 4 | ||||
.Os | .Os | ||||
.Sh NAME | .Sh NAME | ||||
.Nm SMP | .Nm SMP | ||||
.Nd description of the FreeBSD Symmetric Multi-Processor kernel | .Nd description of the FreeBSD Symmetric Multi-Processor kernel | ||||
.Sh SYNOPSIS | .Sh SYNOPSIS | ||||
.Cd options SMP | .Cd options SMP | ||||
.Sh DESCRIPTION | .Sh DESCRIPTION | ||||
The | The | ||||
.Nm | .Nm | ||||
kernel implements symmetric multi-processor support. | kernel implements symmetric multi-processor support. | ||||
.Sh COMPATIBILITY | |||||
Support for multi-processor systems is present for all Tier-1 | |||||
architectures on | |||||
.Fx . | |||||
Currently, this includes amd64, i386 and sparc64. | |||||
Support is enabled using | |||||
.Cd options SMP . | |||||
It is permissible to use the SMP kernel configuration on non-SMP equipped | |||||
motherboards. | |||||
.Sh I386 NOTES | |||||
For i386 systems, the | |||||
.Nm | |||||
kernel supports motherboards that follow the Intel MP specification, | |||||
version 1.4. | |||||
In addition to | |||||
.Cd options SMP , | |||||
i386 also requires | |||||
.Cd device apic . | |||||
The | |||||
.Xr mptable 1 | |||||
command may be used to view the status of multi-processor support. | |||||
.Pp | .Pp | ||||
.Nm | .Nm | ||||
support can be disabled by setting the loader tunable | support can be disabled by setting the loader tunable | ||||
.Va kern.smp.disabled | .Va kern.smp.disabled | ||||
to 1. | to 1. | ||||
.Pp | .Pp | ||||
The number of CPUs detected by the system is available in | The number of CPUs detected by the system is available in | ||||
the read-only sysctl variable | the read-only sysctl variable | ||||
.Va hw.ncpu . | .Va hw.ncpu . | ||||
.Pp | .Pp | ||||
The number of threads per CPU core detected by the system is available in the | |||||
read-only sysctl variable | |||||
.Va kern.smp.smt_threads_online . | |||||
The number of physical CPU cores detected by the system is available in the | |||||
read-only sysctl variable | |||||
.Va hw.physicalcpu . | |||||
.Pp | |||||
.Fx | .Fx | ||||
allows specific CPUs on a multi-processor system to be disabled. | allows specific CPUs on a multi-processor system to be disabled. | ||||
This can be done using the | This can be done using the | ||||
.Va hint.lapic.X.disabled | .Va hint.lapic.X.disabled | ||||
tunable, where X is the APIC ID of a CPU. | tunable, where X is the APIC ID of a CPU. | ||||
Setting this tunable to 1 will result in the corresponding CPU being | Setting this tunable to 1 will result in the corresponding CPU being | ||||
disabled. | disabled. | ||||
.Pp | .Pp | ||||
.Fx | |||||
supports hyperthreading on the i386 and AMD64 platforms. | |||||
On these platforms, the logical CPUs can be disabled by setting the | |||||
.Va machdep.hyperthreading_allowed | |||||
tunable to zero. | |||||
.Pp | |||||
The | The | ||||
.Xr sched_ule 4 | .Xr sched_ule 4 | ||||
scheduler implements CPU topology detection and adjusts the scheduling | scheduler implements CPU topology detection and adjusts the scheduling | ||||
algorithms to make better use of modern multi-core CPUs. | algorithms to make better use of modern multi-core CPUs. | ||||
The sysctl variable | The sysctl variable | ||||
.Va kern.sched.topology_spec | .Va kern.sched.topology_spec | ||||
reflects the detected CPU hardware in a parsable XML format. | reflects the detected CPU hardware in a parsable XML format. | ||||
The top level XML tag is <groups>, which encloses one or more <group> tags | The top level XML tag is <groups>, which encloses one or more <group> tags | ||||
Show All 32 Lines | <children> | ||||
</group> | </group> | ||||
</children> | </children> | ||||
</group> | </group> | ||||
</groups> | </groups> | ||||
.Ed | .Ed | ||||
.Pp | .Pp | ||||
This information is used internally by the kernel to schedule related | This information is used internally by the kernel to schedule related | ||||
tasks on CPUs that are closely grouped together. | tasks on CPUs that are closely grouped together. | ||||
.Pp | .Sh COMPATIBILITY | ||||
.Fx | Support for multi-processor systems is present for all Tier-1 | ||||
supports hyperthreading on Intel CPU's on the i386 and AMD64 platforms. | architectures on | ||||
Because using logical CPUs can cause performance penalties under certain loads, | .Fx . | ||||
the logical CPUs can be disabled by setting the | Currently, this includes amd64, i386 and sparc64. | ||||
.Va machdep.hyperthreading_allowed | Support is enabled using | ||||
tunable to zero. | .Cd options SMP . | ||||
It is permissible to use the SMP kernel configuration on non-SMP equipped | |||||
motherboards. | |||||
.Sh I386 NOTES | |||||
For i386 systems, the | |||||
.Nm | |||||
kernel supports motherboards that follow the Intel MP specification, | |||||
version 1.4. | |||||
In addition to | |||||
.Cd options SMP , | |||||
i386 also requires | |||||
.Cd device apic . | |||||
The | |||||
.Xr mptable 1 | |||||
command may be used to view the status of multi-processor support. | |||||
.Sh SEE ALSO | .Sh SEE ALSO | ||||
.Xr cpuset 1 , | .Xr cpuset 1 , | ||||
.Xr mptable 1 , | .Xr mptable 1 , | ||||
.Xr sched_4bsd 4 , | .Xr sched_4bsd 4 , | ||||
.Xr sched_ule 4 , | .Xr sched_ule 4 , | ||||
.Xr loader 8 , | .Xr loader 8 , | ||||
.Xr sysctl 8 , | .Xr sysctl 8 , | ||||
.Xr condvar 9 , | .Xr condvar 9 , | ||||
Show All 21 Lines | |||||
reference source code from the fine-grained SMP implementation found | reference source code from the fine-grained SMP implementation found | ||||
in | in | ||||
.Bsx . | .Bsx . | ||||
.Pp | .Pp | ||||
.Fx 5.0 | .Fx 5.0 | ||||
also introduced support for SMP on the sparc64 architecture. | also introduced support for SMP on the sparc64 architecture. | ||||
.Sh AUTHORS | .Sh AUTHORS | ||||
.An Steve Passe Aq Mt fsmp@FreeBSD.org | .An Steve Passe Aq Mt fsmp@FreeBSD.org | ||||
.Sh CAVEATS | |||||
The | |||||
.Va kern.smp.smt_threads_online | |||||
and | |||||
.Va hw.physicalcpu | |||||
sysctl variables are provided as a best-effort guess. | |||||
If an architecture adds SMT and | |||||
.Fx | |||||
has not yet implemented detection, the reported values may be inaccurate. | |||||
In this case, | |||||
.Va kern.smp.smt_threads_online | |||||
will report | |||||
.Dv 1 | |||||
and | |||||
.Va hw.physicalcpu | |||||
will report the same value as | |||||
.Va hw.ncpu . |