summaryrefslogtreecommitdiff
path: root/sys/kern
AgeCommit message (Collapse)Author
2013-06-09arguments to bcopy/memmove are reversed. put on thinking cap, then commit.Ted Unangst
2013-06-09regenMiod Vallat
2013-06-09Constify the mib argument of sysctl().Miod Vallat
ok matthew@ millert@
2013-06-09change a bcopy to memmove (mainly to catch platforms that don't offer it)Ted Unangst
2013-06-06Prevent idle thread from being stolen on startup.Christiano F. Haesbaert
There is a race condition which might trigger a case where two cpus try to run the same idle thread. The problem arises when one cpu steals the idle proc of another cpu and this other cpu ends up running the idle thread via spc->spc_idleproc, resulting in two cpus trying to cpu_switchto(idleX). On startup, idle procs are scaterred around different runqueues, the decision for scheduling is: 1 look at my runqueue. 2 if empty, look at other dudes runqueue. 3 if empty, select idle proc via spc->spc_idleproc. The problem is that cpu0's idle0 might be running on cpu1 due to step 1 or 2 and cpu0 hits step 3. So cpu0 will select idle0, while cpu1 is in fact running it already. The solution is to never place idle on a runqueue, therefore being only selectable through spc->spc_idleproc. This race can be more easily triggered on a HT cpu on virtualized environments, where the guest more often than not doesn't have the cpu for itself, so timing gets shuffled. ok tedu@ guenther@ go ahead after t2k13 deraadt@
2013-06-05Move FHASLOCK from f_flag to f_iflags, freeing up a bit for passingPhilip Guenther
O_* flags and eliminating an XXX comment. ok matthew@ deraadt@
2013-06-05factor out pid allocation to functions. add a small cache of recentlyTed Unangst
exited pids that won't get recycled. ok deraadt
2013-06-05blow up sooner rather than later for double pool_putTed Unangst
ok deraadt
2013-06-03When creating a thread, don't add it to the process's thread listPhilip Guenther
until it's fully built, so that it can't get a signal from realitexpire(), as seen by sthen@ and espie@ in ports builds. Exact bits moved down worked out with tedu@, ok deraadt@
2013-06-03Convert some internal APIs to use timespecs instead of timevalsPhilip Guenther
ok matthew@ deraadt@
2013-06-03changes for isc fuse support. not enabled. ok beck deraadt.Ted Unangst
from Sylvestre Gallon ccna.syl gmail.com
2013-06-02Use long long and %lld for printing tv_sec valuesPhilip Guenther
ok deraadt@
2013-06-02Coredumping is now single-threaded, so update comment about lockingPhilip Guenther
2013-06-01cleanup and consolidate the spinlock_lock (what a name!) code.Ted Unangst
it's now atomic_lock to better reflect its usage, and librthread now features a new spinlock that's really a ticket lock. thrlseep can handle both types of lock via a flag in the clock arg. (temp back compat hack) remove some old stuff that's accumulated along the way and no longer used. some feedback from dlg, who is concerned with all things ticket lock. (you need to boot a new kernel before installing librthread)
2013-06-01Work around stack smash protector getting confused because we switchedMike Larkin
stacks by not returning (ever) from hibernate_unpack_image.
2013-06-01Change return codes in various hibernate functions to be able to laterMike Larkin
distinguish one failure path from another. Comment the same. Also removed some extraneous comments regarding pmap_activate.
2013-06-01regenTed Unangst
2013-06-01always implement stub utrace syscall, but keep the body #ifdef KTRACETed Unangst
ok guenther matthew
2013-06-01As found by kurt, there's a twisty race between exit1 and fork1Ted Unangst
with threaded processes. Fix this by checking for an attempt to go single threaded in fork1 and account for the new thread as well. ok espie guenther kurt
2013-06-01regenMiod Vallat
2013-06-01Add utrace(2), a system call allowing for userland to send its own ktraceMiod Vallat
records. From FreeBSD via otto@, with tweaks suggested by guenther@. Commite on behalf of otto@ who is not around, to ride the libc minor bump. Causes a librthread minor bump as well (new syscall).
2013-06-01some small style changes that are distracting me from seeing a real bugTed Unangst
2013-05-31open up some races. if pool_debug == 2, force a yield() whenever waitok.Ted Unangst
ok miod
2013-05-31We need to halt the APs on MP hibernate resume or else they will beMike Larkin
executing code possibly causing side effects during the image unpack operation. But before we can halt the APs, we need to complete their init (as they will be hatched but idling, possibly with interrupts off). Introduces MD function hibernate_quiesce_cpus to do this, called from the MI hibernate resume code. ok deraadt
2013-05-31On NOTE_EXIT event of EVFILT_PROC, store the exit status in kn_data.YASUOKA Masahiko
ok guenther tedu deraadt
2013-05-31unfortunately the sparc pagesize handling also requires uvm_extern.hTheo de Raadt
2013-05-30Make interrupt handling in hibernate resume MI by providing MD-specificMike Larkin
functions to enable and disable interrupts, if needed. If a platform doesnt need interrupt handling in this way, the MD function can be a no-op. discussed with pirofti and deraadt
2013-05-30tiny change to support two poison values based on page addrTed Unangst
2013-05-30Enforce ca_activate tree-walks over the entire heirarchy for all events,Theo de Raadt
cleaning up some shutdown-hook related code on the way. (A few drivers related to sparc are still skipped at kettenis' request) ok kettenis mlarkin, tested by many others too
2013-05-30Comment a KASSERT whose purpose wasn't immediately apparentMike Larkin
2013-05-19select(-1, ...) should fail with EINVAL.Philip Guenther
ok matthew@
2013-05-07Merge from FreeBSD, r191313Philip Guenther
--------------------------- On the exit of the child process which parent either set SA_NOCLDWAIT or ignored SIGCHLD, unconditionally wake up the parent instead of doing this only when the child is a last child. This brings us in line with other U**xes that support SA_NOCLDWAIT. If the parent called waitpid(childpid), then exit of the child should wake up the parent immediately instead of forcing it to wait for all children to exit. --------------------------- ok tedu@, millert@
2013-05-06restore original gangster lockstatus return values for compatTed Unangst
2013-05-03switch the malloc and pool freelists to using xor simpleq.Ted Unangst
this adds a tiny bit more protection from list manipulation.
2013-05-02according to pedro, ids work better with the ending $Ted Unangst
2013-05-01a few tweaks noticed by jsingTed Unangst
2013-05-01exorcise lockmgr. the api remains, but is now backed by recursive rwlocks.Ted Unangst
originally by thib. ok deraadt jsing and anyone who tested
2013-04-29regenMatthew Dempsky
2013-04-29Extend P_SIGSUSPEND handling in userret() to properly restore theMatthew Dempsky
sigmask even if there are no pending signals under the temporary sigmask. Refactor existing select() and poll() system calls to introduce the pselect() and ppoll() system calls. Add rthread wrappers for pselect() and ppoll(). While there, update cancellation point comments to reflect recent fdatasync() addition. Minor bumps for libc and librthread due to new symbols. ok guenther, millert, deraadt, jmc
2013-04-24Add tstohz(9) as the timespec analog to tvtohz(9).Matthew Dempsky
ok miod
2013-04-24When a ucom(4) is removed, it frees the tty with ttyfree(). However ifNicholas Marriott
anyone is waiting with kqueue their knotes may still have a reference to the tty and later try to use it in the filt_tty* functions. To avoid this, walk the knotes in ttyfree(), remove them from the tty's list and invalidate them by setting kn_hook to NODEV. The filter functions can then check for this and safely ignore the knotes. ok tedu matthieu
2013-04-24When attaching disks, feed the disklabel's checksum toBret Lambert
the random pool as unique-esque-but-not-secret data. inspired by conversations with tedu@/deraadt@ ok deraadt@
2013-04-19sprinkle ifdef MP to disable cpu migration code when not needed.Ted Unangst
ok deraadt
2013-04-17check that the pool we are about to init isn't already on the list inTed Unangst
order to detect double init mistakes. add a similar check and rearrange pool_destory to detect the opposite mistake.
2013-04-16Some compat options require snapshot coordinationPhilip Guenther
2013-04-15regenJoel Sing
2013-04-15regenJoel Sing
2013-04-15Add an f_mntfromspec member to struct statfs, which specifies the name ofJoel Sing
the special provided when the mount was requested. This may be the same as the special that was actually used for the mount (e.g. in the case of a device node) or it may be different (e.g. in the case of a DUID). Whilst here, change f_ctime to a 64 bit type and remove the pointless f_spare members. Compatibility goo courtesy of guenther@ ok krw@ millert@
2013-04-10Fix various glitches in queue macro usage.Philip Guenther
ok millert@
2013-04-09Add a magic number to the head of the signature block. Check for magicMike Larkin
number match during signature block read during speculative unhibernate on boot. If the magic number matches but we have otherwise chosen to not unhibernate (due to kernel/memory mismatch), clear the signature block early to avoid accidentally trying to unhibernate on subsequent boots. This prevents accidental unhibernates and endless unhibernate/reboot cycles. Add a define for HIBERNATE_DEBUG for various debugging printfs (disabled by default). Finally, change some KASSERTs to warning printfs (they probably shouldn't have been KASSERTs in the first place). "looks good" deraadt@