Nathan wrote:
> Task finishes work and does sched_setaffinity(saved_mask).
Stupid task. If task wants to run on -all- cpus on a
hotplug system, task should not pass a saved mask, but
rather construct a mask with all bits set and pass that:
cpu_set_t mask;
unsigned int i;
/* set all bits in mask - code totally untested */
for (i = 0; i < sizeof(cpu_set_t) / sizeof (__cpu_mask); i++)
mask.__bits[i] = ~0;
sched_setaffinity(&mask);
Similar problems exist for a task running in a cpuset under
migration. Saved masks are useless in all but static systems,
having no migration, no hotplug.
That, or use a library on top of this that lets the task work
with relative (to whatever is available) CPU and (for the
mbind/mempolicy calls) Memory Node numbers and that handles
the above details. If all goes well, I should be releasing
such a library in the not distant future.
--
I won't rest till it's the best ...
Programmer, Linux Scalability
Paul Jackson <[email protected]> 1.925.600.0401
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
[Index of Archives]
[Kernel Newbies]
[Netfilter]
[Bugtraq]
[Photo]
[Stuff]
[Gimp]
[Yosemite News]
[MIPS Linux]
[ARM Linux]
[Linux Security]
[Linux RAID]
[Video 4 Linux]
[Linux for the blind]
[Linux Resources]