svn commit: r210926 - head/sys/dev/null

Peter Holm pho at freebsd.org
Fri Aug 6 11:20:49 UTC 2010


On Fri, Aug 06, 2010 at 09:47:48AM +0000, Konstantin Belousov wrote:
> Author: kib
> Date: Fri Aug  6 09:47:48 2010
> New Revision: 210926
> URL: http://svn.freebsd.org/changeset/base/210926
> 
> Log:
>   Mark /dev/zero and /dev/null as eternal.
>   
>   In collaboration with:	pho
>   MFC after:	1 month
> 
> Modified:
>   head/sys/dev/null/null.c
> 
> Modified: head/sys/dev/null/null.c
> ==============================================================================
> --- head/sys/dev/null/null.c	Fri Aug  6 09:46:53 2010	(r210925)
> +++ head/sys/dev/null/null.c	Fri Aug  6 09:47:48 2010	(r210926)
> @@ -112,10 +112,10 @@ null_modevent(module_t mod __unused, int
>  		if (bootverbose)
>  			printf("null: <null device, zero device>\n");
>  		zbuf = (void *)malloc(PAGE_SIZE, M_TEMP, M_WAITOK | M_ZERO);
> -		null_dev = make_dev(&null_cdevsw, 0, UID_ROOT, GID_WHEEL,
> -			0666, "null");
> -		zero_dev = make_dev(&zero_cdevsw, 0, UID_ROOT, GID_WHEEL,
> -			0666, "zero");
> +		null_dev = make_dev_credf(MAKEDEV_ETERNAL_KLD, &null_cdevsw, 0,
> +		    NULL, UID_ROOT, GID_WHEEL, 0666, "null");
> +		zero_dev = make_dev_credf(MAKEDEV_ETERNAL_KLD, &zero_cdevsw, 0,
> +		    NULL, UID_ROOT, GID_WHEEL, 0666, "zero");
>  		break;
>  
>  	case MOD_UNLOAD:

The micro-benchmarks for this was was:

1: open/read/close and open/write/close in a loop
2: read and write in a loop
3: open/read/close in a loop


Profileng of scenario #1 shows this:
$ ministat -w 72 devmtx1.r210851.20100805092611.log devmtx1.r210851M.20100805103753.log
x devmtx1.r210851.20100805092611.log
+ devmtx1.r210851M.20100805103753.log
+------------------------------------------------------------------------+
|    +                                                                x  |
|+  ++ +                                                             xxxx|
| |_AM_|                                                             |MA||
+------------------------------------------------------------------------+
    N           Min           Max        Median           Avg        Stddev
x   5         74.54         75.22         74.89        74.926    0.25938389
+   5         60.93         62.15         61.73          61.6     0.4501111
Difference at 95.0% confidence
        -13.326 +/- 0.535747
        -17.7855% +/- 0.715035%
        (Student's t, pooled s = 0.367342)

Profileng of scenario #2 shows this:
$ ministat -w 72 devmtx2.r210851.20100805092611.log devmtx2.r210851M.20100805103753.log
x devmtx2.r210851.20100805092611.log
+ devmtx2.r210851M.20100805103753.log
+------------------------------------------------------------------------+
|+                                                                      x|
|+                                                                      x|
|+                                                                      x|
|+                                                                      x|
|+                                                                      x|
|A                                                                      A|
+------------------------------------------------------------------------+
    N           Min           Max        Median           Avg        Stddev
x   5         64.97         65.31         65.01        65.062    0.14131525
+   5          9.75          9.97          9.82          9.84   0.087464278
Difference at 95.0% confidence
        -55.222 +/- 0.17139
        -84.876% +/- 0.263426%
        (Student's t, pooled s = 0.117516)

Profileng of scenario #3 shows this:
$ ministat -w 72 devmtx3.r210851.20100805092611.log devmtx3.r210851M.20100805103753.log
x devmtx3.r210851.20100805092611.log
+ devmtx3.r210851M.20100805103753.log
+------------------------------------------------------------------------+
|+ +                                                              x      |
|+ +  +                                                           x  xx x|
||_A_|                                                            |__A_| |
+------------------------------------------------------------------------+
    N           Min           Max        Median           Avg        Stddev
x   5         73.27         75.57          74.5         74.32     0.9681942
+   5         49.19         51.03         49.82        49.816    0.75145193
Difference at 95.0% confidence
        -24.504 +/- 1.26392
        -32.9709% +/- 1.70065%
        (Student's t, pooled s = 0.866626)
$

Details at http://people.freebsd.org/~pho/devmtx/

- Peter


More information about the svn-src-all mailing list