summaryrefslogtreecommitdiff
path: root/sys/kern
AgeCommit message (Collapse)Author
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@
2012-07-09In reboot, no need to sched_peg_curproc() to the primary, becauseTheo de Raadt
sched_stop_secondary_cpus() leaves us on the only cpu which is left. ok kettenis haesbaert guenther
2012-07-09Compare the size of the static fd_mask against the number of bytes neededClaudio Jeker
not against the number bit / number of fds in the select set. ok guenther@
2012-07-09DVACT_SUSPEND must be done at cold with interrupts disabled. FailureTheo de Raadt
to read a hibernate image should restore the spl ok mlarkin
2012-07-08Quiesce and suspend devices in the resuming kernel for hibernate.Mike Larkin
ok deraadt@
2012-07-08kevent(EV_DELETE) shouldn't be calling closef(), as that releases POSIXPhilip Guenthe
file locks. c.f. regress/sys/kern/kqueue/kqueue-flock.c ok krw@
2012-07-08Use IO_NOLIMIT instead of munging the process's limitsPhilip Guenthe
ok beck@
2012-07-08Make hibernate_free() safe to be called even if hibernate areasTheo de Raadt
allocation failed ok mlarkin
2012-07-08Reorganize some hibernate functions for easier readability.Mike Larkin
Fix some incorrect/old comments. ok deraadt@
2012-07-08Don't hold the fd-table lock across vn_open(), as opening a FIFO may block.Philip Guenthe
Having done that, dupfdopen() has to handle a possible race. ok matthew@ krw@
2012-07-07Fix two races in socket splicing. When somove() gets called fromAlexander Bluhm
sosplice() to move the data already there, it might sleep in m_copym(). Another process must not unsplice during that sleep, so also lock the receive buffer when sosplice is called with fd -1. The same sleep can allow network interrupts to modify the socket buffer. So use sbsync() to write back modifications within the loop instead of fixing the socket buffer after the loop. OK claudio@
2012-06-21use regular i/o functions in the hibernate resume path. ahci(4) hibernateJonathan Matthew
i/o will not mix with regular i/o so it can only be used in the hibernate path. ok deraadt@ mlarkin@
2012-06-21RegeneratePhilip Guenthe
2012-06-21__tfork() needs to set the stack address of the new thread in the kernel,Philip Guenthe
so that it can't get a signal while still running on the parent thread's stack. Also, pass in sizeof(struct __tfork) to provide forward compat when more members are added. This is an ABI change, so switch syscall numbers and bump lib majors this time. ok deraadt@ matthew@
2012-06-20Delete some more SUBDIR += mac68k.Matthew Dempsky
2012-06-20Fix some hibernate issues on machines with > 3.5GB phys memMike Larkin
ok deraadt@
2012-06-20Cleanup our filesystem pathconf() code a little bit to make it easierMatthew Dempsky
to diff against FreeBSD's. From Brad; no object file change on amd64.
2012-06-13Expose reaperproc.Ariane van der Steldt
I need this for my diffs. ok guenther@
2012-06-06EVFILT_SIGNAL and EVFILT_PROC events need to track the process they'rePhilip Guenthe
attached to and not just the thread, which can go away. Problem observed by jsg@; ok jsg@ matthew@
2012-06-02Committed the wrong version (an earlier try) of the KERN_FILE2 vsPhilip Guenthe
rthreads fix. Update to the correct one.
2012-06-02Delete diagnostic code that reports timeout adjustments on resume.Philip Guenthe
It was useful for tracking down the last devices which weren't deleting their timeouts on suspend and recreating them on resume, but it's too verbose to keep around. noted by deraadt@
2012-05-30Oops, when we moved _POSIX_SAVED_IDS from sys/unistd.h to unistd.h, itMatthew Dempsky
silently changed sysctl kern.saved_ids from returning 1 to 0. ok millert
2012-05-30Fix a few issues in the pressure logic when the available buffers run low:Miod Vallat
- make sure the buffer reclaiming loop in buf_get() actually does something but spin, if `backoffpages' is nonzero and all free queues have been drained. - don't forget to set a poor man's condition variable to nonzero before tsleeping on it in bufadjust(), otherwise you'll never get woken up. - don't be too greedy and reassing backoffpages a large amount immediately after bufadjust() has been called. This fixes reproduceable hangs seen during heavy I/O (such as `make install' of many large files, e.g. run in /usr/src/lib with NOMAN=) on systems with a challenged number of pages (less than a few thousands, total). Part of this is temporary bandaid until a better pressure logic is devised, but it's solving an immediate problem. Been in snapshots for a solid month.
2012-05-25Change the KERN_FILE_BYPID and KERN_FILE_BYUID modes of the KERN_FILE2Philip Guenthe
sysctl() to be per-process instead of per-thread. This means the filedesc table has to really be per-process instead of per-thread, so make it an error for the linux clone() emulation to try to do otherwise. This removes pointless duplication in fstat's output. requested by jsing@ and deraadt@, ok matthew@ deraadt@
2012-05-24A couple of trivial spacing and comment fixes.Nicholas Marriott
ok miod blambert
2012-05-24unputc should clear the character removed in the buffers like getc.Nicholas Marriott
ok matthew miod deraadt
2012-05-24When clearing quote bits in getc and q_to_b, clear from the c_cf (theNicholas Marriott
first, that is being removed) rather than c_cl (the last). ok matthew miod deraadt
2012-05-24On resume, run forward the monotonic and realtimes clocks instead of jumpingPhilip Guenthe
just the realtime clock, triggering and adjusting timeouts to reflect that. ok matthew@ deraadt@