Re: NUMA API observations

From: Andi Kleen
Date: Mon Jun 14 2004 - 19:21:50 EST


On Mon, Jun 14, 2004 at 05:06:05PM -0700, Paul Jackson wrote:
> > I really dislike this error code [EINVAL] btw ...
>
> Then use others ??
>
> The way I learned Unix, decades ago, the tradition was to use a variety
> of errno values, even if they were a slightly strange fit, in order to
> provide more detailed error feedback. Look for example at the rename(2)
> or acct(2) system calls.

I tried to use creative errnos in the past (we have some
interesting unused ones from SYSV that can be abused like EADV
or EDOTDOT or ELIBBAD or EILSEQ), but Linus tends to reject
patches that use them. It wouldn't help here anyways, since
libnuma has to work with existing kernels. And changing the errno
now would probably break all user space workaround code people
have developed for this misfeature.

Best would be probably to fix the kernel to check that the
passed buffer is big enough for the highest running CPU,
And it should error out when there are bits set above
the cpumask limit (see the code in mm/mempolicy.c that
checks all this for node masks). I will cook up a patch for
this later.

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