Re: SMP: bind process to cpu

From: Andrew Morton (
Date: Sat Feb 17 2001 - 20:01:36 EST

Thomas Widmann wrote:
> ...
> * Andrew Morton wrote:
> >
> >
> > You just write a bitmask into it.
> Thanks for this information. I patched my the kernel with it.
> After rebooting with the new kernel i can see the bitmask
> for every process running on my server.
> #cat /proc/1310/cpus_allowed
> ffffffff
> Now, if i want to run this process on only one cpu, i which way
> do i have to set the bitmask ?
> Let's say, i want to run it on cpu0. how look's the bitmask ?

Each bit corresponds to a logical CPU on which the task
is permitted to run. So 1->CPU0, 2->CPU1, 5->CPU0+CPU2, etc.

But it does seem there are problems with the scheduler
which occur when cpus_allowed it not all-ones. I didn't
observe any problems in the 1-2 hours testing which I
needed that patch for, so it should be OK for experimentation

To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to
More majordomo info at
Please read the FAQ at

This archive was generated by hypermail 2b29 : Fri Feb 23 2001 - 21:00:16 EST