Proof of concept patch for device rearrangement

From: Poul-Henning Kamp <phk_at_phk.freebsd.dk>
Date: Wed, 18 Jun 2003 23:25:36 +0200
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!

-- 
Poul-Henning Kamp       | UNIX since Zilog Zeus 3.20
phk_at_FreeBSD.ORG         | TCP/IP since RFC 956
FreeBSD committer       | BSD since 4.3-tahoe
Never attribute to malice what can adequately be explained by incompetence.
Received on Wed Jun 18 2003 - 12:25:39 UTC

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