From owner-freebsd-emulation@FreeBSD.ORG Wed Mar 5 01:50:51 2008 Return-Path: Delivered-To: emulation@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 41E41106566B; Wed, 5 Mar 2008 01:50:51 +0000 (UTC) (envelope-from jroberson@chesapeake.net) Received: from webaccess-cl.virtdom.com (webaccess-cl.virtdom.com [216.240.101.25]) by mx1.freebsd.org (Postfix) with ESMTP id 035A98FC1C; Wed, 5 Mar 2008 01:50:50 +0000 (UTC) (envelope-from jroberson@chesapeake.net) Received: from [192.168.1.107] (cpe-24-94-75-93.hawaii.res.rr.com [24.94.75.93]) (authenticated bits=0) by webaccess-cl.virtdom.com (8.13.6/8.13.6) with ESMTP id m251ohvh022158; Tue, 4 Mar 2008 20:50:49 -0500 (EST) (envelope-from jroberson@chesapeake.net) Date: Tue, 4 Mar 2008 15:53:08 -1000 (HST) From: Jeff Roberson X-X-Sender: jroberson@desktop To: Roman Divacky In-Reply-To: <20080303121025.K920@desktop> Message-ID: <20080304155205.X920@desktop> References: <20080302110130.GA30563@freebsd.org> <20080303022202.S920@desktop> <20080303144152.GA47887@freebsd.org> <20080303121025.K920@desktop> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed Cc: emulation@freebsd.org, jeff@freebsd.org Subject: Re: [PATCH] linux get affinity syscall X-BeenThere: freebsd-emulation@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Development of Emulators of other operating systems List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 05 Mar 2008 01:50:51 -0000 On Mon, 3 Mar 2008, Jeff Roberson wrote: > > On Mon, 3 Mar 2008, Roman Divacky wrote: > >> On Mon, Mar 03, 2008 at 02:23:49AM -1000, Jeff Roberson wrote: >>> >>> On Sun, 2 Mar 2008, Roman Divacky wrote: >>> >>>> hi.. >>>> >>>> jeff commited his cpu set and I tried to map that to linuxulator >>>> version of linux_sched_getaffinity(), the current (untested) code >>>> looks like this: >>>> >>>> /* >>>> * Get affinity of a process >>>> */ >>>> int >>>> linux_sched_getaffinity(struct thread *td, >>>> struct linux_sched_getaffinity_args *args) >>>> { >>>> int error; >>>> struct cpuset_getaffinity_args cga; >>>> >>>> if (args->len < sizeof(cpumask_t)) >>>> return (EINVAL); This should not be necessary anymore. >>> >>> Len here is in number of bits I believe as it is for our cpusetsize. >> >> no.. its specified in bytes > > You are right. So it is with fdsets. Please hold on and I'll change cpuset > to be bytes as well. > >> >>>> >>>> cga.level = CPU_LEVEL_WHICH; >>>> cga.which = CPU_WHICH_PID; >>>> cga.id = args->pid; >>>> cga.cpusetsize = sizeof(cpumask_t) * NBBY; >>>> cga.mask = (long *) args->user_mask_ptr; >>> I checked in a change to make our cpusetsize compatible. You should only have to supply CPU_LEVEL_WHICH and CPU_WHICH_PID now. The rest of the arguments are compatible. Thanks! Jeff >>> Our call will accept larger values and zero fill any bits we don't use. >>> It should be safe to pass the original len. >> >> ok.. will do it like that >> >> thnx for the comments, can anyone test the stuff? (I have access >> to UP only ATM) >> >> roman >> >