summaryrefslogtreecommitdiffstats
path: root/sys/kern/vfs_sync.c (follow)
Commit message (Collapse)AuthorAgeFilesLines
* Simplify the startup of the cleaner, reaper and update threads byvisa2018-08-131-5/+4
| | | | | | | | | | | | | passing the main function directly to kthread_create(9). The start_* functions are mere stepping stones nowadays and can be pruned. They used to contain more logic in the pre-kthread era. While here, set `cleanerproc' and `syncerproc' during the thread creation rather than expect the threads to set the proc pointer. Also, rename `sched_sync' to `syncer_thread' to reduce confusion with the scheduler-related functions. OK kettenis@, deraadt@, mpi@
* Drop unnecessary `p' parameter from vget(9).visa2018-05-271-2/+2
| | | | OK mpi@
* Clean up the parameters of VOP_LOCK() and VOP_UNLOCK(). It is alwaysvisa2018-04-281-2/+2
| | | | | | | curproc that does the locking or unlocking, so the proc parameter is pointless and can be dropped. OK mpi@, deraadt@
* Syncronize filesystems to disk when suspending. Each mountpoint's vnodesderaadt2018-02-101-2/+2
| | | | | | | | | | are pushed to disk. Dangling vnodes (unlinked files still in use) and vnodes undergoing change by long-running syscalls are identified -- and such filesystems are marked dirty on-disk while we are suspended (in case power is lost, a fsck will be required). Filesystems without dangling or busy vnodes are marked clean, resulting in faster boots following "battery died" circumstances. Tested by numerous developers, thanks for the feedback.
* Convert most of the manual checks for CPU hogging to sched_pause().mpi2017-02-141-2/+2
| | | | | | | | The distinction between preempt() and yield() stays as it is usueful to know if a thread decided to yield by itself or if the kernel told him to go away. ok tedu@, guenther@
* Remove the unused flags argument from VOP_UNLOCK().natano2016-03-191-2/+2
| | | | | | torture tested on amd64, i386 and macppc ok beck mpi stefan "the change looks right" deraadt
* Remove some includes include-what-you-use claims don'tjsg2015-03-141-2/+1
| | | | | | | have any direct symbols used. Tested for indirect use by compiling amd64/i386/sparc64 kernels. ok tedu@ deraadt@
* primary change: move uvm_vnode out of vnode, keeping only a pointer.tedu2014-12-161-1/+2
| | | | | | objective: vnode.h doesn't include uvm_extern.h anymore. followup changes: include uvm_extern.h or lock.h where necessary. ok and help from deraadt
* Make the cleaner, syncer, pagedaemon, aiodone daemons allblambert2014-09-091-1/+3
| | | | | | yield() if the cpu is marked SHOULDYIELD. ok miod@ tedu@ phessler@
* Use time_t for storing time_t values, duhguenther2013-07-021-2/+2
| | | | ok deraadt@
* Every single vop_default is set to eopnotsupp, so retire itthib2011-04-051-2/+1
| | | | | | | | and return EOPNOTSUPP directly from the VOP_* functions. Filesystems should, at some point fill in every function in the vop_default struct so we can get rid of the 'if' statements in VOP_*.
* Bring back the "End the VOP experiment." diff, naddy's issues wherethib2010-12-211-26/+14
| | | | | | unrelated, and his alpha is much happier now. OK deraadt@
* Backout the VOP diff until the issues naddy was seeing on alpha (gcc3)thib2010-09-101-14/+26
| | | | have been resolved.
* End the VOP experiment. Instead of the ridicolusly complicated operationthib2010-09-061-26/+14
| | | | | | | | | | | | | | | | | | | vector setup that has questionable features (that have, as far as I can tell never been used in practice, atleast not in OpenBSD), remove all the gunk and favor a simple struct full of function pointers that get set directly by each of the filesystems. Removes gobs of ugly code and makes things simpler by a magnitude. The only downside of this is that we loose the vnoperate feature so the spec/fifo operations of the filesystems need to be kept in sync with specfs and fifofs, this is no big deal as the API it self is pretty static. Many thanks to armani@ who pulled an earlier version of this diff to current after c2k10 and Gabriel Kihlman on tech@ for testing. Liked by many. "come on, find your balls" deraadt@.
* no need for syncdelay to be a time_t, make it it an int. unstatic variablesthib2010-07-031-4/+4
| | | | | | | so I can twiddle them from ddb (not that I will mess with the hashmask, but static burns). ok tedu@
* - remove super-obvious comments from $fs_vnodeop_entries[]jasper2009-08-131-9/+9
| | | | | prodded by and ok thib@ agreed by art@ and blambert@
* retire vn_default_error() and replace all instancesthib2008-05-081-2/+2
| | | | | | with eopnotsupp() instead; ok blambert@
* pedro ok'd this ~3500 line diff which removes the vop argumentderaadt2007-06-011-13/+3
| | | | | "ap = v" comments in under 8 seconds, so it must be ok. and it compiles too.
* more fixes from bret lambert; ok pedrojmc2006-11-181-3/+3
|
* rename vfs_busy() flags VB_UMIGNORE/VB_UMWAIT to VB_NOWAIT/VB_WAITsturm2006-06-251-2/+2
| | | | requested by and ok pedro
* move vfs_busy() to rwlocks and properly hide the locking api from vfssturm2006-06-141-2/+2
| | | | ok tedu, pedro
* remove the simplelock argument from vfs_busy() which is currently notsturm2006-04-301-2/+2
| | | | | | used and will never be used this way in VFS requested by and ok pedro, ok krw, biorn
* Remove unused mount list simple_lock() goopedro2006-04-191-5/+3
|
* Put vprint() under DIAGNOSTIC, as to save space in generated ramdisks.pedro2006-01-091-1/+3
| | | | Inspiration from miod@, okay deraadt@. Tested on i386, macppc and amd64.
* No need for vfs_busy() and vfs_unbusy() to take a process pointerpedro2005-11-301-3/+3
| | | | anymore. Testing by jolan@, thanks.
* Use ANSI-style function declarations, no binary change, okay jsg@pedro2005-11-061-19/+9
|
* Remove v_vnlock from struct vnode, okay krw@ tedu@pedro2005-10-191-10/+2
|
* Make the syncer grab a reference for the vnode to avoid it from beingpedro2005-10-041-3/+3
| | | | | | | | reclaimed while in this sensitive time frame. That is needed when we don't have locks. Should fix the 'sched_sync: fsync failed' panic some people were seeing. Testing mostly by sturm@ and krw@, okay tedu@ and deraadt@.
* Protect the run queues with SCHED_LOCK, not just spl (ot nothing at all inart2005-05-311-3/+4
| | | | | | | one case fixed here). miod@ "appears to be harmless" markus@ ok
* sched work by niklas and art backed out; causes panicsderaadt2005-05-291-4/+3
|
* This patch is mortly art's work and was done *a year* ago. Art wants to thankniklas2005-05-251-3/+4
| | | | | | | | | | | | | | | | everyone for the prompt review and ok of this work ;-) Yeah, that includes me too, or maybe especially me. I am sorry. Change the sched_lock to a mutex. This fixes, among other things, the infamous "telnet localhost &" problem. The real bug in that case was that the sched_lock which is by design a non-recursive lock, was recursively acquired, and not enough releases made us hold the lock in the idle loop, blocking scheduling on the other processors. Some of the other processors would hold the biglock though, which made it impossible for cpu 0 to enter the kernel... A nice deadlock. Let me just say debugging this for days just to realize that it was all fixed in an old diff noone ever ok'd was somewhat of an anti-climax. This diff also changes splsched to be correct for all our architectures.
* silly typo...pedro2004-10-291-2/+2
|
* protect code dealing with the vnode sync list with splbio(). fixes thepedro2004-08-151-2/+13
| | | | | 'fsync failed' panic on amd64. discussed with and ok'd by art@, tedu@ and deraadt@. tested by many (thanks).
* Print more diagnostics on fsync failure in sched_sync.art2004-08-031-2/+7
|
* First step towards more sane time handling in the kernel -- this changestholo2004-06-211-3/+3
| | | | | | | | things such that code that only need a second-resolution uptime or wall time, and used to get that from time.tv_secs or mono_time.tv_secs now get this from separate time_t globals time_second and time_uptime. ok art@ niklas@ nordin@
* match syscallargs comments with realityhenning2003-09-011-1/+4
| | | | | from Patrick Latifi <patrick.l@hermes.usherb.ca> ok jason@ tedu@
* Remove the advertising clause in the UCB license which Berkeleymillert2003-06-021-6/+2
| | | | rescinded 22 July 1999. Proofed by myself and Theo.
* First round of __P removal in sysmillert2002-03-141-7/+7
|
* UBC was a disaster. It worked very good when it worked, but on someart2001-12-191-7/+10
| | | | | | | | | machines or some configurations or in some phase of the moon (we actually don't know when or why) files disappeared. Since we've not been able to track down the problem in two weeks intense debugging and we need -current to be stable, back out everything to a state it had before UBC. We apologise for the inconvenience.
* Merge in the unified buffer cache code as found in NetBSD 2001/03/10. Theart2001-11-271-10/+7
| | | | | | | code is written mostly by Chuck Silvers <chuq@chuq.com>/<chs@netbsd.org>. Tested for the past few weeks by many developers, should be in a pretty stable state, but will require optimizations and additional cleanups.
* Make sure that stuff on the syncer worklist has VBIOONSYNCLIST setart2001-11-151-2/+3
| | | | and stuff that isn't on the worklist doesn't have it set.
* KNFderaadt2001-06-221-20/+21
|
* No need to extern mountlist_slock here.art2001-03-161-3/+1
|
* Instead of doing VOP_ISLOCKED, vn_lock(..LK_RETRY..) we can do vn_lock(..LK_NOWAIT..).art2001-02-271-6/+12
| | | | | | | Also, when we fail to get the lock on the vnode we want to sync, push it ahead one second in time. XXX - this could lead to some vnodes not being synced for a long time, but that is better than a panic.
* Move splbio's around so that they cover the data structures they need tocsapuntz2001-02-241-9/+9
| | | | and don't cover the ones they don't
* Cleanup of vnode interface continues. Get rid of VHOLD/HOLDRELE.csapuntz2001-02-241-3/+3
| | | | | | | | | | | | Change VM/UVM to use buf_replacevnode to change the vnode associated with a buffer. Addition v_bioflag for flags written in interrupt handlers (and read at splbio, though not strictly necessary) Add vwaitforio and use it instead of a while loop of v_numoutput. Fix race conditions when manipulation vnode free list
* Try to avoid sleeping in the syncer waiting for vnode locks.csapuntz2001-02-231-5/+18
| | | | From FreeBSD
* Latest soft updates from FreeBSD/Kirk McKusickcsapuntz2001-02-211-18/+17
| | | | Snapshot-related code has been commented out.
* No need for our own declaration of lbolt.art2000-03-231-4/+1
|
* Drop SYNCER_MAXDELAY to 32. The delay is never bigger than 30 anyway.art2000-01-141-2/+2
|