Re: NUMA API observations

From: Andi Kleen
Date: Tue Jun 15 2004 - 06:04:20 EST


On Tue, Jun 15, 2004 at 06:59:57AM +0200, Manfred Spraul wrote:
> >
> >
> >>I will probably make it loop and double the buffer until EINVAL
> >>ends or it passes a page and add a nasty comment.
> >
> >I agree that a loop is needed. And yes someone didn't do a very
> >good job of designing this interface.
> >
> >
> >
> What about fixing the interface instead? For example if user_mask_ptr
> NULL, then sys_sched_{get,set}affinity return the bitmap size.

Or maybe just a sysctl. But it doesn't really help because
applications have to work with older kernels. I think
cpumask_t is more an kernel internal implementation detail
and should not really be exposed to user space, so
it's better not to do the sysctl neither.

However the clear bugs in the kernel API that should be fixed:
- It should EINVAL for bits set above cpumask_t
- It should not EINVAL as long as the passed in mask
covers all online CPUs.

-Andi
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/