summaryrefslogtreecommitdiff
path: root/sys/kern/vfs_bio.c
AgeCommit message (Collapse)Author
2005-11-06Use ANSI-style function declarations, no binary change, okay jsg@Pedro Martelletto
2005-10-08Revert revision 1.39. Under heavy load, it could cause severe corruptionPedro Martelletto
in the buffer lists by removing a buffer from the hash twice. Problem identified in discussion with Alexander Bluhm <Alexander_Bluhm@genua.de>.
2005-06-27When releasing a buffer and disassociating it from its vnode, there'sPedro Martelletto
no point in placing the buffer in the vnode's clean list just to remove it afterwards. Talked over with art@, various testing for a while.
2005-06-17Protect buf_countdeps() call in buf_daemon() with splbio(), okay art@Pedro Martelletto
2004-12-26Use list and queue macros where applicable to make the code easier to read;Miod Vallat
no change in compiler assembly output.
2004-12-11match comments with reality and use 'null' for pointers in incore()Pedro Martelletto
2004-12-05less then -> less thanJonathan Gray
2004-11-30kill breada(), from Sven Dehmlow. ok tedu@ millert@Pedro Martelletto
2004-11-01englishPedro Martelletto
2004-09-20spl dance to protect buffer flags in a sensitive contextPedro Martelletto
ok millert@ tedu@
2004-06-24This moves access to wall and uptime variables in MI code,Thorsten Lockert
encapsulating all such access into wall-defined functions that makes sure locking is done as needed. It also cleans up some uses of wall time vs. uptime some places, but there is sure to be more of these needed as well, particularily in MD code. Also, many current calls to microtime() should probably be changed to getmicrotime(), or to the {,get}microuptime() versions. ok art@ deraadt@ aaron@ matthieu@ beck@ sturm@ millert@ others "Oh, that is not your problem!" from miod@
2003-06-02Remove the advertising clause in the UCB license which BerkeleyTodd C. Miller
rescinded 22 July 1999. Proofed by myself and Theo.
2003-05-13Fix the tree. Jason, you were such a rock star yesterday, but it obviouslyTheo de Raadt
blinded you to the fact you were breaking ALL of our install media!
2003-05-13Kill a bunch more commons (very few left =)Jason Wright
2002-06-09Use LIST_FOREACH.Artur Grabowski
2002-06-09ANSIfy (started as some other change that just ran away).Artur Grabowski
2002-05-24protect more of the bookkeeping variables with splbio.Artur Grabowski
2002-05-24typoArtur Grabowski
2002-05-22some b_iodone handlers and vwakeup require splbio.Artur Grabowski
Mark biodone with splassert(IPL_BIO).
2002-05-16sprinkle some splassert(IPL_BIO) in some functions that are commented as ↵Artur Grabowski
"should be called at splbio()"
2002-04-27Comment biodone as "must be called at splbio".Artur Grabowski
It calls vwakeup and vwakeup is marked as "must be at splbio".
2002-03-14First round of __P removal in sysTodd C. Miller
2002-01-30Move SET/CLR/ISSET macros to param.h. fgsch@ and millert@ okThomas Nordin
2002-01-23Pool deals fairly well with physical memory shortage, but it doesn't dealArtur Grabowski
well (not at all) with shortages of the vm_map where the pages are mapped (usually kmem_map). Try to deal with it: - group all information the backend allocator for a pool in a separate struct. The pool will only have a pointer to that struct. - change the pool_init API to reflect that. - link all pools allocating from the same allocator on a linked list. - Since an allocator is responsible to wait for physical memory it will only fail (waitok) when it runs out of its backing vm_map, carefully drain pools using the same allocator so that va space is freed. (see comments in code for caveats and details). - change pool_reclaim to return if it actually succeeded to free some memory, use that information to make draining easier and more efficient. - get rid of PR_URGENT, noone uses it.
2001-12-19UBC was a disaster. It worked very good when it worked, but on someArtur Grabowski
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.
2001-11-30Call buf_cleanout, which handles wakeupsConstantine Sapuntzakis
2001-11-27kill breadaArtur Grabowski
2001-11-27Merge in the unified buffer cache code as found in NetBSD 2001/03/10. TheArtur Grabowski
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.
2001-11-15bio_doread doesn't need a cred anymoreArtur Grabowski
2001-11-15Remove creds from struct buf, move the creds that nfs need into the nfs node.Artur Grabowski
While in the area, convert nfs node allocation from malloc to pool and do some cleanups. Based on the UBC changes in NetBSD. niklas@ ok.
2001-11-09Create bufpool - a pool of struct bufs.Artur Grabowski
2001-11-06Replace inclusion of <vm/foo.h> with the correct <uvm/bar.h> when necessary.Miod Vallat
(Look ma, I might have broken the tree)
2001-10-28we try to test things before commit, artTheo de Raadt
2001-10-28Sprinkle some assertions in the buffer code.Artur Grabowski
Add a new DEBUG function "buf_print" that prints the contents of struct buf.
2001-10-11Fix flawed logic when deciding if we should sleep whenArtur Grabowski
we are below the low watermark or if we should try to use up all buffers.
2001-10-11Count pages not buffers. This fixes deadlock condition which mainlyGrigoriy Orlov
occurs on the fs with large block size. We can have situation where numcleanbufs < locleanbufs and numdirtybufs < hidirtybufs. So, buffer flushing daemon never wakeups and other processes asleep forever waiting for a clean buffers. We count pages only for the dirty buffers which are on freelist(BQ_DIRTY). niklas@ found this. Rename flasher to cleaner. Suggested by costa@. Discussed with niklas@, costa@, millert@, art@. Ok deraadt@.
2001-09-20Get rid of B_VFLUSH. Tested by costa and me.Grigoriy Orlov
2001-09-19No need for this complicated (and bug-prone) method for waking up the flusher.Artur Grabowski
2001-09-17 The first implementation of the buffer flushing daemon. It solves ourGrigoriy Orlov
problem when syncer can't do its work because of vnode locks (PR1983). This also solves our problem where bigger number of buffers results in a much worse perfomance. In my configuration (i386, 128mb, BUFCACHEPERCENT=35) this speedup tar -xzf ports.tar.gz in 2-4 times. In configuration with low number of buffers and softupdates this may slowdown some operations up to 15%. The major difference with current buffer cache is that new implementation uses separate queues for dirty and clean buffers. I.e. BQ_LRU and BQ_AGE replaced by BQ_CLEAN and BQ_DIRTY. This simplifies things a lot and doesn't affect perfomance in a bad manner. Thanks to art and costa for pointing on errors. Tested by brad, millert, naddy, art, jj, camield art, millert ok.
2001-09-10remove useless debug function.Grigoriy Orlov
2001-08-30Change getnewbuf interface so that getnewbuf always returnGrigoriy Orlov
a new buffer and indicate if it sleep while getting that buffer. This isn't make a much sense, but farther modifications will use it. Work by art@
2001-05-05Get rid of CLSIZE and all related stuff.Artur Grabowski
CLSIZE -> 1 CLBYTES -> PAGE_SIZE OLOFSET -> PAGE_MASK etc. At the same time some archs needed some cleaning in vmparam.h so that goes in at the same time.
2001-04-06Avoid a livelock problem where the buffer cache code would beGrigoriy Orlov
recycling B_AGE buffers with dependencies. >From NetBSD. costa@ ok.
2001-03-30Avoid a 'thundering herd' problem when many processes wait for free buffers.Artur Grabowski
Just wakeup one process (there is a possible bug here that will be fixed in the next round of cleanup). Some misc cleanup, especially in the comments.
2001-03-14Slight cleanup.Artur Grabowski
2001-03-13Reserve some buffers for syncer daemon. This prevent deadlock in getblkGrigoriy Orlov
and getnewbuf. One process can sleep at "getnewbuf" waiting for a free buffer and it may held buffer 'A' busy. Other processes can return buffers on free lists, but they sleep on "getblk" waiting for buffer 'A'. art@ ok.
2001-03-09Remove random trailing whitespace.Artur Grabowski
From gluk.
2001-02-27art@ found a race in getnewbuf. bawrite can block so we need to restartConstantine Sapuntzakis
the whole buffer allocation process
2001-02-24Cleanup of vnode interface continues. Get rid of VHOLD/HOLDRELE.Constantine Sapuntzakis
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
2001-02-23Change the B_DELWRI flag using buf_dirty and buf_undirty instead ofConstantine Sapuntzakis
manually twiddling it. This allows the buffer cache to more easily keep track of dirty buffers and decide when it is appropriate to speed up the syncer. Insipired by FreeBSD. Look over by art@