Limiting number of cores from 4 to 2 on Tegra3 system (for performance testing)

How to use only 2 (out of 4) cores of the Tegra3 system?
I am using Linux/Ubuntu11.04 on CARMA/CUDA devboard (from "").
On other systems with CONFIG_HOTPLUG_CPU=y (the case of the kernel on my Tegra3 system)
I can shutdown a CPU by, for example,
echo 0 > /sys/devices/system/cpu/cpu2/online
But here I get the following error message:
bash: echo: write error: Device or resource busy

Any other possibilities to restrict the number of cores to 2?
I think modifying the boot options and using, say, "maxcpus=2"
or "isolcpus=2,3" should work as well.
But then, how can I modify the boot options for the board?


Well, the good hint was in the Topic entitled “SMP or IRQ affinity support”:
The culprit of the problems with setting CPUs on- or off-line was the ‘auto_hotplug’
parameter, available for resetting at /sys/module/cpu_tegra3/parameters.

The following sequence works as I expected on systems with CONFIG_HOTPLUG_CPU=y
echo 0 > /sys/module/cpu_tegra3/parameters/auto_hotplug

Set the CPU1 online:
cat /sys/devices/system/cpu/cpu1/online
… if it is 1, leave it without change; if it is 0, set it online with
echo 1 > /sys/devices/system/cpu/cpu1/online

Set the CPU2 and CPU3 offline:
case /sys/devices/system/cpu/cpu2/online
… if it is 0, leave it without change; if it is 1, set it offline with
echo 0 > /sys/devices/system/cpu/cpu2/online
… repeat the above for CPU3

Then just the CPU0 and CPU1 will be online, ready for my performance tests.

Thanks for the hint from the other Topic!