Presumably you're doing this to own that CPU exclusively.
Hooking at cpu_idle is not very useful then because interrupts will be
already enabled and the system participate in IPIs etc, so you can't
simply disable them, the others will miss them.
You would rather need to prevent them from being started in the
first place, e.g. by exluding them with maxcpus=..
A better alternative might be to use isolcpus=... and schedule
a standard program.
-Andi
--
ak@linux.intel.com -- Speaking for myself only.
--