2

I am using some RaspberryPI boards for a data acquisition system. They are nice boards, with plenty of community support around them, but they are really slow. I am thinking of gradually replacing them with ODROID multicore boards, with the Samsung Exynos processors.

I have some experience using taskset to set CPU affinity on my servers because I am always running Node.js applications that are by definition single threaded.

Now, is it possible to do this on an ARM board? I do not see why it would not in theory, but I have doubts over how well it is going to work.

Does anyone have experience with this kind of hack? Also, I would appreciate any comments about ARM CPUs and how they differ from x86.

3
  • Why would you want to do this? It just reduces the scheduler's flexibility. Oct 28, 2013 at 18:28
  • @DavidSchwartz If you can explain why this is a bad idea and I should run everything normaly, please do post an answer.
    – dlyk1988
    Oct 28, 2013 at 18:43
  • There's no much to explain. All this does is remove an option from the scheduler, an option the scheduler would only use if it judged it to be beneficial. So why do it? (Perhaps this is that special case where you really do know something unusual that the scheduler doesn't. But nothing in the question suggests that.) Oct 28, 2013 at 18:44

2 Answers 2

1

Yes, it's possible.
taskset is an operating system level function: it doesn't matter what CPU architecture you're using (within reason), you're just telling the kernel where it can and can't run things.

The differences between ARM and x86 are largely immaterial here, so I won't get into them in any level of detail (though you should be aware of them and their implications for your particular use case -- this is a research project for you in your spare time).


No, you should not do this.
Do not try to outsmart the scheduler.
The scheduler is smarter than you think it is.
In most cases, the scheduler is smarter than you are.

The scheduler was designed by people who fully understand the operating system's internals. These people have lots of real-world experience optimizing systems, and they've poured that experience (along with no small amount of blood, sweat, tears, and profanity) into your operating system's scheduler algorithm.

As David said, using taskset or other tools to manually force affinity (or any other scheduler settings) may make sense if and only if you know for a fact that your situation is "special" and the scheduler will do the Wrong Thing if left to its own devices.
These are surgical tools designed for very specific, very narrow sets of circumstances.
Using the tools incorrectly will wind up killing people hurting performance.

2

because I am always running Node.js applications that are by definition single threaded

erm....not sure of taskset is really the ideal solution. Certainly there's an advantage to keeping a task associated with the same l2 cache - if you're using the CFS then setting a higher value for sched_migration_cost might be more appropriate.

AFAIK there should be no difference between ARM and Intel chips for taskset (or other scheduling stuff, with the obvious exception of hyper-threading). But I've not played around hacking multi-core ARMs.

1
  • For @dsljanus' benefit, the important thing to bear in mind is that the scheduler already knows there's a benefit to keeping tasks associated with the same L2 cache & core (avoiding possible cache invalidations). There are some knobs you can turn to tell it how much it "hurts" to move an application, but given a system that isn't saturated ( load average <= (nCores - 1) ) it's probably a total non-issue
    – voretaq7
    Oct 29, 2013 at 15:14

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .