summaryrefslogtreecommitdiffstats
path: root/sbin/newfs
diff options
context:
space:
mode:
authordg <dg@FreeBSD.org>1994-10-01 16:56:22 +0000
committerdg <dg@FreeBSD.org>1994-10-01 16:56:22 +0000
commitc32e69883fe19e5e15cad90f2573376f24cae338 (patch)
treec034334e19791c358e8fa01255fdb563143de1f2 /sbin/newfs
parent707f608bbfc7ca2d633b5e37b58852ddd810fd3d (diff)
downloadFreeBSD-src-c32e69883fe19e5e15cad90f2573376f24cae338.zip
FreeBSD-src-c32e69883fe19e5e15cad90f2573376f24cae338.tar.gz
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.
Diffstat (limited to 'sbin/newfs')
-rw-r--r--sbin/newfs/mkfs.c2
-rw-r--r--sbin/newfs/newfs.c34
2 files changed, 23 insertions, 13 deletions
diff --git a/sbin/newfs/mkfs.c b/sbin/newfs/mkfs.c
index 398f369..9d71c20 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 c7748e8..62fde30 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;
OpenPOWER on IntegriCloud