Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 19 Jun 2003 14:07:35 +0400
From:      "Sergey A. Osokin" <osa@freebsd.org.ru>
To:        Poul-Henning Kamp <phk@phk.freebsd.dk>
Cc:        current@freebsd.org
Subject:   Re: Proof of concept patch for device rearrangement
Message-ID:  <20030619100735.GD86248@freebsd.org.ru>
In-Reply-To: <43720.1055971536@critter.freebsd.dk>
References:  <43720.1055971536@critter.freebsd.dk>

next in thread | previous in thread | raw e-mail | index | archive | help
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
                             / \



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20030619100735.GD86248>