[lkml]   [2006]   [Jan]   [28]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
SubjectRe: 2.6.16 - sys_sched_getaffinity & hotplug
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;


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 <> 1.925.600.0401
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

 \ /
  Last update: 2006-01-28 21:10    [W:0.057 / U:5.916 seconds]
©2003-2018 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site