summaryrefslogtreecommitdiff
path: root/sys/kern
AgeCommit message (Collapse)Author
2011-01-08split randomattach into random_init() and random_start(), so that weTheo de Raadt
can make attempts to load 'entropy' into the RC4. ok miod ariane
2011-01-07Add socket option SO_SPLICE to splice together two TCP sockets.Alexander Bluhm
The data received on the source socket will automatically be sent on the drain socket. This allows to write relay daemons with zero data copy. ok markus@
2011-01-05use __func__ where possible. shaves 4k and makes indentation much better.Federico G. Schwindt
kettenis@ ok
2011-01-01copyright++;Theo de Raadt
2010-12-21Bring back the "End the VOP experiment." diff, naddy's issues whereThordur I. Bjornsson
unrelated, and his alpha is much happier now. OK deraadt@
2010-12-21Convert netisr to a normal soft interrupt instead of hanving MD codeClaudio Jeker
for it. This makes the netisr a real C function which will help further development. No noticable performance change on i386 and amd64. With input from kettenis@ and miod@ additional OKs mikeb@ and henning@
2010-12-21Ugly workaround in nmbclust_update(). Additionally to setting the limitClaudio Jeker
also modify the hiwat mark. This was done in pool_sethardlimit() until rev. 1.99. Without this the mbuf cluster pool may return free pages too quickly with the result that m_clget() may fail while populating DMA rings. Seems to fix some hangs seen on MCLGETI() interfaces on i386 e.g. PR 6524. A proper fix is to make all drivers handle empty rings but that will take a while to implement. With and OK mikeb@
2010-12-19Since we have an ioctl that uses a struct with an off_t member as itsMark Kettenis
argument, we need to make sure this buffer has 64-bit alignment, even on 32-bit architectures. Fixes the alignment trap triggered by vnconfig(8) on sparc for kernels compiled with gcc4. ok miod@
2010-12-15add a BRKSIZ define and use it for the heap gap constant, decouplingTed Unangst
heap gap from max data size. nothing else changes yet. ok deraadt
2010-12-14disable access to the crypto(4) device from userland; ok deraadtMike Belopuhov
2010-12-06- drop NENTS(), which was yet another copy of nitems().Jasper Lievisse Adriaanse
no binary change ok deraadt@
2010-11-24Allow MD code to setup MD-specific mappings (kinda similar to the signalMiod Vallat
trampoline) in sys_execve(), if MD <machine/_types.h> defines __HAVE_EXEC_MD_MAP.
2010-11-24Ensure that hw.disknames gets updated whenever a disklabel is set, sinceJoel Sing
the disklabel UID may have changed. ok krw@ deraadt@
2010-11-19Make KERN_CPTIME return an avarage number of ticks across all CPUsMike Belopuhov
tedu agreed with an idea, tested by Luis Useche and me; ok deraadt
2010-11-18Do not #include <sys/dkstat.h> if you don't need anything from it.Miod Vallat
ok krw@ deraadt@
2010-11-13backout 1.86Theo de Raadt
it is totally wrong to convert bdwrite into bawrite on the fly. this just causes way bigger issues. ok beck blambert
2010-11-11Kill unused cinit(), and skip some diagnostic printf if optionMiod Vallat
DIAGNOSTIC is not set. ok deraadt@
2010-11-05Implement m_print as real ddb command "show mbuf addr" in the way otherClaudio Jeker
such commands are implemented. "Ja! You'll need to update ddb.4 as well, of course." miod@
2010-11-03pool_sethardlimit should not imply pool_sethiwat; figured out with claudioMike Belopuhov
ok claudio tedu
2010-11-02export the network livelock counter. part of a diff i committed theDavid Gwynne
userland side of. pointed out by claudio@ after i embarassed myself saying "yes, its there!"
2010-10-31The return of rfork(RFTHREAD) must be consistent with getthrid().Philip Guenthe
Fixes rthread breakage observed by Vladimir Kirillov.
2010-10-30don't abuse lvalues, reported by Amit Kulkarni.Ted Unangst
(actually using KGDB remains as suspect as ever)
2010-10-28Add m_print() a function to print mbuf headers. Can be called from ddbClaudio Jeker
with an mbuf pointer as argument to see the contents of it. OK thib@, deraadt@
2010-10-28Regen for new getdirentries.Todd C. Miller
2010-10-28Change basep parameter of getdirentries() to be off_t *, not long *Todd C. Miller
so it works correctly with large offsets (and matches other systems). This requires adding a new getdirentries syscall, with the old one renamed to ogetdirentries. All in-tree consumers of getdirentries() have been updated. Bump libc and libpthread major numbers. OK and with deraadt@
2010-10-27The previous two commits cannot be right. If in fact offsets > 4GB areTheo de Raadt
causing problems, then it is nonsense to instead fail at the 2GB line. Much more discussion needed.
2010-10-18PRU_PEEREID is only used by code under COMPAT_O47, so put it there tooPhilip Guenthe
so that we remember to remove it all at the same time in two years. ok deraadt@
2010-10-05implicitly protect m_cldrop with splnet; ok claudio dlgMike Belopuhov
2010-09-28Implement a per-cpu held mutex counter if DIAGNOSTIC on all non-x86 platforms,Miod Vallat
to complete matthew@'s commit of a few days ago, and drop __HAVE_CPU_MUTEX_LEVEL define. With help from, and ok deraadt@.
2010-09-26unify some pool and malloc flag values. the important bit is that all flagsTed Unangst
have real values, no 0 values anymore. ok deraadt kettenis krw matthew oga thib
2010-09-24Add stricter asserts to DIAGNOSTIC kernels to help catch mutex andMatthew Dempsky
rwlock misuse. In particular, this commit makes the following changes: 1. i386 and amd64 now count the number of active mutexes so that assertwaitok(9) can detect attempts to sleep while holding a mutex. 2. i386 and amd64 check that we actually hold mutexes when passed to mtx_leave(). 3. Calls to rw_exit*() now call rw_assert_{rd,wr}lock() as appropriate. ok krw@, oga@; "sounds good to me" deraadt@; assembly bits double checked by pirofti@
2010-09-24useless storeTheo de Raadt
2010-09-24Fixes before-boot umass hangs on units without media.Theo de Raadt
In disk_readlabel() if the ioctl fails don't forget to close the disk. Avoid sharing a static error buffer between a workq and mountroot since they can compete. Pass the dev_t to the workq inside one of the arguments without a malloc'd object. ok miod dlg krw
2010-09-24TCP send and recv buffer scaling.Claudio Jeker
Send buffer is scaled by not accounting unacknowledged on the wire data against the buffer limit. Receive buffer scaling is done similar to FreeBSD -- measure the delay * bandwith product and base the buffer on that. The problem is that our RTT measurment is coarse so it overshoots on low delay links. This does not matter that much since the recvbuffer is almost always empty. Add a back pressure mechanism to control the amount of memory assigned to socketbuffers that kicks in when 80% of the cluster pool is used. Increases the download speed from 300kB/s to 4.4MB/s on ftp.eu.openbsd.org. Based on work by markus@ and djm@. OK dlg@, henning@, put it in deraadt@
2010-09-24dead store; found by clangTheo de Raadt
2010-09-24move DEBUG-only variable into #ifdefTheo de Raadt
2010-09-23The only sensible argument for VOP_* calls that take a struct proc pointer isOwain Ainsworth
curproc. A bunch of callers were passing in 0 (not even NULL, 0) as this pointer, which was fine until the called vnode function tried to do something with it. Typically, this code was then copy/pasted to various parts of the tree. Accept the facts of life and switch all of these over to passing curproc for now until the argument can be removed. Discovered by stsp trying to create a softraid on top of a vnd, which crashed with a NULL deref in vndioctl. softraid bits tested by mikeb and jsing. raidframe bits tested by pea, matthieu and naddy. The rest tested by at least thib, jsing and myself. ok thib@, jsing@.
2010-09-23Include the disklabel UID in hw.disknames.Joel Sing
ok deraadt@ krw@
2010-09-23When a disk is attached create a workq task to read the disklabel,Joel Sing
providing the DKF_NOLABELREAD flag is not set. This provides the kernel with the actual disklabel which includes the disklabel UID. ok deraadt@ miod@ krw@
2010-09-23tweak the mclgeti algorithm to behave better under load.David Gwynne
instead of letting hardware rings grow on every interrupt, restrict it so it can only grow once per softclock tick. we can only punish the rings on softclock ticks, so it make sense to only grow on softclock tick boundaries too. the rings are now punished after >1 lost softclock tick rather than >2. mclgeti is now more aggressive at detecting livelock. the rings get punished by an 8th, rather than by half. we now allow the rings to be punished again even if the system is already considered in livelock. without this diff a livelocked system will have its rx ring sizes scale up and down very rapidly, while holding the rings low for too long. this affected throughput significantly. discussed and tested heavily at j2k10. there are still some games with softnet we can play, but this is a good first step. "put it in" and ok deraadt@ ok claudio@ krw@ henning@ mcbride@ if we find out that it sucks we can pull it out again later. till then we'll run with it and see how it goes.
2010-09-22Fix a locking bug in accept(2) caught by sthen@ using my strictMatthew Dempsky
locking diff. ok guenther@
2010-09-22All users of physio(9) now pass NULL as the buf pointer argument, soMatthew Dempsky
no point in keeping it around. "i like this" thib@ (a while back); ok krw@ and oga@; reminder to update the man page and tweaks jmc@
2010-09-21Add assertwaitok(9) to declare code paths that assume they can sleep.Matthew Dempsky
Currently only checks that we're not in an interrupt context, but will soon check that we're not holding any mutexes either. Update malloc(9) and pool(9) to use assertwaitok(9) as appropriate. "i like it" art@, oga@, marco@; "i see no harm" deraadt@; too trivial for me to bother prying actual oks from people.
2010-09-20syncTheo de Raadt
2010-09-20Move getpeereid(2) into COMPAT_O47. In 4.8 and onwards it is libraryTheo de Raadt
code using socket options. ok matthew
2010-09-20Move getpeereid(2) into COMPAT_O47. In 4.8 and onwards it is libraryTheo de Raadt
code using socket options. ok matthew
2010-09-20Get rid of evcount's support for arranging counters in a treeMatthew Dempsky
hierarchy. Everything attached to a single root node anyway, so at best we had a bush. "i think it is good" deraadt@
2010-09-17don't forget to free program header sections when writingMike Belopuhov
core files. fixes a local DoS that can be carried out by an unprivileged user. ok kettenis
2010-09-10Backout the VOP diff until the issues naddy was seeing on alpha (gcc3)Thordur I. Bjornsson
have been resolved.
2010-09-09Rename lookup/relookup to vfs_lookup/vfs_relookup.Thordur I. Bjornsson
OK oga@, beck@, matthew@