Re: Proof of concept patch for device rearrangement

From: Sergey A. Osokin <osa_at_freebsd.org.ru>
Date: Thu, 19 Jun 2003 14:07:35 +0400
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
_at__at_ -62,6 +62,7 _at__at_
 #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
                             / \
Received on Thu Jun 19 2003 - 01:07:38 UTC

This archive was generated by hypermail 2.4.0 : Wed May 19 2021 - 11:37:12 UTC