Any thought given to how processes interact when deciding what scheduler to assign them to?

Has there (is there) ever been any thought given to how processes interact with each other when deciding what scheduler to assign them to? Thinking of cache associativity vs maximizing concurrency etc.

2 Likes

We have talked loosely about it, but I don’t recall there having been any experiments trying it out. The best thing that we could do is probably to try to place processes that interact only with eachother in the same NUMA node. You don’t want to place them on the same scheduler/core as that might limit any parallelism.

One thing that is related that we’ve also considered is to allow a process to “share” its reductions with another process. Lets say we do a gen_server:call to a process, then if the receiving process is sleeping it could directly start executing and possibly send a response back to the sending process allowing it to continue. But that has fairness issues to consider and it is rather complicated to do a context-switch like that in ERTS so we have not tried to implement it yet.

8 Likes

Thank you for the reply.