summaryrefslogtreecommitdiffstats
path: root/sys/kern/vfs_bio.c (follow)
Commit message (Collapse)AuthorAgeFilesLines
* Fix a few issues in the pressure logic when the available buffers run low:miod2012-05-301-5/+7
| | | | | | | | | | | | | | | | - make sure the buffer reclaiming loop in buf_get() actually does something but spin, if `backoffpages' is nonzero and all free queues have been drained. - don't forget to set a poor man's condition variable to nonzero before tsleeping on it in bufadjust(), otherwise you'll never get woken up. - don't be too greedy and reassing backoffpages a large amount immediately after bufadjust() has been called. This fixes reproduceable hangs seen during heavy I/O (such as `make install' of many large files, e.g. run in /usr/src/lib with NOMAN=) on systems with a challenged number of pages (less than a few thousands, total). Part of this is temporary bandaid until a better pressure logic is devised, but it's solving an immediate problem. Been in snapshots for a solid month.
* Make rusage totals, itimers, and profile settings per-process insteadguenther2012-03-231-5/+5
| | | | | | | of per-rthread. Handling of per-thread tick and runtime counters inspired by how FreeBSD does it. ok kettenis@
* clean up buffer cache statistics somewhat tobeck2011-09-191-8/+10
| | | | | | | | | | remove some now useless statistics, and add some relevant ones regarding kva usage in the cache. make systat io and show bcstats in ddb both show these counters. ok deraadt@ krw@
* the rest of the uvm commit - I commited from uvm instead of sysbeck2011-07-061-2/+2
| | | | (part missed from previous commit)
* move the specfs code to a place people can see it; ok guenther thib krwderaadt2011-07-041-3/+2
|
* bread does nothing with its ucred argument. remove it. ok matthewtedu2011-07-041-4/+3
|
* Move the bufcachepercent setting code to MI locations -- set it to 42%deraadt2011-06-051-7/+1
| | | | | | | for now; that is unlikely to hit some of the remaining starvation bugs. Repair the bufpages calculation too; i386 was doing it ahead of time (incorrectly) and then re-calculating it. ok thib
* Revert previous diff decrementing bcstats.numbufpages here. This functionbeck2011-04-071-3/+4
| | | | | | | | | | does not do what it purports to do, it shrinks mapping, not allocation, as the pages have already been given away to other buffers. This also renames the function to make this a little more obvious and art should not name funcitons ok thib@, art@
* Constrain the buffer cache to use only the dma reachable region of memory.beck2011-04-021-4/+7
| | | | | | With this change bufcachepercent will be the percentage of dma reachable memory that the buffer cache will attempt to use. ok deraadt@ thib@ oga@
* backout 1.86deraadt2010-11-131-12/+1
| | | | | | it is totally wrong to convert bdwrite into bawrite on the fly. this just causes way bigger issues. ok beck blambert
* matthew did not commit the diff he passed around for us to inspect...deraadt2010-08-031-2/+2
| | | | repair that situation. Darn newbies...
* If an asynchronous request invalidates a buf, then we might remove itmatthew2010-08-031-6/+10
| | | | | | | from its vnode's buffer cache in an interrupt context. Therefore we need interrupt protection when searching the buffer red-black tree. ok deraadt@, thib@, art@
* Call bufq_done at the top of biodone, so we don't call it onthib2010-07-011-1/+4
| | | | a freed buf as that causes problems...
* Disable/partially backout the bufq quiesce changes as thisthib2010-06-301-4/+1
| | | | is causing havoc with vnds and release must be buildable.
* Introduce bufq_quiesce(), which will block I/O ifrom getting on the queues,kettenis2010-06-291-1/+4
| | | | | | | | | and waits until all I/O currently on the queues has been completed. To get I/O going again, call bufq_restart(). To be used for suspend/resume. Joint effort with thib@, tedu@; tested by mlarkin@, marco@
* Use correct format specifiers for 'show bcstats'.jsing2010-02-051-5/+6
| | | | ok beck@ krw@
* two things:beck2009-08-081-7/+33
| | | | | | | | 1) fix buffer cache low water mark to allow for extremely low memory machines without dying 2) Add "show bcstats" to ddb to allow for looking at the buffer cache statistics in ddb ok art@ oga@
* Dynamic buffer cache support - a re-commit of what was backed outbeck2009-08-021-40/+167
| | | | | | | | after c2k9 allows buffer cache to be extended and grow/shrink dynamically tested by many, ok oga@, "why not just commit it" deraadt@
* backout the buf_acquire() does the bremfree() since all callersthib2009-06-251-1/+3
| | | | | | | | | | where doing bremfree() befure calling buf_acquire(). This is causing us headache pinning down a bug that showed up when deraadt@ too cvs to current, and will have to be done anyway as a preperation for backouts. OK deraadt@
* Back out all the buffer cache changes I committed during c2k9. This reverts threebeck2009-06-151-167/+40
| | | | | | | | | | commits: 1) The sysctl allowing bufcachepercent to be changed at boot time. 2) The change moving the buffer cache hash chains to a red-black tree 3) The dynamic buffer cache (Which depended on the earlier too). ok on the backout from marco and todd
* All caller of buf_acquire were doing bremfree before the call.art2009-06-061-3/+1
| | | | | Just put it in the buf_acquire function. oga@ ok
* Dynamic buffer cache sizing.beck2009-06-051-5/+109
| | | | | | | | | | | | | | | | | | | | | | | This commit won't change the default behaviour of the system unless the buffer cache size is increased with sysctl kern.bufcachepercent. By default our buffer cache is 10% of memory, which with this commit is now treated as a low water mark. If the buffer cache size is increased, the new size is treated as a high water mark and the buffer cache is permitted to grow to that percentage of memory. If the page daemon is invoked, the page daemon will ask the buffer cache to relenquish pages. if the buffer cache has more than the low water mark it will relenquish pages allowing them to be consumed by uvm. after a short period the buffer cache will attempt to re-grow back to the high water mark. This permits the use of a large buffer cache without penalizing the available memory for other purposes. Above the low water mark the buffer cache remains entirely subservient to the page daemon, so if uvm requires pages, the buffer cache will abandon them. ok art@ thib@ oga@
* add kern.bufcachepercent sysctl to allow adjusting the buffer cachebeck2009-06-031-1/+28
| | | | | size on a running system. ok art@, oga@
* Change bufhash from the old grotty hash table to red-black trees hangingbeck2009-06-031-36/+32
| | | | | off the vnode. ok art@, oga@, miod@
* Make the interactions in allocating buffers less confusing.art2009-04-221-225/+141
| | | | | | | | | | | | | | | | | | | | - getnewbuf dies. instead of having getnewbuf, buf_get, buf_stub and buf_init we now have buf_get that is smaller than some of those functions were before. - Instead of allocating anonymous buffers and then freeing them if we happened to lose the race to the hash, always allocate a buffer knowing which <vnode, block> it will belong to. - In cluster read, instead of allocating an anonymous buffer to cover the whole read and then stubs for every buffer under it, make the first buffer in the cluster cover the whole range and then shrink it in the callback. now, all buffers are always on the correct hash and we always know their identity. discussed with many, kettenis@ ok
* fix buffer cache pending writs statistic so it does not go negative.beck2009-03-231-6/+9
| | | | | | | | | this ensures we ignore counting any buffers returning through biodone() for which B_PHYS has been set - which should be set on all transfers that manually do raw io bypassing the buffer cache by setting up their own buffer and calling strategy.. ok thib@, todd@, and now that he is a buffer cache and nfs hacker oga@
* backout revision 1.109oga2009-01-111-5/+1
| | | | | | | | | "keep b_proc set to the process, thats doing the io as advertised" This broke dvd playing on my laptop (page fault trap in vmapbuf in the physio path). thib's cookie privileges are hereby suspended until further notice.
* keep b_proc set to the proccess,thib2009-01-091-1/+5
| | | | | | | | thats doing the io as advertised closes PR3948 OK tedu@ (and blambert@ I think).
* Move diagnostic assertions concerning the recycle process of bufferspedro2008-11-221-21/+5
| | | | | | | from getnewbuf() to buf_put(), since getnewbuf() does not directly recycle buffers anymore. While at it, remove two lines of dead code from getnewbuf(), which used to disassociate a vnode from a buffer. "just go for it, because everyone had a chance" deraadt@.
* Belt, suspenders, duct tape and glue.art2008-06-141-1/+12
| | | | | | | | | | | In brelse, if we end up in the B_INVAL case without mappings, check for B_WANTED and wake up the sleeper if there's one before freeing the buffer. This shouldn't happen, but it looks like there might actually be some dodgy corner cases in nfs where this could just happen if the phase of the moon is right and the wind is blowing from the right direction. thib@ ok
* Bring biomem diff back into the tree after the nfs_bio.c fix went in.deraadt2008-06-121-260/+158
| | | | ok thib beck art
* back out biomem diff since it is not right yet. Doing very largederaadt2008-06-111-158/+260
| | | | | | | | file copies to nfsv2 causes the system to eventually peg the console. On the console ^T indicates that the load is increasing rapidly, ddb indicates many calls to getbuf, there is some very slow nfs traffic making none (or extremely slow) progress. Eventually some machines seize up entirely.
* Buffer cache revampbeck2008-06-101-260/+158
| | | | | | | | | | | | | | | | 1) remove multiple size queues, introduced as a stopgap. 2) decouple pages containing data from their mappings 3) only keep buffers mapped when they actually have to be mapped (right now, this is when buffers are B_BUSY) 4) New functions to make a buffer busy, and release the busy flag (buf_acquire and buf_release) 5) Move high/low water marks and statistics counters into a structure 6) Add a sysctl to retrieve buffer cache statistics Tested in several variants and beat upon by bob and art for a year. run accidentally on henning's nfs server for a few months... ok deraadt@, krw@, art@ - who promises to be around to deal with any fallout
* Widen some struct statfs fields to support large filesystem stataotto2008-03-161-1/+16
| | | | | and add some to be able to support statvfs(2). Do the compat dance to provide backward compatibility. ok thib@ miod@
* This QUEUE_DEBUG should really be DIAGNOSTIC - we need these checksbeck2007-10-211-2/+2
| | | | | normally. ok deraadt@ tedu@ otto@
* Correct possible spl problem in buffer cleaning daemon - the buffer cleaningbeck2007-10-181-2/+2
| | | | | | | | | daemon requires splbio when doing dirty buffer queue manipulation. Since version 1.88 of vfs_bio.c, it was possible to break out of the processing loop when the cleaner had been running long enough, and this early exit would mean a future pass through would manipulate the buffer queues not at splbio. This change corrects this. ok krw@, deraadt@, tedu@, thib@
* replace ctob and btoc with ptoa and atop respectivelymartin2007-09-151-19/+19
| | | | help and ok miod@ thib@
* A few changes to deal with multi-user performance issues seen. thisbeck2007-08-071-10/+31
| | | | | | | | | | | | brings us back roughly to 4.1 level performance, although this is still far from optimal as we have seen in a number of cases. This change 1) puts a lower bound on buffer cache queues to prevent starvation 2) fixes the code which looks for a buffer to recycle 3) reduces the number of vnodes back to 4.1 levels to avoid complex performance issues better addressed after 4.2 ok art@ deraadt@, tested by many
* Do not allow clustering read for filesystems which block size is smallermiod2007-07-091-4/+5
| | | | | | | than the hardware page size, as was the case in the old clustering code. This fixes vnd reads on alpha and sparc64 On behalf of pedro@, ok art@
* de-registerjasper2007-06-171-3/+3
| | | | ok thib@
* Protect access to 'bufhead' with splbio(), okay art@ millert@ marco@pedro2007-06-091-2/+2
|
* backout rev 1.91 and 1.92, it causes proceses to hang on low memotto2007-06-031-25/+20
| | | | machines. ok deraadt@
* Uninline bio_doread(), okay art@pedro2007-06-011-3/+3
|
* dont request zeroed memory when we allocate data regions for buffers. thisdlg2007-06-011-2/+2
| | | | | | | moves memset from the 20th most expensive function in the kernel to the 331st when doing heavy io. ok tedu@ thib@ pedro@ beck@ art@
* I suck. Forgot splx() in the early return path.art2007-05-291-1/+2
|
* Change getnewbuf from taking lots of sleep arguments and then doing magicart2007-05-291-20/+24
| | | | | | | | | | with them and trying to pass an error back after sleep, to just fail with NULL and let the caller wait for buffers. Introduce buf_wait() that does all the sleep magic and use buf_wait in the getnewbuf callers where it matters. pedro@ beck@ ok
* pool_setipl() on the bufpool, to make sure thatthib2007-05-281-1/+2
| | | | | | every get/put is at IPL_BIO. ok pedro@
* remove silly comment, okay deraadt@pedro2007-05-271-2/+1
|
* Dynamic buffer cache. Initial diff from mickey@, okay art@ beck@ toby@pedro2007-05-261-228/+439
| | | | deraadt@ dlg@.
* Retire B_LOCKED and BQ_LOCKED. The last real usage of thethib2006-10-211-24/+15
| | | | | | | | flag and the buffer queue went away when LFS was removed. ok, pedro@ "looks sane", deraadt@ testing: tybollt@solace.miun.se