summaryrefslogtreecommitdiffstats
path: root/sys/kern/kern_bufq.c (follow)
Commit message (Collapse)AuthorAgeFilesLines
* fairly simple sizes for free(); ok teduderaadt2015-08-281-3/+7
|
* Remove some includes include-what-you-use claims don'tjsg2015-03-141-3/+1
| | | | | | | have any direct symbols used. Tested for indirect use by compiling amd64/i386/sparc64 kernels. ok tedu@ deraadt@
* save the bufq pointer from the buf before we turn it loose so it won'ttedu2015-01-091-2/+2
| | | | | | change on us. also, remove unused second arg to bufq_wait. from pedro at bitrig via david hill. ok beck kettenis
* 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.
* Do not KASSERT an unsigned value being >= 0 after decrementing it; instead,miod2014-06-271-2/+2
| | | | | KASSERT it being > 0 before decrementing. ok dlg@
* now that all the direct users of disksort have been removed, we can nowdlg2013-11-201-74/+2
| | | | | | | | | | | | | | | | safely remove disksort. most hardware and pretty much all of the kernel has moved to logical block addressing when dealing with disks, so the assumptions disksort was built against arent useful these days. it also has bad edge cases with lots of sequential writes being able to starve other io requests in the system. these issues have been addressed by becks nscan implementation, which disksort was previously deprecated in favour of. this removes the guts of disksort and the bufq wrapper around it. ok miod@
* Fix various glitches in queue macro usage.guenther2013-04-101-2/+2
| | | | ok millert@
* nscan only operates in a single direction, remove leftover dir variable.tedu2013-03-181-2/+1
|
* use wakeup here, not wakeup_one - avoids problem of not waking up writersbeck2012-10-171-2/+2
| | | | | | | when there are more of them than size of queue waiting, and nothing else going on. ok miod@ kettenis@
* Capilization in comment, and document leftoverroom, + knf nit, spotted by theobeck2012-10-091-4/+4
|
* Add nscan as a disk queueing algorithm, and make it the default withbeck2012-10-091-1/+155
| | | | | | | | | | | | | | | | | | | n = 128. Nscan is essentially, the disksort() style elevator algorithm for ordering disk io operations. The difference is that we will re-order in chunks of 128 operations before continuing with the rest of the work. This avoids the problem that the basic SCAN (aka elevator algorithm) has where continued inserts can cause starvation, where requests can sit for a long time. This solves problems where usb sticks could be unusable while long sequential writes happened, and systems would become unresponsive while dumping core. hacked upon (and this version largely rewritten by) tedu and myself. Note, can be "backed out" by changing BUFQ_DEFAULT back to disksort in buf.h ok kettenis@, tedu@, krw@
* bufq write limitingbeck2012-10-091-1/+36
| | | | | | | | | | | This change ensures that writes in flight from the buffer cache via bufq are limited to a high water mark - when the limit is reached the writes sleep until the amount of IO in flight reaches a low water mark. This avoids the problem where userland can queue an unlimited amount of asynchronous writes resulting in the consumption of all/most of our available buffer mapping kva, and a long queue of writes to the disk. ok kettenis@, krw@
* thib insists i take responsibility toodlg2010-09-031-1/+2
|
* Inline bufq_impl_disksort and bufq_impl_fifo's definitions intomatthew2010-09-021-28/+24
| | | | | | bufq_impls. Also, make bufq_impls const. ok dlg@
* There is no point doing wakeups in bufq_done() unless we're actually in thekettenis2010-09-011-2/+2
| | | | | | process of quiescing I/O. ok dlg@
* Clarify why we can walk the list of bufqs without holding a mutex with akettenis2010-09-011-2/+6
| | | | comment.
* make struct bufq a member of the softc for devices that use it,dlg2010-09-011-97/+200
| | | | | | | | | | | | | | | | | | | | | | | | | rather than it being a pointer to something that needs to be allocated at attach. since all these devices need a bufq to operate, it makes sense to have it allocated as part of the softc and get bufq_init to just initialise all its fields. it also gets rid of the possibility that you wont be able to allocate the bufq struct during attach, which is something you dont want to happen. secondly, it consistently implements a split between wrapper functions and the per discipline implementation of the bufq handlers. it consistently does the locking in the wrappers rather than doing half in the wrappers and the other half in the implementations. it also consistently handles the outstanding bufq bq pointer in the wrappers. this hides most of the implementation inside kern_bufq.c. the only stuff left in buf.h is for the bits each implementation needs to put inside struct buf. tested by thib@ krw@ and me ok thib@ matthew@ no objection from krw@
* Avoid interleaving of mutexes that would leave is with the wrong spl afterkettenis2010-07-191-10/+10
| | | | | | calling bufq_quiesce(). Problem spotted by matthew@. ok matthew@, thib@
* dont count requeued io as outstanding io. there is a 1:1 mappingdlg2010-07-081-8/+1
| | | | | | | | | | | | | | | | | between calls to bufq_enqueue and bufq_done calls, but bufq_requeue can be called multiple times on an io in between the enqueue and done. if you keep incrementing outstanding you'll never stop sleeping for suspend. bufq_requeue can be called via interrupts, so we cannot sleep there. the problems fixed by this diff were never hit cos the adapters people are testing/running with do not cause bufq_requeue to be called. thanks to thib@ for helping me understand the code better ok thib@ deraadt@ kettenis@ tedu@
* minor whitespace tweaks and clean up extra ;dlg2010-07-071-4/+4
|
* Call msleep(9) with PNORELOCK rather than calling mtx_leave()matthew2010-06-301-4/+3
| | | | | | immediately afterwards. ok thib@, tedu@
* Switch bufq FIFO disclipline from using TAILQs to SIMPLEQs.matthew2010-06-301-6/+6
| | | | ok thib@
* Introduce bufq_quiesce(), which will block I/O ifrom getting on the queues,kettenis2010-06-291-12/+101
| | | | | | | | | 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@
* garbage collect the debugging goothib2010-06-271-40/+1
|
* Add missing $OpenBSD$.kettenis2010-06-271-0/+1
|
* No need to include mutex.h twice.thib2010-06-211-1/+0
| | | | Pointed out by Jung <moorang at gmail dot com>
* Tweak bufq code to handle corner cases. Makes upcoming cd(4)krw2010-05-301-5/+6
| | | | | | conversion to bufq work. Taken from n2k10 scsi buf queueing code. ok thib@
* Trying this again. Mixing anoncvs with cvs is _not_ a good idea.thib2010-05-261-0/+244
| | | | | | | | | | | | | | | | | Reintroduce bufqs. A few changes since it was backed out after some good comments from dlg@. No need for a separate bufq.h, keep all of in buf.h; As requested by kittens and deraadt. Only sd(4) and wd(4) for now. The rest of the drivers will be converted soon, also other goodies like heuristics for sd(4) for selecting the bufq type and the death of disksort() are forthcoming. Tested on: i386, amd64, sparc64, macppc, loongson and alpha by myself and phessler. OK art@, beck@, kettenis@, oga@
* Revert bufq's. this is inline with the major midlayer reverts thatthib2009-06-171-154/+0
| | | | | | have been going on. this appears to bring us back to stable state. lots of testing by oga and ariane and my self.
* add $OpenBSD$ tagthib2009-06-041-0/+2
|
* add a flexible buffer queue (bufq) api, based on the never usedthib2009-06-031-0/+152
one by tedu@. It doesn't do anything smart yet, it just uses plain old disksort. we also keep the old method of queueing bufs since some miods have crazy MD drivers that need some love. ok beck@, art@ tested by many on many archs.