#
ebdb43a2 |
| 07-Apr-2002 |
Poul-Henning Kamp <phk@FreeBSD.org> |
bbsize and sbsize cannot ever be trusted from the disklabel, in particular as there may not be one. Remove #if 0'ed code which might mislead people to think otherwise.
unifdef -ULOSTDIR, fsck can m
bbsize and sbsize cannot ever be trusted from the disklabel, in particular as there may not be one. Remove #if 0'ed code which might mislead people to think otherwise.
unifdef -ULOSTDIR, fsck can make lost+found on the fly.
Sponsored by: DARPA & NAI Labs
show more ...
|
#
a2f4e30c |
| 04-Apr-2002 |
Bruce Evans <bde@FreeBSD.org> |
Fixed some English errors in previous commit.
Fixed some style bugs in the removal of __P(()). Whitespace before "__P((" was not removed.
|
#
1f35193b |
| 03-Apr-2002 |
Poul-Henning Kamp <phk@FreeBSD.org> |
Add more DWIM/autoadjustment and less evil style(9) banned exit(2) codes. Add some missing statics.
Sponsored by: DARPA & NAI Labs.
|
#
5dccd5c6 |
| 20-Mar-2002 |
Poul-Henning Kamp <phk@FreeBSD.org> |
Swing the axe and remove some archaic features from newfs which modern diskdrives do neither need nor want:
-O create a 4.3BSD format filesystem -d rotational delay between contiguous blocks -k s
Swing the axe and remove some archaic features from newfs which modern diskdrives do neither need nor want:
-O create a 4.3BSD format filesystem -d rotational delay between contiguous blocks -k sector 0 skew, per track -l hardware sector interleave -n number of distinguished rotational positions -p spare sectors per track -r revolutions/minute -t tracks/cylinder -x spare sectors per cylinder
No change in the produced filesystem image unless one or more of these options were used.
Approved by: mckusick
show more ...
|
#
89fb8ee7 |
| 19-Mar-2002 |
Poul-Henning Kamp <phk@FreeBSD.org> |
Add the undocumented -R option to disable randomness for regression-testing.
Add a couple of simple regression tests accessible with "make test", they depend on the md(4) driver.
FYI I have also tr
Add the undocumented -R option to disable randomness for regression-testing.
Add a couple of simple regression tests accessible with "make test", they depend on the md(4) driver.
FYI I have also tried running the test against a week old newfs and it passed.
show more ...
|
#
8409849d |
| 19-Mar-2002 |
Poul-Henning Kamp <phk@FreeBSD.org> |
Further cleanups.
|
#
475df34a |
| 19-Mar-2002 |
Ian Dowse <iedowse@FreeBSD.org> |
Replace a number of similar `for' loops with a new `ilog2()' function that computes the base-2 log of a power of 2.
|
#
bf57cced |
| 19-Mar-2002 |
Ian Dowse <iedowse@FreeBSD.org> |
Complete the ANSIfication of newfs by converting function declarations to C89 style.
|
#
f7b48c89 |
| 19-Mar-2002 |
Ian Dowse <iedowse@FreeBSD.org> |
The FSIRAND code is always compiled in, and it is unlikely that anyone needs a newfs without it. Remove the #ifdef's from around the code and the -DFSIRAND from the Makefile. Also remove redundant de
The FSIRAND code is always compiled in, and it is unlikely that anyone needs a newfs without it. Remove the #ifdef's from around the code and the -DFSIRAND from the Makefile. Also remove redundant declarations of random() and srandomdev().
show more ...
|
#
9710700c |
| 19-Mar-2002 |
Ian Dowse <iedowse@FreeBSD.org> |
Remove the ancient STANDALONE code.
Approved by: phk
|
#
af53d6d8 |
| 18-Mar-2002 |
Ian Dowse <iedowse@FreeBSD.org> |
Remove yet more vestiges of mount_mfs.
|
#
63dab85c |
| 18-Mar-2002 |
Bruce Evans <bde@FreeBSD.org> |
Fixed some style bugs (mainly ones not fixed or made worse by rev.1.41). Old code obfuscates long (but single-line) messages by printing them in pieces using %s. Rev.1.41 obfuscated some new long me
Fixed some style bugs (mainly ones not fixed or made worse by rev.1.41). Old code obfuscates long (but single-line) messages by printing them in pieces using %s. Rev.1.41 obfuscated some new long messages using ISO string concatenation. This commit only fixes the new obfuscations.
show more ...
|
#
345b78a3 |
| 17-Mar-2002 |
Poul-Henning Kamp <phk@FreeBSD.org> |
Remove __P() and register. Set WARNS=2
This is the beginning of a pre-UFS2 cleanup of newfs.
Sponsored by: DARPA, NAI Labs
|
Revision tags: release/4.5.0_cvs, release/4.4.0_cvs |
|
#
bfd1f63d |
| 02-Nov-2001 |
Poul-Henning Kamp <phk@FreeBSD.org> |
style(9) cleanup.
Submitted by: j mckitrick <jcm@freebsd-uk.eu.org> Reviewed by: phk, /sbin/md5
|
#
9cfe90fe |
| 20-Aug-2001 |
Brian Somers <brian@FreeBSD.org> |
Handle snprintf() returning < 0 (not just -1)
MFC after: 2 weeks
|
#
327e849a |
| 20-Aug-2001 |
Brian Somers <brian@FreeBSD.org> |
Handle snprintf() returning -1.
MFC after: 2 weeks
|
#
80f86e52 |
| 29-May-2001 |
Poul-Henning Kamp <phk@FreeBSD.org> |
A more complete removal of MFS related code.
XXX: This program badly needs a style(9) + BDECFLAGS treatment.
|
#
1fef4cc9 |
| 24-Apr-2001 |
Kris Kennaway <kris@FreeBSD.org> |
sprintf() -> snprintf()
Partially submitted by: "Andrew R. Reiter" <arr@watson.org> Obtained from: OpenBSD
|
Revision tags: release/4.3.0_cvs, release/4.3.0 |
|
#
a61ab64a |
| 10-Apr-2001 |
Kirk McKusick <mckusick@FreeBSD.org> |
Directory layout preference improvements from Grigoriy Orlov <gluk@ptci.ru>. His description of the problem and solution follow. My own tests show speedups on typical filesystem intensive workloads o
Directory layout preference improvements from Grigoriy Orlov <gluk@ptci.ru>. His description of the problem and solution follow. My own tests show speedups on typical filesystem intensive workloads of 5% to 12% which is very impressive considering the small amount of code change involved.
------
One day I noticed that some file operations run much faster on small file systems then on big ones. I've looked at the ffs algorithms, thought about them, and redesigned the dirpref algorithm.
First I want to describe the results of my tests. These results are old and I have improved the algorithm after these tests were done. Nevertheless they show how big the perfomance speedup may be. I have done two file/directory intensive tests on a two OpenBSD systems with old and new dirpref algorithm. The first test is "tar -xzf ports.tar.gz", the second is "rm -rf ports". The ports.tar.gz file is the ports collection from the OpenBSD 2.8 release. It contains 6596 directories and 13868 files. The test systems are:
1. Celeron-450, 128Mb, two IDE drives, the system at wd0, file system for test is at wd1. Size of test file system is 8 Gb, number of cg=991, size of cg is 8m, block size = 8k, fragment size = 1k OpenBSD-current from Dec 2000 with BUFCACHEPERCENT=35
2. PIII-600, 128Mb, two IBM DTLA-307045 IDE drives at i815e, the system at wd0, file system for test is at wd1. Size of test file system is 40 Gb, number of cg=5324, size of cg is 8m, block size = 8k, fragment size = 1k OpenBSD-current from Dec 2000 with BUFCACHEPERCENT=50
You can get more info about the test systems and methods at: http://www.ptci.ru/gluk/dirpref/old/dirpref.html
Test Results
tar -xzf ports.tar.gz rm -rf ports mode old dirpref new dirpref speedup old dirprefnew dirpref speedup First system normal 667 472 1.41 477 331 1.44 async 285 144 1.98 130 14 9.29 sync 768 616 1.25 477 334 1.43 softdep 413 252 1.64 241 38 6.34 Second system normal 329 81 4.06 263.5 93.5 2.81 async 302 25.7 11.75 112 2.26 49.56 sync 281 57.0 4.93 263 90.5 2.9 softdep 341 40.6 8.4 284 4.76 59.66
"old dirpref" and "new dirpref" columns give a test time in seconds. speedup - speed increasement in times, ie. old dirpref / new dirpref.
------
Algorithm description
The old dirpref algorithm is described in comments:
/* * Find a cylinder to place a directory. * * The policy implemented by this algorithm is to select from * among those cylinder groups with above the average number of * free inodes, the one with the smallest number of directories. */
A new directory is allocated in a different cylinder groups than its parent directory resulting in a directory tree that is spreaded across all the cylinder groups. This spreading out results in a non-optimal access to the directories and files. When we have a small filesystem it is not a problem but when the filesystem is big then perfomance degradation becomes very apparent.
What I mean by a big file system ?
1. A big filesystem is a filesystem which occupy 20-30 or more percent of total drive space, i.e. first and last cylinder are physically located relatively far from each other. 2. It has a relatively large number of cylinder groups, for example more cylinder groups than 50% of the buffers in the buffer cache.
The first results in long access times, while the second results in many buffers being used by metadata operations. Such operations use cylinder group blocks and on-disk inode blocks. The cylinder group block (fs->fs_cblkno) contains struct cg, inode and block bit maps. It is 2k in size for the default filesystem parameters. If new and parent directories are located in different cylinder groups then the system performs more input/output operations and uses more buffers. On filesystems with many cylinder groups, lots of cache buffers are used for metadata operations.
My solution for this problem is very simple. I allocate many directories in one cylinder group. I also do some things, so that the new allocation method does not cause excessive fragmentation and all directory inodes will not be located at a location far from its file's inodes and data. The algorithm is: /* * Find a cylinder group to place a directory. * * The policy implemented by this algorithm is to allocate a * directory inode in the same cylinder group as its parent * directory, but also to reserve space for its files inodes * and data. Restrict the number of directories which may be * allocated one after another in the same cylinder group * without intervening allocation of files. * * If we allocate a first level directory then force allocation * in another cylinder group. */
My early versions of dirpref give me a good results for a wide range of file operations and different filesystem capacities except one case: those applications that create their entire directory structure first and only later fill this structure with files.
My solution for such and similar cases is to limit a number of directories which may be created one after another in the same cylinder group without intervening file creations. For this purpose, I allocate an array of counters at mount time. This array is linked to the superblock fs->fs_contigdirs[cg]. Each time a directory is created the counter increases and each time a file is created the counter decreases. A 60Gb filesystem with 8mb/cg requires 10kb of memory for the counters array.
The maxcontigdirs is a maximum number of directories which may be created without an intervening file creation. I found in my tests that the best performance occurs when I restrict the number of directories in one cylinder group such that all its files may be located in the same cylinder group. There may be some deterioration in performance if all the file inodes are in the same cylinder group as its containing directory, but their data partially resides in a different cylinder group. The maxcontigdirs value is calculated to try to prevent this condition. Since there is no way to know how many files and directories will be allocated later I added two optimization parameters in superblock/tunefs. They are:
int32_t fs_avgfilesize; /* expected average file size */ int32_t fs_avgfpdir; /* expected # of files per directory */
These parameters have reasonable defaults but may be tweeked for special uses of a filesystem. They are only necessary in rare cases like better tuning a filesystem being used to store a squid cache.
I have been using this algorithm for about 3 months. I have done a lot of testing on filesystems with different capacities, average filesize, average number of files per directory, and so on. I think this algorithm has no negative impact on filesystem perfomance. It works better than the default one in all cases. The new dirpref will greatly improve untarring/removing/coping of big directories, decrease load on cvs servers and much more. The new dirpref doesn't speedup a compilation process, but also doesn't slow it down.
Obtained from: Grigoriy Orlov <gluk@ptci.ru>
show more ...
|
#
5f98b5af |
| 03-Apr-2001 |
Bruce Evans <bde@FreeBSD.org> |
Fixed style bugs in previous commit.
|
#
b2cd1ce8 |
| 02-Apr-2001 |
David E. O'Brien <obrien@FreeBSD.org> |
Allow enabling soft updates (with -U) on a new filesystem.
[I first added this functionality, and thought to check prior art. Seeing OpenBSD had already done this, I changed my addition to reduce t
Allow enabling soft updates (with -U) on a new filesystem.
[I first added this functionality, and thought to check prior art. Seeing OpenBSD had already done this, I changed my addition to reduce the diffs between the two and went with their option letter.] Obtained from: OpenBSD
show more ...
|
#
f55ff3f3 |
| 15-Jan-2001 |
Ian Dowse <iedowse@FreeBSD.org> |
The ffs superblock includes a 128-byte region for use by temporary in-core pointers to summary information. An array in this region (fs_csp) could overflow on filesystems with a very large number of
The ffs superblock includes a 128-byte region for use by temporary in-core pointers to summary information. An array in this region (fs_csp) could overflow on filesystems with a very large number of cylinder groups (~16000 on i386 with 8k blocks). When this happens, other fields in the superblock get corrupted, and fsck refuses to check the filesystem.
Solve this problem by replacing the fs_csp array in 'struct fs' with a single pointer, and add padding to keep the length of the 128-byte region fixed. Update the kernel and userland utilities to use just this single pointer.
With this change, the kernel no longer makes use of the superblock fields 'fs_csshift' and 'fs_csmask'. Add a comment to newfs/mkfs.c to indicate that these fields must be calculated for compatibility with older kernels.
Reviewed by: mckusick
show more ...
|
Revision tags: release/4.2.0 |
|
#
929f494b |
| 24-Oct-2000 |
John W. De Boskey <jwd@FreeBSD.org> |
Cast block number to off_t to avoid possible overflow bugs.
Pointed out by: Bruce Evans <bde@zeta.org.au>
|
#
45c29d5c |
| 24-Oct-2000 |
John W. De Boskey <jwd@FreeBSD.org> |
The write combining code in revision 1.30 needs a few additional touch ups. The cache needs to be flushed against block reads, and a final flush at process termination to force the backup superblock
The write combining code in revision 1.30 needs a few additional touch ups. The cache needs to be flushed against block reads, and a final flush at process termination to force the backup superblocks to disk.
I believe this will allow 'make release' to complete.
Submitted by: Tor.Egge@fast.no
show more ...
|
#
3927beed |
| 17-Oct-2000 |
Peter Wemm <peter@FreeBSD.org> |
Implement simple write combining for newfs - this is particularly useful for large scsi disks with WCE = 0. This yields around a 7 times speedup on elapsed newfs time on test disks here. 64k cluste
Implement simple write combining for newfs - this is particularly useful for large scsi disks with WCE = 0. This yields around a 7 times speedup on elapsed newfs time on test disks here. 64k clusters seems to be the sweet spot for scsi disks using our present drivers.
show more ...
|