605
605
SMP support enabled (see the <seealso marker="#smp">-smp</seealso>
608
<tag><c><![CDATA[+sFlag Value]]></c></tag>
610
<p>Scheduling specific flags.</p>
612
<tag>+sbt BindType</tag>
614
<marker id="+sbt"></marker>
615
<p>Set scheduler bind type. Currently valid <c>BindType</c>s:
620
<seealso marker="erlang#system_flag_scheduler_bind_type">erlang:system_flag(scheduler_bind_type, unbound)</seealso>.
624
<seealso marker="erlang#system_flag_scheduler_bind_type">erlang:system_flag(scheduler_bind_type, no_spread)</seealso>.
628
<seealso marker="erlang#system_flag_scheduler_bind_type">erlang:system_flag(scheduler_bind_type, thread_spread)</seealso>.
632
<seealso marker="erlang#system_flag_scheduler_bind_type">erlang:system_flag(scheduler_bind_type, processor_spread)</seealso>.
634
<tag><c>nnts</c></tag>
636
<seealso marker="erlang#system_flag_scheduler_bind_type">erlang:system_flag(scheduler_bind_type, no_node_thread_spread)</seealso>.
638
<tag><c>nnps</c></tag>
640
<seealso marker="erlang#system_flag_scheduler_bind_type">erlang:system_flag(scheduler_bind_type, no_node_processor_spread)</seealso>.
642
<tag><c>tnnps</c></tag>
644
<seealso marker="erlang#system_flag_scheduler_bind_type">erlang:system_flag(scheduler_bind_type, thread_no_node_processor_spread)</seealso>.
648
<seealso marker="erlang#system_flag_scheduler_bind_type">erlang:system_flag(scheduler_bind_type, default_bind)</seealso>.
651
<p>Binding of schedulers are currently only supported on newer
652
Linux and Solaris systems.</p>
653
<p>If no CPU topology is available when the <c>+sbt</c> flag
654
is processed and <c>BindType</c> is any other type than
655
<c>u</c>, the runtime system will fail to start. CPU
656
topology can be defined using the
657
<seealso marker="#+sct">+sct</seealso> flag. Note
658
that the <c>+sct</c> flag may have to be passed before the
659
<c>+sbt</c> flag on the command line (in case no CPU topology
660
has been automatically detected).</p>
661
<p>For more information, see
662
<seealso marker="erlang#system_flag_scheduler_bind_type">erlang:system_flag(scheduler_bind_type, SchedulerBindType)</seealso>.
665
<tag><c>+sct CpuTopology</c></tag>
667
<marker id="+sct"></marker>
668
<list type="bulleted">
669
<item><c><![CDATA[<Id> = integer(); when 0 =< <Id> =< 65535]]></c></item>
670
<item><c><![CDATA[<IdRange> = <Id>-<Id>]]></c></item>
671
<item><c><![CDATA[<IdOrIdRange> = <Id> | <IdRange>]]></c></item>
672
<item><c><![CDATA[<IdList> = <IdOrIdRange>,<IdOrIdRange> | <IdOrIdRange>]]></c></item>
673
<item><c><![CDATA[<LogicalIds> = L<IdList>]]></c></item>
674
<item><c><![CDATA[<ThreadIds> = T<IdList> | t<IdList>]]></c></item>
675
<item><c><![CDATA[<CoreIds> = C<IdList> | c<IdList>]]></c></item>
676
<item><c><![CDATA[<ProcessorIds> = P<IdList> | p<IdList>]]></c></item>
677
<item><c><![CDATA[<NodeIds> = N<IdList> | n<IdList>]]></c></item>
678
<item><c><![CDATA[<IdDefs> = <LogicalIds><ThreadIds><CoreIds><ProcessorIds><NodeIds>]]></c></item>
679
<item><c><![CDATA[CpuTopology = <IdDefs>:<IdDefs> | <IdDefs>]]></c></item>
681
<p>Upper-case letters signify real identifiers and lower-case
682
letters signify fake identifiers only used for description
683
of the topology. Identifiers passed as real identifiers may
684
be used by the runtime system when trying to access specific
685
hardware and if they are not correct the behavior is
686
undefined. Faked logical CPU identifiers are not accepted
687
since there is no point in defining the CPU topology without
688
real logical CPU identifiers. Thread, core, processor, and
689
node identifiers may be left out. If left out, thread id
690
defaults to <c>t0</c>, core id defaults to <c>c0</c>,
691
processor id defaults to <c>p0</c>, and node id will
692
be left undefined. Either all processors or no processors
693
should have node identifiers defined.
695
<p>Both increasing and decreasing <c><![CDATA[<IdRange>]]></c>s
697
<p>NUMA node identifiers are system wide. That is, each NUMA
698
node on the system have to have a unique identifier. Processor
699
identifiers are also system wide. Core identifiers are
700
processor wide. Thread identifiers are core wide.</p>
701
<p>The order of the identifier types imply the hierarchy of the
702
CPU topology. Currently, the only valid order is: logical,
703
thread, core, processor, node. That is, thread is part of a
704
core which is part of a processor which is part of a NUMA
705
node. This will, however, change in the future, since multiple
706
NUMA nodes can be part of a processor, but this is not
709
<p>If a list of identifiers is used in an
710
<c><![CDATA[<IdDefs>]]></c>:</p>
711
<list type="bulleted">
712
<item><c><![CDATA[<LogicalIds>]]></c> have to be a list
713
of identifiers.</item>
714
<item>At least one other identifier type apart from
715
<c><![CDATA[<LogicalIds>]]></c> also have to have a
716
list of identifiers.</item>
717
<item>All lists of identifiers have to produce the
718
same amount of identifiers.</item>
720
<p>A simple example. A single quad core processor may be
721
described this way:</p>
723
% <input>erl +sct L0-3c0-3</input>
724
1> <input>erlang:system_info(cpu_topology).</input>
725
[{processor,[{core,{logical,0}},
728
{core,{logical,3}}]}]
730
<p>A little more complicated example. Two quad core
731
processors. Each processor in its own NUMA node.
732
The ordering of logical processors is a little weird.
733
This in order to give a better example of identifier
736
% <input>erl +sct L0-1,3-2c0-3p0N0:L7,4,6-5c0-3p1N1</input>
737
1> <input>erlang:system_info(cpu_topology).</input>
738
[{node,[{processor,[{core,{logical,0}},
741
{core,{logical,2}}]}]},
742
{node,[{processor,[{core,{logical,7}},
745
{core,{logical,5}}]}]}]
747
<p>As long as real identifiers are correct it is okay
748
to pass a CPU topology that is not a correct
749
description of the CPU topology. When used with
750
care this can actually be very useful. This in
751
order to trick the emulator to bind its schedulers
752
as you want. For example, if you want to run multiple
753
Erlang runtime systems on the same machine, you
754
want to reduce the amount of schedulers used and
755
manipulate the CPU topology so that they bind to
756
different logical CPUs. An example, with two Erlang
757
runtime systems on a quad core machine:</p>
759
% <input>erl +sct L0-3c0-3 +sbt db +S3:2 -detached -noinput -noshell -sname one</input>
760
% <input>erl +sct L3-0c0-3 +sbt db +S3:2 -detached -noinput -noshell -sname two</input>
762
<p>In this example each runtime system have two
763
schedulers each online, and all schedulers online
764
will run on different cores. If we change to one
765
scheduler online on one runtime system, and three
766
schedulers online on the other, all schedulers
767
online will still run on different cores.</p>
768
<p>Note that a faked CPU topology that does not reflect
769
how the real CPU topology looks like is likely to
770
decrease the performance of the runtime system.</p>
771
<p>For more information, see
772
<seealso marker="erlang#system_flag_cpu_topology">erlang:system_flag(cpu_topology, CpuTopology)</seealso>.</p>
608
776
<tag><c><![CDATA[+T Level]]></c></tag>
610
778
<marker id="+T"></marker>