From owner-freebsd-current@FreeBSD.ORG Thu Jun 19 03:07:38 2003 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 4B3C237B401 for ; Thu, 19 Jun 2003 03:07:38 -0700 (PDT) Received: from freebsd.org.ru (freebsd.org.ru [194.84.67.5]) by mx1.FreeBSD.org (Postfix) with ESMTP id A1BF343F75 for ; Thu, 19 Jun 2003 03:07:37 -0700 (PDT) (envelope-from osa@freebsd.org.ru) Received: by freebsd.org.ru (Postfix, from userid 1000) id 4DE6F2E3; Thu, 19 Jun 2003 14:07:35 +0400 (MSD) Date: Thu, 19 Jun 2003 14:07:35 +0400 From: "Sergey A. Osokin" To: Poul-Henning Kamp Message-ID: <20030619100735.GD86248@freebsd.org.ru> References: <43720.1055971536@critter.freebsd.dk> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <43720.1055971536@critter.freebsd.dk> User-Agent: Mutt/1.5.4i cc: current@freebsd.org Subject: Re: Proof of concept patch for device rearrangement X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list Reply-To: osa@FreeBSD.org.ru List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 19 Jun 2003 10:07:39 -0000 On Wed, Jun 18, 2003 at 11:25:36PM +0200, Poul-Henning Kamp wrote: > > I have uploaded a proof of concept patch: > > http://phk.freebsd.dk/patch/fd_dev.patch > > > WARNING: It is perfectly possibly that this patch eats your machine > WARNING: destroys your disk and makes your corn-flakes soggy. > WARNING: RUN AT YOUR OWN RISK! > > > This patch basically shortcuts access from userland to devices > directly from the file descriptor level through DEVFS to the device > driver. > > So far there are no indications that we will not be moving in this > direction pretty soon, but it may not be this exact way we do it, > this is only a proof of concept at this point. > > I have only tested this patch lightly on a disk-less machine, I > have not tried a lot of advanced stuff with it, and I have already > noticed that syslogd seems to have an issue with it during startup > (I just press ctrl-C for now). > > The patch is controlled by the sysctl "debug.phk" which can take > the values 0 (disabled) or 1 (enabled). > > But the good news is that there is a measurable performance improvement: > > syv# sysctl debug.phk=0 > debug.phk: 1 -> 0 > syv# dd if=/dev/zero of=/dev/null count=100000 > 100000+0 records in > 100000+0 records out > 51200000 bytes transferred in 4.784862 secs (10700413 bytes/sec) > syv# sysctl debug.phk=1 > debug.phk: 0 -> 1 > syv# dd if=/dev/zero of=/dev/null count=100000 > 100000+0 records in > 100000+0 records out > 51200000 bytes transferred in 2.211927 secs (23147238 bytes/sec) > > And with this code enabled, it is possible to go from userland to > device driver without touching Giant underway. > > Comments and test-results are most welcome! Hmm... diff -u -r1.61 file.h --- sys/file.h 18 Jun 2003 19:53:59 -0000 1.61 +++ sys/file.h 18 Jun 2003 20:44:48 -0000 @@ -62,6 +62,7 @@ #define DTYPE_FIFO 4 /* fifo (named pipe) */ #define DTYPE_KQUEUE 5 /* event queue */ #define DTYPE_CRYPTO 6 /* crypto */ +#define DTYPE_DEVICE 7 /* crypto */ ^^^^^^ looks like comment wrong, isn't it? -- Rgdz, /"\ ASCII RIBBON CAMPAIGN Sergey Osokin aka oZZ, \ / AGAINST HTML MAIL http://ozz.pp.ru/ X AND NEWS / \