From 7ce005d7c134cf290fc1c5f054be5d5e497f544f Mon Sep 17 00:00:00 2001 From: David Greenman Date: Sat, 1 Oct 1994 16:56:22 +0000 Subject: [PATCH] 1) If nrpos <= 1, don't output rpos table (and set fs_cpc to 0) - disabling the use of the rotational position table. 2) Allow specification of 0 rotational positions (disables function). 3) Make rotdelay=0 and nrpos=0 by default. The purpose of the above is to optimize for modern SCSI (and IDE) drives that do read-ahead/write-behind. --- sbin/newfs/mkfs.c | 2 +- sbin/newfs/newfs.c | 34 ++++++++++++++++++++++------------ 2 files changed, 23 insertions(+), 13 deletions(-) diff --git a/sbin/newfs/mkfs.c b/sbin/newfs/mkfs.c index 398f36961f60..9d71c20c09d8 100644 --- a/sbin/newfs/mkfs.c +++ b/sbin/newfs/mkfs.c @@ -443,7 +443,7 @@ mkfs(pp, fsys, fi, fo) sblock.fs_npsect = nphyssectors; sblock.fs_postblformat = FS_DYNAMICPOSTBLFMT; sblock.fs_sbsize = fragroundup(&sblock, sizeof(struct fs)); - if (sblock.fs_ntrak == 1) { + if (sblock.fs_ntrak == 1 || sblock.fs_nrpos <= 1) { sblock.fs_cpc = 0; goto next; } diff --git a/sbin/newfs/newfs.c b/sbin/newfs/newfs.c index c7748e8e59d0..62fde3060bcc 100644 --- a/sbin/newfs/newfs.c +++ b/sbin/newfs/newfs.c @@ -104,12 +104,17 @@ void fatal(); #define DESCPG 16 /* desired fs_cpg */ /* - * ROTDELAY gives the minimum number of milliseconds to initiate - * another disk transfer on the same cylinder. It is used in - * determining the rotationally optimal layout for disk blocks - * within a file; the default of fs_rotdelay is 4ms. + * Once upon a time... + * ROTDELAY gives the minimum number of milliseconds to initiate + * another disk transfer on the same cylinder. It is used in + * determining the rotationally optimal layout for disk blocks + * within a file; the default of fs_rotdelay is 4ms. + * + * ...but now we make this 0 to disable the rotdelay delay because + * modern drives with read/write-behind achieve higher performance + * without the delay. */ -#define ROTDELAY 4 +#define ROTDELAY 0 /* * MAXBLKPG determines the maximum number of data blocks which are @@ -126,13 +131,18 @@ void fatal(); #define NFPI 4 /* - * For each cylinder we keep track of the availability of blocks at different - * rotational positions, so that we can lay out the data to be picked - * up with minimum rotational latency. NRPOS is the default number of - * rotational positions that we distinguish. With NRPOS of 8 the resolution - * of our summary information is 2ms for a typical 3600 rpm drive. + * Once upon a time... + * For each cylinder we keep track of the availability of blocks at different + * rotational positions, so that we can lay out the data to be picked + * up with minimum rotational latency. NRPOS is the default number of + * rotational positions that we distinguish. With NRPOS of 8 the resolution + * of our summary information is 2ms for a typical 3600 rpm drive. + * + * ...but now we make this 1 (which disables the rotational position table) + * because modern drives with read-ahead and write-behind do better without + * the rotational position table. */ -#define NRPOS 8 /* number distinct rotational positions */ +#define NRPOS 0 /* number distinct rotational positions */ int mfs; /* run as the memory based filesystem */ @@ -269,7 +279,7 @@ main(argc, argv) fatal("%s: bad free space %%\n", optarg); break; case 'n': - if ((nrpos = atoi(optarg)) <= 0) + if ((nrpos = atoi(optarg)) < 0) fatal("%s: bad rotational layout count\n", optarg); break;