linux scheduling vs os x?

195 views
Skip to first unread message

Erik Svensson

unread,
Oct 27, 2015, 3:08:47 PM10/27/15
to mechanica...@googlegroups.com
I've recently noted that os x and linux seems to do thread scheduling differently. running our app on linux, we see one core working 100% and the rest sporadically. on osx (that seems to have better throughput) all cores are working 100%. what causes this? which one is 'best', which one uses the hw best? it would seem that is os x does but i'm no expert.

cheers
erik

Sent from my iPhone

Vitaly Davidovich

unread,
Oct 27, 2015, 3:51:53 PM10/27/15
to mechanical-sympathy
Does your app have concurrently runnable threads? And if so, you're saying on linux they're all running on just 1 core? It sounds like it based on your osx description, but just wanted to confirm.  Are you taskset'ing or doing anything programatically to set affinity?

Generally speaking, the "best" schedule for a task (i.e. thread) is to keep it on the same cpu (modulo contention on it i.e. if there're other cpus available when the task is runnable and `last` cpu is unavailable, run it elsewhere).  Basically, you want to avoid bouncing a task across cpus, particularly across sockets/numa nodes.


--
You received this message because you are subscribed to the Google Groups "mechanical-sympathy" group.
To unsubscribe from this group and stop receiving emails from it, send an email to mechanical-symp...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Erik Svensson

unread,
Oct 27, 2015, 4:22:59 PM10/27/15
to mechanica...@googlegroups.com
Yes, there are several concurrent runnable  threads. On linux they are not, as far as I can tell, running on just one core but they seem to be idle more than they should. We are not doing anything vis a vis thread affinity or something like that. We are running the linux in a virtual env so I don’t know how much difference it would make.
I will check more thoroughly tomorrow about where the threads are actually running.

Cheers
/Erik

singh.janmejay

unread,
Oct 28, 2015, 2:33:29 AM10/28/15
to mechanica...@googlegroups.com

In a virtual-env, number of vCPUs, their affinity, how interrupts are processed across cores, what events generate a pv/hyper-call etc would matter a lot. It's really not apples to apples.

The best way to compare behavior would be to run it on a Linux box with similar configuration(not virtualized).

--
Regards,
Janmejay

PS: Please blame the typos in this mail on my phone's uncivilized soft keyboard sporting it's not-so-smart-assist technology.
   

Reply all
Reply to author
Forward
0 new messages