From owner-svn-src-all@FreeBSD.ORG Wed Oct 27 11:18:39 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 1A0FD106566C; Wed, 27 Oct 2010 11:18:39 +0000 (UTC) (envelope-from rwatson@FreeBSD.org) Received: from cyrus.watson.org (cyrus.watson.org [65.122.17.42]) by mx1.freebsd.org (Postfix) with ESMTP id E67A18FC0C; Wed, 27 Oct 2010 11:18:38 +0000 (UTC) Received: from fledge.watson.org (fledge.watson.org [65.122.17.41]) by cyrus.watson.org (Postfix) with ESMTPS id 8CECD46B06; Wed, 27 Oct 2010 07:18:38 -0400 (EDT) Date: Wed, 27 Oct 2010 12:18:38 +0100 (BST) From: Robert Watson X-X-Sender: robert@fledge.watson.org To: David Xu In-Reply-To: <4CC80ABA.3080404@freebsd.org> Message-ID: References: <201010270232.o9R2Wsu3084553@svn.freebsd.org> <4CC803A8.3040602@freebsd.org> <4CC80ABA.3080404@freebsd.org> User-Agent: Alpine 2.00 (BSF 1167 2008-08-23) MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, Garrett Cooper Subject: Re: svn commit: r214409 - head/sys/kern X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 27 Oct 2010 11:18:39 -0000 On Wed, 27 Oct 2010, David Xu wrote: >>> I really hate to see such a problem that userland can not figure out what >>> kernel is using, I try hardly to guess, but still can not find what it is >>> using. yes, I think the doc may need to be fixed or another syscall is >>> needed. >> >> Well... Jeff's code in cpuset(1) does some trivial sizeof(mask) 's, but >> it just passes in cpuset_t for mask. I've seen different calling >> conventions at the kernel level when I tried to get my brain in sync with >> that for a bug I was looking at a few weeks ago (and sadly, failed to some >> degree). >> These syscalls are a bit confusing though, and apart from cpuset(1) >> there aren't any really good examples in the sourcebase on how to use them >> (at least not the last time I checked)... Thanks, -Garrett >> > The problem is that the size of cpuset is not fixed, it is tunable by the > recompiling kernel with different parameter, so if you have a program which > you want to adapt it to use any size of cpuset, it should be able to get the > size the kernel is using, if you don't have source code of the program, you > can not compile it with new parameter, then there is trouble. Yay, it's fd_set all over again :-). It sounds like we might just need to add a sysctl and a few wrapper functions in userspace along the lines of (hand-wave): cpuset_t *cpuset_alloc(); void cpuset_free(); And perhaps some sort of API that abstracts manipulation of the set (or doesn't but allows the user to easily query its bounds). Robert