summaryrefslogtreecommitdiffstats
path: root/sys/contrib/softupdates
Commit message (Collapse)AuthorAgeFilesLines
* Remove these here, these were repocopied to src/sys/ufs/ffs.peter2000-06-233-5532/+0
|
* Update to new copyright.mckusick2000-06-222-46/+12
|
* When running with quotas enabled on a filesystem using soft updates,mckusick2000-06-181-2/+3
| | | | | | | | the system would panic when a user's inode quota was exceeded (see PR 18959 for details). This fixes that problem. PR: 18959 Submitted by: Jason Godsey <jason@unixguy.fidalgo.net>
* Some additional performance improvements. When freeing an inodemckusick2000-06-181-8/+18
| | | | | | | | | | check to see if it has been committed to disk. If it has never been written, it can be freed immediately. For short lived files this change allows the same inode to be reused repeatedly. Similarly, when upgrading a fragment to a larger size, if it has never been claimed by an inode on disk, it too can be freed immediately making it available for reuse often in the next slowly growing block of the same file.
* ARGH! I have too many source trees :-(phk2000-06-161-4/+2
| | | | Fix prototype errors in last commit.
* Virtualizes & untangles the bioops operations vector.phk2000-06-161-2/+0
| | | | Ref: Message-ID: <18317.961014572@critter.freebsd.dk> To: current@
* Back out the previous change to the queue(3) interface.jake2000-05-262-25/+25
| | | | | | It was not discussed and should probably not happen. Requested by: msmith and others
* Change the way that the queue(3) structures are declared; don't assume thatjake2000-05-232-25/+25
| | | | | | | | the type argument to *_HEAD and *_ENTRY is a struct. Suggested by: phk Reviewed by: phk Approved by: mdodd
* Separate the struct bio related stuff out of <sys/buf.h> intophk2000-05-051-0/+1
| | | | | | | | | | | | | | | <sys/bio.h>. <sys/bio.h> is now a prerequisite for <sys/buf.h> but it shall not be made a nested include according to bdes teachings on the subject of nested includes. Diskdrivers and similar stuff below specfs::strategy() should no longer need to include <sys/buf.> unless they need caching of data. Still a few bogus uses of struct buf to track down. Repocopy by: peter
* Introduce extended attribute support for FFS, allowing arbitraryrwatson2000-04-151-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | (name, value) pairs to be associated with inodes. This support is used for ACLs, MAC labels, and Capabilities in the TrustedBSD security extensions, which are currently under development. In this implementation, attributes are backed to data vnodes in the style of the quota support in FFS. Support for FFS extended attributes may be enabled using the FFS_EXTATTR kernel option (disabled by default). Userland utilities and man pages will be committed in the next batch. VFS interfaces and man pages have been in the repo since 4.0-RELEASE and are unchanged. o ufs/ufs/extattr.h: UFS-specific extattr defines o ufs/ufs/ufs_extattr.c: bulk of support routines o ufs/{ufs,ffs,mfs}/*.[ch]: hooks and extattr.h includes o contrib/softupdates/ffs_softdep.c: extattr.h includes o conf/options, conf/files, i386/conf/LINT: added FFS_EXTATTR o coda/coda_vfsops.c: XXX required extattr.h due to ufsmount.h (This should not be the case, and will be fixed in a future commit) Currently attributes are not supported in MFS. This will be fixed. Reviewed by: adrian, bp, freebsd-fs, other unthanked souls Obtained from: TrustedBSD Project
* Move B_ERROR flag to b_ioflags and call it BIO_ERROR.phk2000-04-021-1/+1
| | | | | | | | | | | | | (Much of this done by script) Move B_ORDERED flag to b_ioflags and call it BIO_ORDERED. Move b_pblkno and b_iodone_chain to struct bio while we transition, they will be obsoleted once bio structs chain/stack. Add bio_queue field for struct bio aware disksort. Address a lot of stylistic issues brought up by bde.
* Rename the existing BUF_STRATEGY() to DEV_STRATEGY()phk2000-03-201-12/+11
| | | | | | | | substitute BUF_WRITE(foo) for VOP_BWRITE(foo->b_vp, foo) substitute BUF_STRATEGY(foo) for VOP_STRATEGY(foo->b_vp, foo) This patch is machine generated except for the ccd.c and buf.h parts.
* Remove B_READ, B_WRITE and B_FREEBUF and replace them with a newphk2000-03-201-1/+1
| | | | | | | | | | | | | | | | | | | | | field in struct buf: b_iocmd. The b_iocmd is enforced to have exactly one bit set. B_WRITE was bogusly defined as zero giving rise to obvious coding mistakes. Also eliminate the redundant struct buf flag B_CALL, it can just as efficiently be done by comparing b_iodone to NULL. Should you get a panic or drop into the debugger, complaining about "b_iocmd", don't continue. It is likely to write on your disk where it should have been reading. This change is a step in the direction towards a stackable BIO capability. A lot of this patch were machine generated (Thanks to style(9) compliance!) Vinum users: Greg has not had time to test this yet, be careful.
* When writing out bitmap buffers, need to skip over ones that alreadymckusick2000-01-301-1/+2
| | | | | | | have a write in progress. Otherwise one can get in an infinite loop trying to get them all flushed. Submitted by: Matthew Dillon <dillon@apollo.backplane.com>
* During fastpath processing for removal of a short-lived inode, themckusick2000-01-181-48/+56
| | | | | | | | | | set of restrictions for cancelling an inode dependency (inodedep) is somewhat stronger than originally coded. Since this check appears in two places, we codify it into the function check_inode_unwritten which we then call from the two sites, one freeing blocks and the other freeing directory entries. Submitted by: Steinar Haug via Matthew Dillon
* Need to reorganize the flushing of directory entry (pagedep) dependenciesmckusick2000-01-181-63/+62
| | | | | | | | | | | | | | so that they never try to lock an inode corresponding to ".." as this can lead to deadlock. We observe that any inode with an updated link count is always pushed into its buffer at the time of the link count change, so we do not need to do a VOP_UPDATE, but merely find its buffer and write it. The only time we need to get the inode itself is from the result of a mkdir whose name will never be ".." and hence locking such an inode will never request a lock above us in the filesystem tree. Thanks to Brian Fundakowski Feldman for providing the test program that tickled soft updates into hanging in "inode" sleep. Submitted by: Brian Fundakowski Feldman <green@FreeBSD.org>
* Better bounding on softdep_flushfiles; other minor tweeks to checks.mckusick2000-01-171-7/+9
|
* Must track multiple uncommitted renames until one ultimately getsmckusick2000-01-171-22/+65
| | | | committed to disk or is removed.
* Non-operational change, fix compiler warning.dillon2000-01-141-1/+1
| | | | Reviewed by: mckusick
* Confirming Peter's fix (locking 101: release the lock before you gomckusick2000-01-131-2/+0
| | | | | | to sleep). Locking 101, part 2: do not look at buffer contents after you have been asleep. There is no telling what wonderous changes may have occurred.
* Free the global softupdates lock prior to tsleep() in getdirtybuf().peter2000-01-131-0/+2
| | | | | | | | This seems to be responsible for a bunch of panics where the process sleeps and something else finds softupdates "locked" when it shouldn't be. This commit is unreviewed, but has been a big help here. Previously my boxes would panic pretty much on the first fsync() that wrote something to disk.
* Because cylinder group blocks are now written in background,mckusick2000-01-131-3/+13
| | | | | | | | | | it is no longer sufficient to get a lock on a buffer to know that its write has been completed. We have to first get the lock on the buffer, then check to see if it is doing a background write. If it is doing background write, we have to wait for the background write to finish, then check to see if that fullfilled our dependency, and if not to start another write. Luckily the explanation is longer than the fix.
* A panic occurs during an fsync when a dirty block associated withmckusick2000-01-131-4/+7
| | | | | | | | | | | a vnode has not been written (which would clear certain of its dependencies). The problems arises because fsync with MNT_NOWAIT no longer pushes all the dirty blocks associated with a vnode. It skips those that require rollbacks, since they will just get instantly dirty again. Such skipped blocks are marked so that they will not be skipped a second time (otherwise circular dependencies would never clear). So, we fsync twice to ensure that everything will be written at least once.
* We cannot proceed to free the blocks of the file until the dependenciesmckusick2000-01-111-29/+32
| | | | | | have been cleaned up by deallocte_dependencies(). Once that is done, it is safe to post the request to free the blocks. A similar change is also needed for the freefile case.
* Give vn_isdisk() a second argument where it can return a suitable errno.phk2000-01-101-3/+4
| | | | Suggested by: bde
* Missing FREE_LOCK call before handle_workitem_freeblocks.mckusick2000-01-101-3/+5
| | | | Submitted by: "Kenneth D. Merry" <ken@kdm.org>
* Several performance improvements for soft updates have been added:mckusick2000-01-101-57/+185
| | | | | | | | | | | | | | | 1) Fastpath deletions. When a file is being deleted, check to see if it was so recently created that its inode has not yet been written to disk. If so, the delete can proceed to immediately free the inode. 2) Background writes: No file or block allocations can be done while the bitmap is being written to disk. To avoid these stalls, the bitmap is copied to another buffer which is written thus leaving the original available for futher allocations. 3) Link count tracking. Constantly track the difference in i_effnlink and i_nlink so that inodes that have had no change other than i_effnlink need not be written. 4) Identify buffers with rollback dependencies so that the buffer flushing daemon can choose to skip over them.
* Keep tighter control of removal dependencies by limiting the numbermckusick2000-01-091-20/+22
| | | | | | of dirrem structure rather than the collaterally created freeblks and freefile structures. Limit the rate of buffer dirtying by the syncer process during periods of intense file removal.
* Reorganize softdep_fsync so that it only does the inode-is-flushedmckusick2000-01-091-26/+22
| | | | | | | | | check before the inode is unlocked while grabbing its parent directory. Once it is unlocked, other operations may slip in that could make the inode-is-flushed check fail. Allowing other writes to the inode before returning from fsync does not break the semantics of fsync since we have flushed everything that was dirty at the time of the fsync call.
* Make static non-exported functions from soft updates.mckusick2000-01-091-6/+12
|
* The function request_cleanup() had a tsleep() with PCATCH. It ismckusick1999-12-161-1/+1
| | | | | | | | | | | | quite dangerous, since the process may hold locks at the point, and if it is stopped in that tsleep the machine may hang. Because the sleep is so short, the PCATCH is not required here, so it has been removed. For the future, the FreeBSD team needs to decide whether it is still reasonable to stop a process in tsleep, as that may affect any other code that uses PCATCH while holding kernel locks. Submitted by: Dmitrij Tejblum <tejblum@arc.hq.cti.ru> Reviewed by: Kirk McKusick <mckusick@mckusick.com>
* Lock reporting and assertion changes.eivind1999-12-111-1/+1
| | | | | | | | | | | | | | | * lockstatus() and VOP_ISLOCKED() gets a new process argument and a new return value: LK_EXCLOTHER, when the lock is held exclusively by another process. * The ASSERT_VOP_(UN)LOCKED family is extended to use what this gives them * Extend the vnode_if.src format to allow more exact specification than locked/unlocked. This commit should not do any semantic changes unless you are using DEBUG_VFS_LOCKS. Discussed with: grog, mch, peter, phk Reviewed by: peter
* Fix typo, add $FreeBSD$billf1999-12-031-1/+3
|
* Convert various pieces of code to use vn_isdisk() rather than checkingphk1999-11-221-4/+4
| | | | | | | | for vp->v_type == VBLK. In ccd: we don't need to call VOP_GETATTR to find the type of a vnode. Reviewed by: sos
* struct mountlist and struct mount.mnt_list have no business beingphk1999-11-201-2/+1
| | | | | | | | | | a CIRCLEQ. Change them to TAILQ_HEAD and TAILQ_ENTRY respectively. This removes ugly mp != (void*)&mountlist comparisons. Requested by: phk Submitted by: Jake Burkholder jake@checker.org PR: 14967
* $Id$ -> $FreeBSD$peter1999-08-282-2/+2
|
* Decommision miscfs/specfs/specdev.h. Most of it goes into <sys/conf.h>,phk1999-08-081-2/+2
| | | | | | a few lines into <sys/vnode.h>. Add a few fields to struct specinfo, paving the way for the fun part.
* No longer need to set B_ASYNC flag since BUF_KERNPROC nowmckusick1999-06-291-2/+1
| | | | unconditionally sets the identity of the buffer.
* Keep the inlines for <sys/buf.h> happy..peter1999-06-271-3/+3
|
* Convert buffer locking from using the B_BUSY and B_WANTED flags to usingmckusick1999-06-261-9/+13
| | | | | | | lockmgr locks. This commit should be functionally equivalent to the old semantics. That is, all buffer locking is done with LK_EXCLUSIVE requests. Changes to take advantage of LK_SHARED and LK_RECURSIVE will be done in future commits.
* Add a vnode argument to VOP_BWRITE to get rid of the last vnodemckusick1999-06-161-12/+14
| | | | | operator special case. Delete special case code from vnode_if.sh, vnode_if.src, umap_vnops.c, and null_vnops.c.
* Get rid of the global variable rushjob and replace it with a function inmckusick1999-06-151-41/+45
| | | | | kern/vfs_subr.c named speedup_syncer() which handles the speedup request. Change the various clients of rushjob to use the new function.
* Cosmetic changes to make it compile without errors in gcc -Walljulian1999-05-221-10/+17
|
* Add a hook to ffs_fsync to allow soft updates to get first chance at doingmckusick1999-05-141-28/+97
| | | | | | a sync on the block device for the filesystem. That allows it to push the bitmap blocks before the inode blocks which greatly reduces the number of inode rollbacks that need to be done.
* Put back changes that might be causing trouble on Alpha.mckusick1999-05-091-3/+5
|
* Whitespace cleanup.mckusick1999-05-071-2/+2
|
* Get rid of random debugging cruft; sync up with latest version.mckusick1999-05-071-38/+10
|
* Severe slowdowns have been reported when creating or removing manymckusick1999-05-071-108/+290
| | | | | | | | | | | | | | | | | | | | | | files at once on a filesystem running soft updates. The root of the problem is that soft updates limits the amount of memory that may be allocated to dependency structures so as to avoid hogging kernel memory. The original algorithm just waited for the disk I/O to catch up and reduce the number of dependencies. This new code takes a much more aggressive approach. Basically there are two resources that routinely hit the limit. Inode dependencies during periods with a high file creation rate and file and block removal dependencies during periods with a high file removal rate. I have attacked these problems from two fronts. When the inode dependency limits are reached, I pick a random inode dependency, UFS_UPDATE it together with all the other dirty inodes contained within its disk block and then write that disk block. This trick usually clears 5-50 inode dependencies in a single disk I/O. For block and file removal dependencies, I pick a random directory page that has at least one remove pending and VOP_FSYNC its directory. That releases all its removal dependencies to the work queue. To further hasten things along, I also immediately start the work queue process rather than waiting for its next one second scheduled run.
* Reorganize locking to avoid holding the lock during calls to bdwritemckusick1999-03-021-3/+9
| | | | | | and brelse (which may sleep in some systems). Obtained from: Matthew Dillon <dillon@apollo.backplane.com>
* Ensure that softdep_sync_metadata can handle bmsafemap and mkdir entriesmckusick1999-03-022-5/+48
| | | | | if they ever arise (which should not happen as softdep_sync_metadata is currently used).
OpenPOWER on IntegriCloud