Just a couple of notes:
- The way you set the cpu_set_t mask looks correct.
- Any reason why you redefine / copy-paste the CPU_ macros and don't just include sched.h?
- Ditto for syscall(_NR_SCHED...) Just use sched_setaffinity. (Note the full path to the header you need it is: ./third_party/android_tools/ndk/platforms/android-14/arch-arm/usr/include/sched.h, which should be already in your include path)
- sched_setaffinity is still per-thread, not per process. The full story is a bit longer... these days you should use pthread_setaffinity_np if you use the pthread interface (who doesn't?), but at a first glance that is not available in the ndk (nor I could find any trace in the Android AOSP bionic libc). sched_setaffinity should do its job, but remember that you have to call it before spawning any other thread (if you want the other threads to inherit the cpu mask), or you have to repeat the call on any thread previously spawned to achieve the same. For the renderer process, a good place should be very early in content/renderer/renderer_main.cc.
- You can doublecheck that your call had effect by looking at the output of adb shell cat /proc/PID/status | grep Cpus_allowed
- If you see the renderer running on other processors and you are 100% sure that the syscall did succeed, probably you just called it too late and other threads are still unbounded.
Cheers,
Primiano