> pid_t enforce_launch_policy_fork() {
> pid_t pp = fork();
> if (pp == 0) {
> set_affinity(getpid(), get_affinity());
> ...
> }
> return pp;
> }
>
> but, as soon as one of them exec()'s their no longer going to be using your
> functions.
That's the point, cpus_allowed is automatically inherited by the child in
kernel/fork.c
So once you spawn a child with the proposed function, all its dinasty (
if it's not explicitly changed ) will have the same cpu affinity.
- Davide
-
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/