> Can't You achieve the same by coding a :
>
> pid_t affine_fork(int cpumask) {
> pid_t pp = fork();
> if (pp == 0) {
> set_affinity(getpid(), cpumask);
> ...
> }
> return pp;
> }
>
> in your application and having the default bahavior to propagate it to the
> following fork()s.
you could do that, but that means you have to keep track of the cpumask
somewhere.
i suppose you could force your children to:
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.
By making it a default part of fork's behavior, processes naturally end up
where they're
supposed to be. And the default launch_policy if 0xffffffff, so unless you
purposely
change launch_policy, the old default behavior (run wherever you can) is
preserved.
>
> > +int proc_pid_cpus_allowed_read(struct task_struct *task, char * buffer)
> ^^^^^^^^^^^^^^^^^^^^^^^^^^
> You want Al Viro screaming, don't You ? :)
>
> - Davide
If that is the biggest complaint about the patch, then I'll be quite happy
with some yelling and screaming about descriptive function names! ;)
Cheers!
-matt
>
> -
> 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/
-
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/