[erlang-questions] Why system_flag(scheduler_bind_type) is deprecated?

Rickard Green <>
Tue Jan 8 13:57:49 CET 2013


On Jan 8, 2013, at 1:04 PM, "Angel J. Alvarez Miguel" <> wrote:

> On Martes, 8 de Enero de 2013 12:08:41 Jesper Louis Andersen escribió:
>> On Jan 8, 2013, at 12:04 PM, Max Lapshin <> wrote:
>>> If erlyvideo is launched without +sbt spread flag, it looses packets from
>>> UDP because too many tasks are on one core. There are some erlang
>>> distributions (OS X, ubuntu package, some others) that are just halting
>>> if you pass +sbt flag. So I can't write proper init script that passes
>>> this flag or don't pass.
>> 
>> I think Rickard already said he would implement a "silent failure" flag for
>> this, so you could do something like
>> 
>> erl +sbt db +sat-ignore-failure
> 
> This seems to be a good falloff, here we use scritptized rebars deployments 
> for our projects and this fits very well to be included in the 
> escript_emu_args variable... provided the user cant change default vm args per 
> se
> 
>> 
>> and have it work on, say, OSX because it would silently disable the flag.
>> As you say, +sbt has too much of an impact in the real world to be ignored
>> for certain types of load, so I still like the default of refusing to
>> start if the bind type can't be satisfied.
>> 
>> Jesper Louis Andersen
>>  Erlang Solutions Ltd., Copenhagen
>> 

I'll add an +stbt ("try bind type") switch that will do the same thing as +sbt, but if it fails this will silently be ignored and the runtime will be started anyway. I can add the +stbt switch to r16. The change will be quite simple, so I guess that it should be quite easy to apply the change on the r15b03 source if you want to.

Regarding support for automatic detection of cpu-topology and binding of schedulers. I think this is an area really suitable for user contributions. Since the APIs that need to be used often differ between OSes and sometimes also between hardware architectures on the same OS, we will never have the time to implement support for this on all platforms users are interested in. Therefore, user contributions implementing this on various platforms are much appreciated (other contributions are of course also appreciated).

If +sbt fails on a newer Linux, the problem is most likely that no cpu-topology were automatically detected. On Linux, the runtime tries to detect this by inspecting the /sys filesystem. The content under /sys/devices/system/{cpu,node} varies quite a lot depending on hw arch. Sometimes there aren't enough info there to determine the topology, but it could also be that the information is just formatted another way than we expected.

Detection of cpu-topology and binding of threads to logical processors are implemented in $ERL_TOP/erts/lib_src/common/erl_misc_utils.c

Regards,
Rickard Green, Erlang/OTP, Ericsson AB


More information about the erlang-questions mailing list