Re: SMP: bind process to cpu

From: Andrew Morton (andrewm@uow.edu.au)
Date: Sat Feb 17 2001 - 20:01:36 EST

  • Next message: Frank de Lange: "Re: reiserfs on 2.4.1,2.4.2-pre (with null bytes patch) breaks mozilla compile"

    Thomas Widmann wrote:
    > ...
    > * Andrew Morton wrote:
    >
    > > http://www.uow.edu.au/~andrewm/linux/#cpus_allowed
    > >
    > > 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
    purposes..

    -
    -
    To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
    the body of a message to majordomo@vger.kernel.org
    More majordomo info at http://vger.kernel.org/majordomo-info.html
    Please read the FAQ at http://www.tux.org/lkml/



    This archive was generated by hypermail 2b29 : Sat Feb 17 2001 - 19:57:11 EST