summaryrefslogtreecommitdiff
path: root/sys/kern
AgeCommit message (Collapse)Author
2009-11-19Dell's SVR4 apparently mapped page zero to the executable. We don'tPhilip Guenthe
do that and, given the security issues it exacerbates, never will. So document it and delete the disabled support. ok deraadt@ tedu@
2009-11-13>15 year old buffer-read-1-byte-too-far in clrbits() [code I wrote, yeah]Theo de Raadt
with a subtle change to make it more clear (and more cache friendly) netbsd pr 42312, found by tlambert@apple.com ok miod
2009-11-13Extend the protosw pr_ctlinput function to include the rdomain. This isClaudio Jeker
needed so that the route and inp lookups done in TCP and UDP know where to look. Additionally in_pcbnotifyall() and tcp_respond() got a rdomain argument as well for similar reasons. With this tcp seems to be now fully rdomain save and no longer leaks single packets into the main domain. Looks good markus@, henning@
2009-11-09Every selwakeup() should have a matching KNOTE() (even if kqueue isn'tNicholas Marriott
supported it doesn't do any harm), so put the KNOTE() in selwakeup() itself and remove it from any occurences where both are used, except one for kqueue itself and one in sys_pipe.c (where the selwakeup is under a PIPE_SEL flag). Based on a diff from tedu. ok deraadt
2009-11-04Get rid of __HAVE_GENERIC_SOFT_INTERRUPTS now that all our platforms support it.Mark Kettenis
ok jsing@, miod@
2009-10-31Use suser when possible. Suggested by miod@.Federico G. Schwindt
miod@ deraadt@ ok.
2009-10-30pipeclose() calls pileseltimeout() which does the KNOTE(); therefore callingTheo de Raadt
KNOTE() a second time is not needed (and perhaps bad) ok claudio millert
2009-10-30Add missing KNOTE() calls after selwakeup() in ptcread() (to wake up writersNicholas Marriott
after the master side of the pty has finished reading) and in ttyflush(). ok tedu millert
2009-10-28For the TIOCSET* ioctls, validate that the tty speeds are positive (sinceTheo de Raadt
they are signed int) ok miod guenther
2009-10-16cancel the timeout upon disabling profiling / virtual timer; soMartynas Venckus
that the timeout doesn't happen if setitimer is called between the profiling / virtual timer expires and the timeout is scheduled. firefox triggered this Profiling timer expired problem when in uthread execve signal was being delivered after timer has already been disabled; as reported on ports@ recently. special thanks to kettenis@, kurt@, guenther@. agreed by kettenis@, tedu@. ok guenther@. reminded & ok fgs@. tested by ian@.
2009-10-14Remove a redundant if (maxpty == npty) in check_pty - this is also tested byNicholas Marriott
the two ifs at the start of the function and both variables are only altered under pt_softc_lock so cannot change between the checks. ok guenther@
2009-10-13Make sure we do not loop when allocating an extent region with EX_CONFLICTOKMiod Vallat
and the whole extent is used; the current code computations would wrap. Found the hard way by jsg@, fix discuss with kettenis@, and you get a regress test for free (which will spin if you compile it again an old subr_extent.c)
2009-10-13Get rid of devact enum, substitute it with an int and coresponding defines.Paul Irofti
This is needed for the addition of further suspend/resume actions. Okay deraadt@, marco@.
2009-10-05Don't drop the big lock at the end of exit1(), but move it into the middle ofTheo de Raadt
sched_exit(). This means that cpu_exit() and whatever it does (for instance calling free(), as well as the deadproc p_hash handling are now locked as well. This may have been one of the causes of the reaper panics, especially with rthread patches... which were terminating a lot of threads very quickly onto the deadproc p_hash list. ok kurt kettenis miod
2009-09-29Having pty_isfree_locked() be inlined may make pty allocation a tinyTheo de Raadt
bit faster, but come on, inlining is supposed to be reserved only for things which *critically* need it. ok millert
2009-09-18Make sure we handle all possible ways regions can overlap when EX_CONFLICTOKMark Kettenis
is specified. ok miod@
2009-09-13M_DUP_PKTHDR() define -> m_dup_pkthdr() function to properly dealKenneth R Westerback
with m_tag_copy_chain() failures. Use m_defrag() to eliminate hand rolled defragging of mbufs and some uses of M_DUP_PKTHDR(). Original diff from thib@, claudio@'s feedback integrated by me. Tests kevlo@ claudio@, "reads ok" blambert@ ok thib@ claudio@, "m_defrag() bits ok" kettenis@
2009-09-08copyout() the correct size in sys_fhstatfs(), broken since 1.138.Miod Vallat
ok millert@ blambert@ otto@
2009-09-05sync comment to reality, off-page page headers go intoThordur I. Bjornsson
an RB tree, not into a hashtable.
2009-09-02check if we have access to the vnode before checking if we can write toFederico G. Schwindt
it. thib@ ok'd the idea and an earlier diff.
2009-09-02when you add a task to a workq, it allocates memory to handle theDavid Gwynne
task and shove it on a list. allocations can fail, so if something that wants to run a task later already has memory to handle the workq task then let it provide it via a new function called workq_queue_task. ok kettenis@
2009-08-26add commented out options for PAGEFASTRECYCLE, KVA_GUARDPAGES, shuffle VFSDEBUGThordur I. Bjornsson
around and add POOL_DEBUG as an enabled option, removing the define from subr_pool.c. comments & ok deraadt@.
2009-08-25If option DIAGNOSTIC, do not bother doing sanity checks, including anMiod Vallat
uvm_map_checkprot() call, if the memory we're about to return has just been allocated with uvm_km_kmemalloc() instead of coming from the freelist. No functional change but a very small speedup when the freelist for the given bucket is empty.
2009-08-25The BUCKETINDX() giant macro is used to compute the base 2 logarithm of itsMiod Vallat
input, in order to pick the appropriate malloc() bucket. Replace it with an inline function in kern_malloc.c, which will either do a tightest-but-slower loop (if option SMALL_KERNEL), or a geometric search equivalent to what the macro does, but producing smaller code (especially on platforms which can not load large constants in one instruction).
2009-08-25Remove support for packet mode of Metricom Ricochet radios.Jonathan Gray
It currently doesn't compile and this is unlikely to change as there are many alternatives now since we no longer live in the early 1990s and Metricom went bankrupt some time ago. ok many @
2009-08-24garbage collect the nchash variable that used to store theThordur I. Bjornsson
size of cache hashtable that has now been removed.
2009-08-17dd 'show all bufs' to show all the buffers in the systemJasper Lievisse Adriaanse
ok beck@ thib@
2009-08-13Remove unrelated bit from last commit which breaks at least 2 arches.Bret Lambert
Bad blambert@, no biscuit.
2009-08-13rwlock assertion functions, currently unusedBret Lambert
ok art@
2009-08-13Replace the error strings that were being passed around with much simplerTheo de Raadt
errnos. Note that the error strings are being ignored, since we long ago decided to not spam the console, and there is no other nice way to use the errors (without changing the ioctls to pass it back) The errno is now useful, since we can pass b_error from failing IO up, and the drive can decide how to use that ok miod
2009-08-13- remove super-obvious comments from $fs_vnodeop_entries[]Jasper Lievisse Adriaanse
prodded by and ok thib@ agreed by art@ and blambert@
2009-08-13add a show all vnodes command, use dlg's nice pool_walk() to accomplishThordur I. Bjornsson
this. ok beck@, dlg@
2009-08-12just bzero the pkthdr instead of setting each and every member of thatHenning Brauer
struct to 0/NULL. no performance impact but way less error prone on addition of new pkthdr field (as just ran into with a theo diff). ok theo
2009-08-12revert my change to m_cluncount which tries to prevent the systemDavid Gwynne
running out of mbufs for rx rings. if the system low watermark is lower than a rx rings low watermark, we'll never send a packet up the stack, we'll always recycle it. found by thib@ on a bge sadface
2009-08-12Namecache revamp.Bob Beck
This eliminates the large single namecache hash table, and implements the name cache as a global lru of entires, and a redblack tree in each vnode. It makes cache_purge actually purge the namecache entries associated with a vnode when a vnode is recycled (very important for later on actually being able to resize the vnode pool) This commit does #if 0 out a bunch of procmap code that was already broken before this change, but needs to be redone completely. Tested by many, including in thib's nfs test setup. ok oga@,art@,thib@,miod@
2009-08-12if we get dangerously low on clusters during interrupts, we needDavid Gwynne
to free some for use on the rx rings on network cards. this modifies m_cluncount to advise callers when we're in such a situation, and makes them responsible for freeing up the cluster for allocation by MCLGETI later. fixes an awesome lockup with sis(4) henning has been experiencing. this is not the best fix, but it is better than the current situation. yep deraadt@ tested by henning@
2009-08-11uvm_scheduler() sounds important, but ``while(1) tsleep()'' is kinda lameBret Lambert
inline the loop in the one place it exists, and remove it from uvm adjust a comment mentioning it accordingly originally inspired by a diff fixing a comment from oga@ ok art@ beck@ miod@ oga@
2009-08-11optimise m_clget so that it holds spl for even lessTheo de Raadt
ok dlg thib
2009-08-11Must move the splx() lower in m_clget() so that it protects atomic accessTheo de Raadt
to the per-ipf mbuf cluster reference counters ok dlg claudio
2009-08-10Don't use char arrays for sleep wchans and reuse them.Thordur I. Bjornsson
just use strings and make things unique. ok claudio@
2009-08-10At sys_reboot time, bring all the interfaces down so that their xxstopTheo de Raadt
functions are called, which will turn off DMA. Receiving packets into your memory after a system reboot is pretty nasty. This will also mean that the shutdown hooks can go; this solution is smaller. ok henning miod dlg kettenis
2009-08-09remove the ancient MCFail / MPFail debugging technique; ok claudioTheo de Raadt
2009-08-09buf_dealloc_mem can be called without B_BUSY. Don't decrement busymapped in ↵Artur Grabowski
that case.
2009-08-09use m_free_unlocked() in m_pullup() to avoid iterative splnet/splx downTheo de Raadt
the chain ok henning
2009-08-09Keep track of number of currently mapped and B_BUSY buffers. beck@ okArtur Grabowski
2009-08-09Make dk_mmountroot use vnodes instead of d_open/d_close. This does uglyMarco Peereboom
things to softraid. ok jsing thib krw beck oga
2009-08-09Use an RB tree instead of a SPLAY tree for the page headers tree.Thordur I. Bjornsson
ok beck@, dlg@
2009-08-09make mbuf tags suck a bit less, performance wise.Henning Brauer
the most common operation is checking for a particular tag to be there. in the majority of the cases it is not. introduce a "tagsset" in the mbuf packet header which has a bit for each mbuf tag type that is in the chain set, checking for its existance is now as easy and cheap as (tagsset & type) != 0. theo ok
2009-08-09add mpath(4), a driver that steals paths to scsi devices if itDavid Gwynne
thinks they could be available via multiple paths. those stolen devices are then made available via mpath(4). this is the minimum amount of code to implement the stealing. it is generally broken and very brittle, so it is currently disabled. it is going in so i can work on it in the tree.
2009-08-09create a m_free_unlocked which is now used by both m_freem() and m_free().Theo de Raadt
this lets m_freem() only do one splnet/splx instead of repeating this all the way down a chain ok henning claudio dlg