summaryrefslogtreecommitdiffstats
path: root/sys/kern/vfs_bio.c (follow)
Commit message (Collapse)AuthorAgeFilesLines
* Ensure that if we are doing a delayed write with a NOCACHE buffer, webeck2020-04-291-1/+2
| | | | | | | | clear the NOCACHE flag, since if we are doing a delayed write the buffer must be cached or it is thrown away when the "write" is done. fixes vnd on mfs regress tests. ok kettenis@ deraadt@
* Revert previous. Something in it causes unexpected slowdown.visa2020-03-121-4/+2
|
* Enable caching when turning a synchronous write into a delayed write.visa2020-03-121-2/+4
| | | | | | | Otherwise the write will be discarded, which would prevent use of vnd(4) on top of an async-mounted file system. OK beck@
* Make an assertion free from side effects. The intention was probably toanton2020-03-041-2/+2
| | | | | | | assert that the wire count is equal to 1 and not unconditionally set it to 1. ok kettenis@ mpi@
* invert some if logic to shortcircuit some loops and reduce nesting.tedu2020-01-261-110/+111
| | | | no function change.
* clear B_NOCACHE if the buffer has dependencies for softdep, sincebeck2019-12-301-1/+8
| | | | | | | | | | otherwise we are guaranteed to panic a few lines down in softdep_deallocate_dependencies. Found by Matthias Pitzl <matthias_pitzl@genua.de> running vnd's on top of a softdep filesystem. ok bluhm@ deraadt@
* Convert infinite sleeps to tsleep_nsec(9).mpi2019-12-081-5/+5
| | | | ok visa@, jca@
* Re commit what was committed in version 1.43 with a fix added tobeck2019-11-291-1/+19
| | | | | | | | | | | | | ensure we handle the uvm_objects of bread_cluster buffers correctly. Original commit message: Fix the buffer cache code to not use a giant uvm obj of all pages when a small one on each buf is all that is needed. reduces the cost of large frees by about 25%. Again, lots of assistence from kettenis and mlarkin still ok kettenis@
* Fix a spelling error in a comment and remove some extra whitespacemlarkin2019-11-151-4/+4
| | | | in a few places. No code change.
* getblk(9): tsleep(9) -> tsleep_nsec(9); ok visa@cheloha2019-07-191-5/+6
|
* Don't unconditionally throw away dma memory when we don't need to.beck2019-05-091-3/+5
| | | | | Noticed by me and otto@ ok tedu@
* Modify the buffer cache to always flip recovered DMA buffers high.beck2019-05-081-30/+121
| | | | | | | | This also modifies the backoff logic to only back off what is requested and not a "mimimum" amount. Tested by me, benno@, tedu@ anda ports build by naddy@. ok tedu@
* if a write fails, we mark the buffer invalid and throw it away. this cantedu2019-02-171-1/+6
| | | | | | | lead to lost errors, where a later fsync will return success. to fix this, set a flag on the vnode indicating a past error has occurred, and return an error for future fsync calls. ok bluhm deraadt visa
* free(9) sizes for bread_cluser().mpi2018-11-211-5/+5
| | | | ok mikeb@, visa@
* Simplify the startup of the cleaner, reaper and update threads byvisa2018-08-131-4/+2
| | | | | | | | | | | | | 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@
* Revisit 2q queue sizes. Limit the hot queue to 1/20th the cache size upbeck2017-08-271-3/+11
| | | | | | | to a max of 4096 pages. Limit the warm and cold queues to half the cache. This allows us to more effectively notice re-interest in buffers instead of losing it in a large hot queue. Discussed and shown with claudio@ and benno@ at tk217
* Add some buffercache docssf2017-08-221-1/+10
| | | | | | | * add clarifications and bread_cluster() buffercache(9) * add some comments to vfs_bio.c ok tedu@
* Invalidate read-ahead buffers when read shortmikeb2017-07-121-3/+19
| | | | | | | | | | | | | | | | | | Buffercache performs read-ahead for cluster reads by extending the length of an original read operation to the MAXPHYS (64k). Upon I/O completion, the length is trimmed and the buffer is returned to the filesystem and the remaining data is cached. However, under certain circumstances, the underlying hardware may fail to do a complete I/O operation and return with a non- zero value of the residual length (i.e. data that wasn't read). The residual length may exceed the size of an original request and must be re-adjusted to uphold the contract with the caller, e.g. the filesystem. At the same time, read-ahead buffers that cover chunks of memory corresponding to the residual length must be invalidated and not cached. Discussed at length during d2k17, ok tedu
* ensure the buffer cache backs off all the way with the correct typebeck2017-04-181-3/+7
| | | | | of memory, handling the fact that both queues are actually in dma space when not flipping buffers high
* Flip previously warm pages in the buffer cache to memory above the DMAbeck2017-04-161-29/+166
| | | | | | region if uvm tells us it is available. nits from deraadt@ ok krw@ guenther@ kettenis@
* Switch geteblks()'s size argument from int to size_t. It's called withnatano2017-02-281-2/+2
| | | | | | | unsigned variables as argument in most places anyway. Decrease the chance of signedness/range mismatch issues. ok stefan
* 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@
* move buf_rb_bufs from RB macros to RBT functionsdlg2016-09-161-11/+8
| | | | | i had to shuffle the order of some header bits cos RBT_PROTOTYPE needs to see what RBT_HEAD produces.
* all pools have their ipl set via pool_setipl, so fold it into pool_init.dlg2016-09-151-3/+2
| | | | | | | | | | | | | | | | | | | | | | the ioff argument to pool_init() is unused and has been for many years, so this replaces it with an ipl argument. because the ipl will be set on init we no longer need pool_setipl. most of these changes have been done with coccinelle using the spatch below. cocci sucks at formatting code though, so i fixed that by hand. the manpage and subr_pool.c bits i did myself. ok tedu@ jmatthew@ @ipl@ expression pp; expression ipl; expression s, a, o, f, m, p; @@ -pool_init(pp, s, a, o, f, m, p); -pool_setipl(pp, ipl); +pool_init(pp, s, a, ipl, f, m, p);
* Remove support for tape block devices. Nobody mount(8)s tapes any longer.naddy2016-09-041-9/+2
| | | | ok deraadt@ guenther@
* per trending style, add continue to empty loops.tedu2016-06-071-3/+3
| | | | ok mglocker
* - add realloc_pages to move a buffer's physmem from one range to another.beck2016-03-171-2/+2
| | | | | | | | - modify B_DMA handling to be in vfs_biomem.c - change buffer allocation to try allocations with NOWAIT and to throw away clean pages if allocation fails - allocate with WAITOK only if you can't throw away enough pages to succeed "probably sound" deraadt@
* Start some refactoring in here. this gets bufadjust outbeck2016-03-101-20/+36
| | | | of the hibernate path and starts preparing for some other work in here
* Do not fetch the same block multiple times if it is already presentmpi2016-03-061-2/+8
| | | | | | | | | | | | | | in the buffer cache. When the Dynamic Buffer Cache has been introduced bread_cluster() became the replacement of cluster_read(). However this function did not consider the B_CACHE flag of the first buffer of a cluster like its predecessor did. This improves a lot read operations on MSDOSFS while reducing the number of DMA operations. ok beck@
* move buffer size adjustment to buf_adjcnt - from Walter Netobeck2015-11-281-1/+8
| | | | ok mpi@
* Use two 2q caches for the buffer cache, moving previously warm buffers from thebeck2015-07-191-52/+162
| | | | | | | first queue to the second. Mark the first queue as DMA in preparation for being able to use more memory by flipping. Flipper code currently only sets and clears the flag. ok tedu@ guenther@
* Remove some includes include-what-you-use claims don'tjsg2015-03-141-6/+1
| | | | | | | have any direct symbols used. Tested for indirect use by compiling amd64/i386/sparc64 kernels. ok tedu@ deraadt@
* Introduce VM_KERNEL_SPACE_SIZE as a replacement formiod2015-02-071-2/+2
| | | | | | | (VM_MAX_KERNEL_ADDRESS - VM_MIN_KERNEL_ADDRESS). This will allow these to no longer be constants in the future. ok guenther@
* Revert 1.166 (but keep the bufq_wait() interface change), for this is wrongmiod2015-01-181-5/+3
| | | | | | | | | and the bufq pointer might be NULL at the time it is `saved'. Found the hard way on sparc due to the limited kva, with all disk active processes ending up sleeping on "buf_needva". ok kettenis@ krw@
* save the bufq pointer from the buf before we turn it loose so it won'ttedu2015-01-091-3/+5
| | | | | | change on us. also, remove unused second arg to bufq_wait. from pedro at bitrig via david hill. ok beck kettenis
* primary change: move uvm_vnode out of vnode, keeping only a pointer.tedu2014-12-161-1/+3
| | | | | | 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
* typos; from kaspars bankovskisjmc2014-12-111-3/+3
|
* Now that the cleaner yields the cpu, we can stop checkingblambert2014-10-081-11/+1
| | | | | | to see if we've hogged the cpu for >1 second. okay miod@
* Make the cleaner, syncer, pagedaemon, aiodone daemons allblambert2014-09-091-1/+3
| | | | | | yield() if the cpu is marked SHOULDYIELD. ok miod@ tedu@ phessler@
* replace LRU bufcache with something originally modelled after 2Q.tedu2014-08-311-11/+151
| | | | | | | this should provide a degree of scan resistance, and also serves as a midway point for further development of multi queue algorithms. i've tried to minimize the risk and degree of regressions. probably ok beck
* trim some caststedu2014-07-131-2/+2
|
* use mallocarray where arguments are multipled. ok deraadttedu2014-07-131-2/+2
|
* add a size argument to free. will be used soon, but for now default to 0.tedu2014-07-121-3/+3
| | | | after discussions with beck deraadt kettenis.
* Flush the buffercache to 16MB on hibernate and restore its previous maxmlarkin2014-07-111-1/+33
| | | | | | size (kern.bufcachepercent) on resume, for better hibernate performance. ok beck@
* decouple struct uvmexp into a new file, so that uvm_extern.h and sysctl.hderaadt2014-07-081-3/+1
| | | | | don't need to be married. ok guenther miod beck jsing kettenis
* pull the bufcache freelist code out into separate functions to allow newtedu2014-04-101-77/+75
| | | | | | algorithms to be tested. in the process, drop support for unused B_AGE and b_synctime options. previous versions ok beck deraadt
* get rid of the kernel high and low water marks for pages and replace withbeck2014-01-251-48/+35
| | | | | | a single target of used pages in the cache - so we don't to a ton of work throwing away pages sporadically while holding the biglock - noticed by dlg. ok dlg@ deraadt@
* Don't keep removed files (B_INVAL bufs) in the buffer cache. Free buffersbeck2013-12-091-36/+22
| | | | | once brelse() is called and the buffer is B_INVAL. ok jsing@ krw@
* Uncomment kprintf format attributes for sys/kernsyl2013-08-081-3/+4
| | | | tested on vax (gcc3) ok miod@
* back out the cache flipper temporarily to work out of tree.beck2013-07-091-263/+101
| | | | | will come back soon. ok deraadt@