From owner-freebsd-hackers@FreeBSD.ORG Wed Jul 4 13:04:21 2007 Return-Path: X-Original-To: freebsd-hackers@freebsd.org Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 0553616A421 for ; Wed, 4 Jul 2007 13:04:21 +0000 (UTC) (envelope-from n.cormier@gmail.com) Received: from py-out-1112.google.com (py-out-1112.google.com [64.233.166.182]) by mx1.freebsd.org (Postfix) with ESMTP id 9076013C46C for ; Wed, 4 Jul 2007 13:04:20 +0000 (UTC) (envelope-from n.cormier@gmail.com) Received: by py-out-1112.google.com with SMTP id u77so4306790pyb for ; Wed, 04 Jul 2007 06:04:19 -0700 (PDT) DKIM-Signature: a=rsa-sha1; c=relaxed/relaxed; d=gmail.com; s=beta; h=domainkey-signature:received:received:message-id:date:from:to:subject:cc:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; b=ebYOh5XTfyTvfSnemj5h+ypTXSh7+xYSRLtGWOW5b3KbikcfuTPvs/S9FZAWNQg3oe0UAlJSOhrZHvKmRrRB3ImrHlWoaYzZaOuUKDpr5cRDXArQXjsawn7Q9hgtGTiskE94DRH7+fI33cDDgD2SDFJSjid4nX5AhNv+kcWZSVc= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=beta; h=received:message-id:date:from:to:subject:cc:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; b=uQXlnvyyHaH/EfXnth3DWtqEuFdbjP8KL3n6nbVxnd0fB1b/PHWM03fuduPw5BYI/trK9FgdmfASliUvHDVAWSZcyDm/3E0uJgWRV46OSMEVzRnaZh8fpzL2ftYWKT5O4D8weRrgqbElWrMdwsa8zjpLILJ6BQ3bzX7kDwD0PiU= Received: by 10.35.110.13 with SMTP id n13mr9710842pym.1183554259677; Wed, 04 Jul 2007 06:04:19 -0700 (PDT) Received: by 10.35.40.11 with HTTP; Wed, 4 Jul 2007 06:04:19 -0700 (PDT) Message-ID: Date: Wed, 4 Jul 2007 15:04:19 +0200 From: "Nicolas Cormier" To: "Robert Watson" In-Reply-To: <20070704120624.W37059@fledge.watson.org> MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Content-Disposition: inline References: <20070704091349.T42421@fledge.watson.org> <20070704120624.W37059@fledge.watson.org> Cc: freebsd-hackers@freebsd.org Subject: Re: p_vmspace in syscall X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 04 Jul 2007 13:04:21 -0000 On 7/4/07, Robert Watson wrote: > How much memory are we talking about -- enough to potentially run into kernel > address space problems on 32-bit systems? How long will the mappings persist > -- do you map them into kernel for a brief period to fill them, and then leave > them mapped into user space, or is this going to be a persistent shared > mapping over a very long period of time? Is the memory going to be pageable? > How will it interact with things like mprotect(), msync(), etc? What should > happen if a the pages are released by the process using munmap() or by mapping > over the region with mmap()? What should happen in a child process if a > process forks after netattach() and the parent calls netdatach()? What > happens if the process calls send() using a source address in the memory > region, and zero-copy sockets are enabled, which would normally lead the page > to be "borrowed" from the user process? Currently I'm just trying to play with kernel/modules/vm ... I'm a newbie in kernel development and I just want to make a little prototype of an in-kernel network allocator. To start I only need to map a page (1024 bytes) from kernel to user process. This memory will never be used by the kernel between the call of net(malloc/attach) and the call of net(detach/free). So user and kernel will never use this page at the same time. > The underlying point here is that there is a model by which VM is managed -- > pages, pagers, memory objects, mappings, address spaces, etc. We can't just > talk about pages being shared or mapped, we need to think about what is to be > accomplished, and how to map that into the abstractions that already exist. > Memory comes in different flavours, and generally speaking, you don't want to > use pages that come from malloc(9) for sharing with userspace, so we need to > think about what kind of memory you do need. Thank you for your answer. Right now, I just want to do it as easily as possible, I don't know if this kind of project could interest other persons ? It is ok for me to work more on it later on, if there is any further interest in doing it. -- Nicolas Cormier