Messages in this thread | | | Date | Mon, 14 Jun 2004 14:21:28 -0700 | From | Paul Jackson <> | Subject | Re: NUMA API observations |
| |
Andi wrote: > How should a user space application sanely discover the cpumask_t > size needed by the kernel? Whoever designed that was on crack. > > 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.
I posted a piece of code that gets a usable upper bound on cpumask_t size, suitable for application code to size mask buffers to be used in these system calls.
See the lkml article:
http://groups.google.com/groups?selm=fa.hp225re.1v68ei0%40ifi.uio.no
Or search in google groups for "cpumasksz".
This article was posted:
Date: 2004-06-04 09:20:13 PST
in a long thread under the Subject of:
[PATCH] cpumask 5/10 rewrite cpumask.h - single bitmap based implementation
Feel free to steal it, or to ignore it, if you find it easier to write your version than to read mine.
-- I won't rest till it's the best ... Programmer, Linux Scalability Paul Jackson <pj@sgi.com> 1.650.933.1373 - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
| |