cvs commit: src/sys/kern init_sysent.c syscalls.c systrace_args.c src/sys/sys syscall.h sysproto.h

Jeff Roberson jroberson at
Mon Mar 3 12:22:41 UTC 2008

On Mon, 3 Mar 2008, David Xu wrote:

> Jeff Roberson wrote:
>>> One question is how I can determine the size of cpuset the kernel is
>>> using ?
>> I wrote it to tolerate user masks that were much larger than the kernel 
>> mask.  I set the default CPU_SETSIZE in userspace to 128 and in kernel it's 
>> MAXCPU.  So in practice an application shouldn't have to redefine 
>> CPU_SETSIZE.  If your set is too small the kernel will return ERANGE 
>> however.  Unfortunately, if your set is larger than the kernel's 
>> CPU_MAXSIZE it'll also return ERANGE.  Maybe I should use different errnos 
>> for those cases.
> maybe the prototype of cpuset_getaffinity() can be changed to:
> int     cpuset_getaffinity(cpulevel_t, cpuwhich_t, id_t, int *cpusetsize, 
> cpuset_t *);
> if *cpusetsize is zero, kernel just writes out the actual size the
> kernel is using ?

I don't really see this as a problem.  I can define userspace to use 1024 
cpus by default and we would probably never need to concern ourselves with 
it.  After all 1024 cpus should be enough forever.. ;)

More information about the cvs-src mailing list