summaryrefslogtreecommitdiff
path: root/sys/kern
AgeCommit message (Collapse)Author
2008-12-14Make sure the low water mark for cluster pools isn't 0 such that networkMark Kettenis
drivers are guaranteed to make progress. We could probably set it to 1, but we set it to 2, to make sure drivers that link descriptors don't link a descriptor back to itself. ok deraadt@, dlg@
2008-12-13note to everyone: nitems(pointer) is 0, not what you wantTheo de Raadt
2008-12-11export per-interface mbuf cluster pool use statistics out to userlandTheo de Raadt
inside if_data, so that netstat(1) and systat(1) can see them ok dlg
2008-12-11a little bit of paranoiaTheo de Raadt
2008-12-04enable to large clusters again now that arts put the pool allocator forDavid Gwynne
them in again.
2008-12-04Put back the support for pools > PAGE_SIZE. This time the compare functionArtur Grabowski
works and there's even some sanity checks that it actually returns what we expect it to return.
2008-12-03add vscsi(4), a virtual scsi controller that passes all scsi requests up toDavid Gwynne
userland for handling. this is to scsi what tun(4) is for networks. this is going into the tree so i can work on some crazy scsi stuff, but its not being enabled since it is useless unless you're working on some crazy scsi stuff.
2008-11-30clarify allocationTheo de Raadt
2008-11-29need splvm() around the call to m_extfree() in the defraggerTheo de Raadt
2008-11-26Doh, do not commit before compile. Found by sthen@Claudio Jeker
2008-11-26Do a quick return if m->m_next is NULL in m_defrag() because there is nothingClaudio Jeker
todo. Discussed with deraadt@ and dlg@
2008-11-26only the pool_get() needs to be spl protected; ok claudio dlgTheo de Raadt
2008-11-25m_defrag() a mbuf chain defragmenter. It will collaps a mbuf chain into aClaudio Jeker
single buffer without changing the head mbuf. This is done with a lot of magic so there will be dragons. Tested and OK dlg@, kettenis@
2008-11-25Punctuate comment for clarity, and keep tense consistent throughoutBret Lambert
ok and improvements jmc@
2008-11-25Back out the large page pools for now. The compare function isArtur Grabowski
borked and instead of stressing to figure out how to fix it, I'll let peoples kernels to work.
2008-11-25backout large cluster allocators.David Gwynne
2008-11-25art says he doesnt suck anymore, so enable the really big clusterDavid Gwynne
allocators again.
2008-11-25Make sure that equal elements always compare equal. Logic error spottedArtur Grabowski
by otto@ ok otto@
2008-11-25Factor increases are not needed, +1 appears to work as well.Theo de Raadt
ok dlg
2008-11-25m_cluncount() needs to walk the mbuf chain to correctly uncount all clustersClaudio Jeker
but don't do that in m_free() as that will cause a double loop behaviour when called via m_freem(). OK dlg@, deraadt@
2008-11-24Protect kmem_map allocations with splvm.Artur Grabowski
This should make dlg happy.
2008-11-24art isnt handling spls properly in the pool allocator backends for bigDavid Gwynne
objects. dmesg is being spammed with splasserts. disable the 8k, 9k, 12k, 16k, and 64k backend pools for the cluster allocator. art will fix this when he gets back from dinner, otherwise i'll nag more.
2008-11-24enable the 8k, 9k, 12k, 16k, and 64k backend pools for the clusterDavid Gwynne
allocator.
2008-11-24Allow allocations larger than PAGE_SIZE from pools.Artur Grabowski
This is solved by special allocators and an obfuscated compare function for the page header splay tree and some other minor adjustments. At this moment, the allocator will be picked automagically by pool_init and you can get a kernel_map allocator if you specify PR_WAITOK in flags (XXX), default is kmem_map. This will be changed in the future once the allocator code is slightly reworked. But people want to use it now. "nag nag nag nag" dlg@
2008-11-24queue tc randomness when we get it. the tc_init() ones are (might be)Theo de Raadt
submitted before randomattach, and thus will perturb the first arc4random() call, which is very good ok art djm
2008-11-24move MCLPOOLS to if.h and force uipc_mbuf.c to get if.h, there is noTheo de Raadt
other option ok dlg
2008-11-24add several backend pools to allocate mbufs clusters of various sizes outDavid Gwynne
of. currently limited to MCLBYTES (2048 bytes) and 4096 bytes until pools can allocate objects of sizes greater than PAGESIZE. this allows drivers to ask for "jumbo" packets to fill rx rings with. the second half of this change is per interface mbuf cluster allocator statistics. drivers can use the new interface (MCLGETI), which will use these stats to selectively fail allocations based on demand for mbufs. if the driver isnt rapidly consuming rx mbufs, we dont allow it to allocate many to put on its rx ring. drivers require modifications to take advantage of both the new allocation semantic and large clusters. this was written and developed with deraadt@ over the last two days ok deraadt@ claudio@
2008-11-22Do deadbeef-style protection in pools too, by default, even though it itTheo de Raadt
is a lot slower. Before release this should be backed out, but for now we need everyone to run with this and start finding the use-after-free style bugs this exposes. original version from tedu ok everyone in the room
2008-11-22Move diagnostic assertions concerning the recycle process of buffersPedro Martelletto
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@.
2008-11-21Relax sanity check so any two-byte jmp followed by a NOP, or anyKenneth R Westerback
three-byte jmp will be acceptable as the preamble to a FAT boot sector for the purposes of spoofing an 'i' partition. Problem noted most recently by mbalmer@. Fixes mbalmer@, fkr@ and jmc@'s Nokia E71 phones. "seems silly" tedu@ "disgusting" deraadt@ "makes sense" fkr@ ok jmc@ "looks ok" weingart@
2008-11-21don't declare th0 extern before declaring it as static; makes gcc4 happyRobert Nagy
ok deraadt@
2008-11-11for ^T support, grab all the information from the process before goingTheo de Raadt
into a potentially sleeping function... ok tedu.
2008-11-11slightly optimized the ptrace stat allocation to only happen when needed.Ted Unangst
ok deraadt
2008-11-11make sure that any messing we do with a process's directories happens ↵Ted Unangst
atomically and not after sleeping. ok deraadt pedro
2008-11-10Fix typo in comment, okay jmc@.Pedro Martelletto
2008-11-10vm_map_lock() around calls to uvm_map_findspace(); ok teduTheo de Raadt
2008-11-09systrace activation happens in the middle of a rather sensitive piece ofTheo de Raadt
fork(), i worry about it a lot but cannot prove yet that sleeping there is bad. Anyways, this change makes us never sleep in that area -- the memory needed is allocated ealier like the ptrace state. tested by many developers.
2008-11-08Use atop() and ptoa() in buf_free_pages() to make it consistent withPedro Martelletto
the rest of the code, okay art@.
2008-11-06Some paranoia and deconfusion.Artur Grabowski
- setrunnable should never be run on SIDL processes. That's a bug and will cause all kinds of trouble. Change the switch statement to panic if that happens. - p->p_stat == SRUN implies that p != curproc since curproc will always be SONPROC. This is a leftover from before SONPROC. deraadt@ "commit"
2008-11-06remove a really stupid comment. Duh, of course it can blockTheo de Raadt
2008-11-06oopsTheo de Raadt
2008-11-06panic if cpu_switchto() returns from a dead processTheo de Raadt
2008-11-03pre-allocate the ptrace_state we may need to tie to the new processTheo de Raadt
in case we need it. the idea is to try to get rid of some potential sleeps.. ok tedu
2008-11-01Grab a reference to the trace vnode of the process when traversing thePedro Martelletto
global process list and calling ktrsettracevnode() in ktrwrite(), so that we don't sleep in vrele(). Discussed with deraadt@, okay beck@, tedu@ and thib@.
2008-11-01change vrele() to return an int. if it returns 0, it can gaurantee thatTheo de Raadt
it did not sleep. this is used to avoid checkdirs() to avoid having to restart the allproc walk every time through idea from tedu, ok thib pedro
2008-11-01change all callers of enterpgrp() to pre-allocate a pgrp or session ifTheo de Raadt
it might be needed later -- before calling pfind(), so that enterpgrp() can operate without sleeping ok tedu
2008-10-31Do not assume that a pointer to another process will live over a set ofTheo de Raadt
sleeping calls. Since we are simply operating on another process' vmspace, grab a (refcounted) copy of that pointer and use that instead. Similar to the bug just fixed in sysctl_proc_args. discussed with art
2008-10-31Do not assume that a pointer to another process will live over a set ofTheo de Raadt
sleeping calls. Since we are simply operating on another process' vmspace, grab a (refcounted) copy of that pointer and use that instead. originally spotted by kurt, discussed with art
2008-10-31accidental commit ... backoutTheo de Raadt
2008-10-31accidental commit ... backoutTheo de Raadt