From owner-freebsd-arch Tue Jan 21 10:32:38 2003 Delivered-To: freebsd-arch@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 593AC37B48F; Tue, 21 Jan 2003 10:32:33 -0800 (PST) Received: from fledge.watson.org (fledge.watson.org [204.156.12.50]) by mx1.FreeBSD.org (Postfix) with ESMTP id 5A99643E4A; Tue, 21 Jan 2003 10:32:32 -0800 (PST) (envelope-from robert@fledge.watson.org) Received: from fledge.watson.org (fledge.pr.watson.org [192.0.2.3]) by fledge.watson.org (8.12.6/8.12.5) with SMTP id h0LIWPP4026877; Tue, 21 Jan 2003 13:32:25 -0500 (EST) (envelope-from robert@fledge.watson.org) Date: Tue, 21 Jan 2003 13:32:25 -0500 (EST) From: Robert Watson X-Sender: robert@fledge.watson.org To: phk@freebsd.org Cc: Matthew Dillon , "Alan L. Cox" , Peter Wemm , arch@freebsd.org Subject: Re: getsysfd() patch #1 (Re: Virtual memory question) In-Reply-To: <16711.1043173573@critter.freebsd.dk> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: owner-freebsd-arch@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG On Tue, 21 Jan 2003 phk@freebsd.org wrote: > In message , Robe > rt Watson writes: > > > >Ok, so lemme revise my thinking. Could we take this patch, rename the API > >from getsysfd(various things) to memfd(size), and simply provide anonymous > >swap-backed memory only? > > The traditional design would be: > > fd = open("/dev/shmem", ...); > ptr = mmap(..., fd, ...) Well, it struck me the three implementations that came to mind would be: (1) shmfs. mount -t shmfs foo /shmfs Handle the implementation using vnodes and DTYPE_VNODE (2) /dev/shm Handle the implementation using cloning devices and device pager magic. (3) DTYPE_MEMFD Handle the implementation using a special file descriptor type creating using a special creation primitive (similar to kqueue, pipe, etc). Of the three, (3) appears to be simplist to implement, (1) the most complicated. I'm probably not qualified to comment on (2), but have to say that (3) would be the easiest to stick in MAC magic for :-). But only if (3) completely avoids the kitchensinkfd() approach. From the API perspective, you could easily hide any of these behind a memfd() library call. Robert N M Watson FreeBSD Core Team, TrustedBSD Projects robert@fledge.watson.org Network Associates Laboratories To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-arch" in the body of the message