summaryrefslogtreecommitdiff
path: root/sys/kern
AgeCommit message (Collapse)Author
2014-09-05KASSERT that the page header pool will use in page headers.David Gwynne
2014-09-04Remove global cp_time[] array; no longer used now that all arches implementMiod Vallat
cpu_info.
2014-09-04rework how pools with large pages (>PAGE_SIZE) are implemented.David Gwynne
this moves the size of the pool page (not arch page) out of the pool allocator into struct pool. this lets us create only two pools for the automatically determined large page allocations instead of 256 of them. while here support using slack space in large pages for the pool_item_header by requiring km_alloc provide pool page aligned memory. lastly, instead of doing incorrect math to figure how how many arch pages to use for large pool pages, just use powers of two. ok mikeb@
2014-09-01sync generated filesDoug Hogan
2014-09-01Sync readlink(2) with IEEE Std 1003.1-2008.Doug Hogan
discussion, help and ok guenther@
2014-09-01Add explicit membars, so that we can stop requiring rw_cas() toPhilip Guenther
provide the magic. ok matthew@ dlg@
2014-08-31replace LRU bufcache with something originally modelled after 2Q.Ted Unangst
this should provide a degree of scan resistance, and also serves as a midway point for further development of multi queue algorithms. i've tried to minimize the risk and degree of regressions. probably ok beck
2014-08-31Sync enc/dec routines with libc.Miod Vallat
2014-08-31regenPhilip Guenther
2014-08-31Add additional kernel interfaces for setting close-on-exec on fdsPhilip Guenther
when creating them: pipe2(), dup3(), accept4(), MSG_CMSG_CLOEXEC, SOCK_CLOEXEC. Includes SOCK_NONBLOCK support. ok matthew@
2014-08-30Recognize EFI protective and system partitions. Do not put disklabel entriesMiod Vallat
for the protective ones when creating a fake label, but do, for the system ones, so that we may eventually copy boot code to them. From Markus Mueller
2014-08-30Fix profiling (GPROF) build.Martin Pieuchot
2014-08-27deprecate the "item offset" handling. nothing uses it, so we canDavid Gwynne
cut it out of the code to simplify things. ok mikeb@
2014-08-20Bye bye /dev/cryptoMike Belopuhov
The interface has been disabled by default for about 4 years and currently there's not much value in having it around at all. ok deraadt
2014-08-20bring back r1.130:David Gwynne
add an explicit rwlock around the global state (the pool list and serial number) rather than rely on implicit process exclusion, splhigh and splvm. the only things touching the global state come from process context so we can get away with an rwlock instead of a mutex. thankfully. ok matthew@
2014-08-18dont rely on mbuf.h to provide pool.h.David Gwynne
ok miod@, who has offerred to help with any MD fallout ok guenther@
2014-08-18introduce mbuf list and queue apis. both manage fifo lists of mbufsDavid Gwynne
and a count of the mbufs. struct mbuf_list and the ml_foo() apis can be used to build lists of mbufs where you dont need locking (eg, on the stack). struct mbuf_queue and mq_foo() wrap mbuf_lists with a mutex, and limits the number of mbufs that can be queued. they can be useful for moving mbufs between contexts/subsystems. with help from jmc@ for the manpage bits mpi@ is keen
2014-08-18external page headers use an RB tree to find the page headerDavid Gwynne
containing an item when its returned to the pool. this means you need to do an inexact comparison between an items address and the page address, cos a pool page can contain many items. previously this used RB_FIND with a compare function that would do math on every node comparison to see if one node (the key) was within the other node (the tree element). this cuts it over to using RB_NFIND to find the closest tree node instead of the exact tree node. the node compares turns into simple < and > operations, which inline very nicely with the RB_NFIND. the constraint (an item must be within a page) is then checked only once after the NFIND call. feedback from matthew@ and tedu@
2014-08-17i broke the userland shim used for the extent regress test when iDavid Gwynne
made it so struct pool was only visible to _KERNEL. tedu broke it too when he added the size argument to the kernel free functions. this fixes both issues. the main change is to provide a local version of struct pool with just the bit (pr_size) needed for extent to run. if extents take advantage of more malloc/pool features (eg, {M,PR}_ZERO then this will need to be updated again. found by and based on a diff from Theo Buehler ok mpi@
2014-08-14No need for raw_cb.hMartin Pieuchot
2014-08-12sigh. when returning ENOENT in the sysctl path, unlock on the way out.David Gwynne
2014-08-12i accidentally removed the check for whether the requested pool inDavid Gwynne
the sysctl path exists. return ENOENT instead of trying a NULL deref.
2014-08-12bring back r1.135:David Gwynne
matthew@ noticed i wasnt populating npages in the kinfo_pool sent to userland.
2014-08-12bring back r1.134:David Gwynne
inline is the new __inline
2014-08-12bring back r1.132. this is a bit different cos we're still using splvm toDavid Gwynne
protect pool_list rather than the rwlock that made i386 blow up: provide a pool_count global so we can figure out how many pools there are active without having to walk the global pool_list.
2014-08-11Do not pmap_update(pmap_kernel()) within the `create mappings' loop, but onlyMiod Vallat
once after it is over.
2014-08-11bring back r1.132:David Gwynne
provide a pool_count global so we can figure out how many pools there are active without having to walk the global pool_list.
2014-08-11bring back r1.131:David Gwynne
take the pools mutex when copying stats out of it in the sysctl path so we are guaranteed a consistent snapshot.
2014-08-10Write the core file of a non-suid process into the current directoryAlexander Bluhm
even if sysctl kern.nosuidcoredump has been set to 2 or 3. This allows a regular user to debug his programs again. OK guenther@ deraadt@
2014-07-28I/O ktrace of sendsyslog(2) did not work. As uiomove() adjustsAlexander Bluhm
iov_len to 0, we need a propper length calculation. While there, use -1 for the file descriptor because 0 is reserved for stdin. OK deraadt@ guenther@
2014-07-26If we're stopping a secondary cpu, don't let sched_choosecpu() short-circuitMark Kettenis
and return the current current CPU, otherwise sched_stop_secondary_cpus() will spin forever trying to empty its run queues. Fixes hangs during suspend that many people reported over the last couple of days. ok bcook@, guenther@
2014-07-23Set the console input in polling mode before entering ukc.Martin Pieuchot
ok miod@, deraadt@, shadchin@
2014-07-22The last poison change is awesome, it is triggering use after free bugs.Theo de Raadt
Some of them aren't too difficult to find and fix, but others are turning out to be deeply hidden. The timing is poor -- disable this for now. We need to revisit this right after tree unlock.
2014-07-22Fewer <netinet/in_systm.h> !Martin Pieuchot
2014-07-21fix some wrong comments and a bit of KNFMike Larkin
2014-07-20Support hibernating to softraid crypto volumes.Mike Larkin
much help and ok from deraadt@
2014-07-17zero random buf for sysctl too, just in caseTed Unangst
2014-07-16Reenable hibernate RLE support and flush+zero all memory after unpack.Mike Larkin
2014-07-13use mallocarray for multiplied value checkingTed Unangst
2014-07-13KASSERTMSG(9): New kernel assertion with messageMasao Uebayashi
KASSERT() is annoying as it only prints the expression as a string. If you (developers) want to know a little more information, you have to do: #ifdef DIAGNOSTIC if (bad) panic(...); #endif KASSERTMSG() replaces it into a single line: KASSERTMSG(!bad, ...); Taken from NetBSD. (There is a concern that KASSERT() messages are too long; consume more memory, and not friendly for small monitors. This have to be considered & revisited later.) "Like" from henning@ Man page review & advices from jmc@ and schwarze@
2014-07-13Fix sched_stop_secondary_cpus() to properly drain CPUsMatthew Dempsky
TAILQ_FOREACH() isn't safe to use in sched_chooseproc() to iterate over the run queues because within the loop body we remove the threads from their run queues and reinsert them elsewhere. As a result, we end up only draining the first thread of each run queue rather than all of them. ok kettenis
2014-07-13Introduce PS_NOBROADCASTKILL a process flag that excludes processes fromClaudio Jeker
receiving broadcast signals (kill -1). The flag can be set via a new sysctl KERN_PROC_NOBROADCASTKILL. This will be used by iscsid to survive the mass killing by init(8) when terminating multi-user operations. With and OK guenther@
2014-07-13bzero -> memset. for the speeds.Ted Unangst
2014-07-13trim some castsTed Unangst
2014-07-13KERNEL_ASSERT_LOCKED(9): Assertion for kernel lock (Rev. 3)Masao Uebayashi
This adds a new assertion macro, KERNEL_ASSERT_LOCKED(), to assert that kernel_lock is held. In the long process of removing kernel_lock, there will be a lot (hundreds or thousands) of use of this; virtually almost all functions in !MP-safe subsystems should have this assertion. Thus this assertion should have a short, good name. Not only that "KERNEL_ASSERT_LOCKED" is consistent with other KERNEL_* and SCHED_ASSERT_LOCKED() macros. Input from dlg@ guenther@ kettenis@. OK dlg@ guenther@
2014-07-13Initial support to read GPT partition tables in the kernel, if option GPT.Miod Vallat
Contributed by Markus Mueller; code based upon Bitrig's GPT support, with stricter GPT structures validation and support for alternate header places. ok deraadt@ jsing@ krw@
2014-07-13use mallocarray where arguments are multipled. ok deraadtTed Unangst
2014-07-13pass the size to free in some of the obvious casesTed Unangst
2014-07-13if the freedsize isn't zero, check that's reasonable. ok beckTed Unangst
2014-07-13If the only process in the pgrp is in the middle of exiting, it mightPhilip Guenther
not have any threads left. Treat that the same as an empty pgrp. encountered by and ok deraadt@