summaryrefslogtreecommitdiff
path: root/sys/kern
AgeCommit message (Collapse)Author
2012-10-09Capilization in comment, and document leftoverroom, + knf nit, spotted by theoBob Beck
2012-10-09Add nscan as a disk queueing algorithm, and make it the default withBob Beck
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@
2012-10-09bufq write limitingBob Beck
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@
2012-10-08Revamp the sequences for suspend/hibernate -> resume so that the codeTheo de Raadt
paths are reflexive. It is now possible to fail part-way through a suspend sequence, and recover along the resume code path. Split DVACT_SUSPEND by adding a new DVACT_POWERDOWN method is used after hibernate (and suspend too) to finish the job. Some drivers must be converted at the same time to use this instead of shutdown hooks (the others will follow at a later time) ok kettenis mlarkin
2012-10-05add send(2) MSG_DONTWAIT support which enables us to choose nonblockingYASUOKA Masahiko
or blocking for each send(2) call. diff from UMEZAWA Takeshi ok bluhm
2012-10-01Make groupmember() check the effective gid too, so that the checks arePhilip Guenthe
consistent when the effective gid isn't also a supplementary group. ok beck@
2012-09-29When running a.out OMAGIC binaries, be sure to round ep_daddr to a pageMiod Vallat
boundary; uvm depends on this and will KASSERT this for its own safety. Found the hard way, rounding direction discussed with ariane@ (I initially wanted to round down, but it makes more sense to round up). Of course noone in his right mind ought to run OMAGIC binaries (-:
2012-09-26add M_ZEROIZE as an mbuf flag, so copied PFKEY messages (with embedded keys)Markus Friedl
are cleared as well; from hshoexer@, feedback and ok bluhm@, ok claudio@
2012-09-20In somove() free the mbufs when necessary instead of freeing themAlexander Bluhm
in the release path. Especially accessing m in a KDASSERT() could go wrong. OK claudio@
2012-09-19When a socket is spliced, it may not wakeup the userland for reading.Alexander Bluhm
There was a small race in sorwakeup() where that could happen if we slept before the SB_SPLICE flag was set. ok claudio@
2012-09-19In somove() make the call to pr_usrreq(PRU_RCVD) under the sameAlexander Bluhm
conditions as in soreceive(). My goal is to make socket splicing less protocol dependent. ok claudio@
2012-09-19vhold() and vdrop() are prototyped in vnode.h, so don't repeat them herePhilip Guenthe
ok beck@
2012-09-17Recognize executables tagged with ELFOSABI_OPENBSD (such as generatedMatthew Dempsky
by the Go linker) as native executables even if they don't contain an OpenBSD PT_NOTE segment. Confirmed to fix Go by sthen ok kettenis, deraadt
2012-09-17Fix indent white spaces.Alexander Bluhm
2012-09-11Remove the 'OLF method' used for the transition from a.out to ELF andTheo de Raadt
for all the compat layers which are now gone. Linux compat still works because it always used another method in any case, and nothing looks at p_os anymore. ok jsing
2012-09-10Cleanup VFS mount string handling:Joel Sing
- Avoid using copyinstr() without checking the return value. - sys_mount() has already copied the path in, so pass this to the filesystem mount code so that it does not have to copy it in again. - Avoid copyinstr()/bzero() dance when we can simply bzero() and strlcpy(). ok krw@
2012-09-10syncTheo de Raadt
2012-09-10compat_o48_sys_getdirentries can die; ok guentherTheo de Raadt
2012-09-10delete compat_o48_sys_getdirentries; ok guentherTheo de Raadt
2012-09-08Plug a race where we're trying to kill a traced process while it is aleadyMark Kettenis
exiting. At that point ps_single may point to a proc that's already freed. Since there is no point in killing a process that's already exiting, just skip this step. ok guenther@
2012-09-02Do not need bcopy trickery to update the file descriptorTheo de Raadt
pointer array; we can access it directly. ok guenther
2012-08-30Remove a useless test for "elem_count < 0", which can never be trueMatthew Dempsky
because elem_count has an unsigned type (size_t). Noted by Brad/Clang; no binary change on amd64 using GCC either.
2012-08-28Add __guard_local as a hidden symbol to ld.so, kernel, and everyMatthew Dempsky
executable and DSO (via crtbegin.c/crtbeginS.c). Not used yet, but needed before GCC can start emitting -fstack-protector code that uses them instead of __guard.
2012-08-23syncTheo de Raadt
2012-08-23kill nnpfs deadTheo de Raadt
2012-08-23To protect assumptions inside systrace, don't let systrace fds bePhilip Guenthe
shared between processes. ok djm@
2012-08-21Stop "inlining" setrunnable() we already had two bugs because of it.Christiano F. Haesbaert
This also makes sure we call cpu_unidle() on the correct cpu, since the inlining order was wrong and could call it on the old cpu. ok kettenis@
2012-08-20Add support for .openbsd.randomdata sections and PT_OPENBSD_RANDOMIZEMatthew Dempsky
segments to the kernel, ld (2.15), and ld.so. Tested on alpha, amd64, i386, macppc, and sparc64 (thanks naddy, mpi, and okan!). Idea discussed for some time; committing now for further testing. ok deraadt
2012-08-07Move the common bits of syscall invocation and return handling intoPhilip Guenthe
an MI file, <sys/syscall_mi.h>, correcting inconsistencies and the handling when copyin() of arguments fails. Tested on i386, amd64, sparc64, and alpha (thanks naddy@) Any issues with other platforms will be fixed in tree. header name from millert@; ok miod@
2012-08-02Apply profiling to all threads instead of just the thread that calledPhilip Guenthe
profil() by moving P_PROFIL from proc->p_flag to process->ps_flags with matching adjustment in fork1() and exit1() ok matthew@
2012-07-22unp_dispose() walks not just the mbuf chain (m_next) but also the packetPhilip Guenthe
chain (m_nextpkt), so the mbuf passed to it must be disconnected completely from the socket buffer's chains. Problem noticed by yasuoka@; tweak from krw@, ok deraadt@
2012-07-19say that we are unhibernating..Theo de Raadt
2012-07-16oops, need sys/acct.h tooTheo de Raadt
2012-07-16Put acct_shutdown() proto in a better placeTheo de Raadt
2012-07-16Back out my workaround from r1.43 now that jsing has committed a better fix.Stefan Sperling
2012-07-16Make sure we have a swap partition before trying to read or writeJoel Sing
hibernate info. ok mlarkin@ stsp@
2012-07-15Don't panic in hibernate resume if no swap partition exists on the root disk.Stefan Sperling
ok mlarkin
2012-07-12Temporarily don't do RLE page encoding in hibernate to fix some unpackingMike Larkin
corruption seen earlier. This makes hibernate much slower but seems to fix the corruption problems seen on all machines we've tested on.
2012-07-11Revert the blocked FIFO open fix, as there's either a race in thePhilip Guenthe
ref-count handling under handling, or blambert@ is messing with my head
2012-07-11Enable the swap checker for hibernateMike Larkin
2012-07-11If the current offset is strictly less than the process filesizePhilip Guenthe
rlimit, then a write that would take it over the limit should be clamped, making it a partial write. ok beck@
2012-07-11exit1(EXIT_THREAD) needs to call single_thread_check() so that itPhilip Guenthe
can be suspended and/or decrement pr->ps_singlecount if necessary. With that added, the call the other direction needs to use its own flag (EXIT_THREAD_NOCHECK) to avoid looping. problem diagnosed from a hang naddy@ hit; ok kettenis@
2012-07-10Make sure that we don't schedule processes on CPUs that we havetaken out ofMark Kettenis
the scheduler. ok hasbaert@. deraadt@
2012-07-10Don't release a FILE that wan't allocated. Found by benno@Philip Guenthe
ok matthew@ benno@
2012-07-10We should only call need_resched() if the priority is lower than theChristiano F. Haesbaert
priority of the current running process. In amd64 a call to need_resched() sends an IPI to the other cpu. This fixes aja@ problem where he would move the mouse and see 60000 IPIs being sent. Thanks to mikeb@ for bringing that subject up tuesday. Actually found this after inquiring guenther@ about some changes in mi_switch(). ok guenther@ aja@
2012-07-10For setsockopt(SO_{SND,RCV}TIMEO), convert the timeval to ticks usingPhilip Guenthe
tvtohz() so that the rounding is correct and we don't time out a tick early ok claudio@
2012-07-10Try to cleanup the macro magic because of socket spliceing. Since structClaudio Jeker
socket is no longer affected by option SOCKET_SPLICE we can simplyfy the code. OK bluhm@
2012-07-09The linux emulation exit hook needs to be able to sleep, so call itPhilip Guenthe
before changing p_stat to SDEAD ok pirofti@
2012-07-09Print the fd_set used by select in kdump.Claudio Jeker
OK guenther@ and deraadt@
2012-07-09Tedu old comment concerning cpu affinity which does not apply anymore.Christiano F. Haesbaert
ok blambert@ krw@ tedu@ miod@