summaryrefslogtreecommitdiff
path: root/sys/kern
AgeCommit message (Collapse)Author
2014-11-05don't use loop variable (i) for not loop things. use a new var.Ted Unangst
2014-11-05use memname to print string of type. stolen from deraadtTed Unangst
2014-11-05also print type when free size is wrongTed Unangst
2014-11-05No reason to have things like the hibernate allocation area and chunkMike Larkin
ordering regions mapped executable, so remove those permissions. ok deraadt@
2014-11-05change the mbuf pool wait channel name from mbpl to mbufpl. "mb"David Gwynne
isnt descriptive enough for me. ok deraadt@
2014-11-04panic when a sensordev gets installed twice, instead of blowing up amazinglyJasper Lievisse Adriaanse
later on ok deraadt@
2014-11-03include sys/unistd.h where needed instead of indirect reliance. ok jsgTed Unangst
2014-11-03correct test logic. ok guentherTed Unangst
2014-11-03Put the socket splicing fields into a seperate struct sosplice thatAlexander Bluhm
gets only allocated when needed. This way struct socket shrinks from 472 to 392 bytes on amd64. When splicing gets active, another 88 bytes are allocated for struct sosplice. OK dlg@
2014-11-03deobfuscate by pulling le conversions up. use mallocarray.Ted Unangst
2014-11-03pass size argument to free()Theo de Raadt
ok doug tedu
2014-11-02Unmap the hibernate hiballoc page after we are done with it.Mike Larkin
ok deraadt, kettenis
2014-11-02tweak free panic messages tooTed Unangst
2014-11-02tweak panic messages for consistencyTed Unangst
2014-11-01add a few sizes to freeTed Unangst
2014-11-01remove color support. discussed with dlg and mikebTed Unangst
2014-10-26Now that threads hold their own reference to their ucreds, sys_ktrace()Philip Guenther
doesn't need to hold an extra reference during the call ok deraadt@ millert@
2014-10-25Do not launch the page zeroing thread on MULTIPROCESSOR m88k systems. ThisMiod Vallat
causes a deadlock between reaper and zerothread I am currently investigating.
2014-10-22Extend domknodat() to support S_IFIFO directly and remove domkfifoat().Todd C. Miller
Both sys_mkfifo(2) and sys_mkfifoat(2) could be replace by libc wrappers using mknodat(2) at a later date if we desire. OK guenther@
2014-10-22Remove some unused/unneeded code.Mike Larkin
2014-10-22Use the global piglet address variables as sparingly as possible to avoidMike Larkin
redundant copies of the same information. No functional change. Also add some comments as to how these globals are used.
2014-10-18Don't assume that ep_taddr and ep_daddr are page-aligned. It is possible toMark Kettenis
construct ELF executables for which ep_daddr ends up not being properly aligned. Sanitize the addresses before setting up the address space for the new executable. Should fix the panic discovered by Alejandro Hernandez. ok miod@
2014-10-17cpu_setperf and perflevel must remain exposed, otherwise a bunch ofTheo de Raadt
MD code needs excess #ifndef SMALL_KERNEL
2014-10-17redo the performance throttling in the kernel.Ted Unangst
introduce a new sysctl, hw.perfpolicy, that governs the policy. when set to anything other than manual, hw.setperf then becomes read only. phessler was heading in this direction, but this is slightly different. :)
2014-10-16No need to reserve separate KVA ranges for the RLE and copy pages inMike Larkin
hibernate anymore.
2014-10-13disable pagezero thread on hppa, until failure gets diagnosed, ok miod kettenisTheo de Raadt
2014-10-13POSIX says that mknod(2) should support fifos. OK guenther@Todd C. Miller
2014-10-13use mallocarray to get the array of pollfd structs.David Gwynne
tweaks and ok millert@ deraadt@
2014-10-13take the pool_item pi_magic touching out from under #ifdef DIAGNOSTIC.David Gwynne
i couldnt measure a significant performance difference with or without it. this is likely a function of the memory involved being close to bits that are already being touched, the implemention being simple macros that mean registers can stay hot, and a lack of conditionals that would cause a cpu pipeline to crash. this means we're unconditionally poisoning the first two u_longs of pool items on all kernels. i think it also makes the code easier to read. discussed with deraadt@
2014-10-11back out; does not even compileTheo de Raadt
2014-10-11resurrect a many year old diff. move CPU throttling into the kernel,Ted Unangst
enabled by setting hw.setperf=-1. some other bugs preventing this from going in before have been fixed. my thanks to phessler for keeping the diff alive in the mean time. tested by several to not regress.
2014-10-10massage the pool item header and pool item magic words.David Gwynne
previously they were ints, but this bumps them to long sized words. in the pool item headers they were followed by the XSIMPLEQ entries, which are basically pointers which got long word alignment. this meant there was a 4 byte gap on 64bit architectures between the magic and list entry that wasnt being poisoned or checked. this change also uses the header magic (which is sourced from arc4random) with an xor of the item address to poison the item magic value. this is inspired by tedu's XSIMPLEQ lists, and means we'll be exercising memory with more bit patterns. lastly, this takes more care around the handling of the pool_debug flag. pool pages read it when theyre created and stash a local copy of it. from then on all items returned to the page will be poisoned based on the pages local copy of the flag. items allocated off the page will be checked for valid poisoning only if both the page and pool_debug flags are both set. this avoids a race where pool_debug was not set when an item is freed (so it wouldnt get poisoned), then gets set, then an item gets allocated and fails the poison checks because pool_debug wasnt set when it was freed.
2014-10-09remove lkm filesTed Unangst
2014-10-09remove LKM supportTed Unangst
2014-10-09regenTed Unangst
2014-10-09delete LKM syscall stubsTed Unangst
2014-10-09fix some data type mismatches in the zlib paths in hibernateMike Larkin
2014-10-09remove an unused function and some unused variables in hibernateMike Larkin
2014-10-08make workq/taskq runner threads yield when they've hogged the cpuBret Lambert
ok deraadt@ dlg@ phessler@
2014-10-08Now that the cleaner yields the cpu, we can stop checkingBret Lambert
to see if we've hogged the cpu for >1 second. okay miod@
2014-10-03Introduce a thread for zeroing pages without holding the kernel lock. ThisMark Kettenis
way we can do some useful kernel lock in parallel with other things and create a reservoir of zeroed pages ready for use elsewhere. This should reduce latency. The thread runs at the absolutel lowest priority such that we don't keep other kernel threads or userland from doing useful work. Can be easily disabled by disabling the kthread_create(9) call in main(). Which perhaps we should do for non-MP kernels. ok deraadt@, tedu@
2014-10-03if you're adding the first cluster reference, you dont have toDavid Gwynne
coordinate with other mbufs so you can add all the pointers without taking the extref lock. looks good deraadt@
2014-10-03i moved some macros into functions, and a trailing \ on a statementDavid Gwynne
snuck in. someone who knows how cpp/cc works can explain to me why this compiled.
2014-10-03now that pools are mpsafe, we can make the mbuf allocators on topDavid Gwynne
of pools mpsafe too. this calles pool_setipl(IPL_NET) against the mbuf and cluster pools, and removes the use of splnet(). the other locking done in the mbuf layer is for external cluster references. again, they relied on splnet to serialise these operations. because there is no shared memory associated with external clusters (except the cluster itself, which is completely dedicated to data payload, not meta info like a refcount or lock), this has been replaced with a single mutex that all reference ops are serialised with. tested by me, jmatthew@, bcook@, and phessler@
2014-10-01sl(4) is no more, thanks for all the fish!Martin Pieuchot
2014-09-28Replace uvm_km_alloc(9) and uvm_km_free(9) with the equivalent km_alooc(9)Mark Kettenis
and km_free(9) calls. ok tedu@, mlarkin@
2014-09-28in pool_destroy, enter and leave mutex as necessary to satisfy assertions.Ted Unangst
ok dlg
2014-09-27add back inverted poison patterns. keep high bits, but twiddle low bits.Ted Unangst
2014-09-26Rework piglet and pig allocation. Currently the piglet gets allocatedMark Kettenis
deep down in the suspend path, where it is really hard to recover from allocation failure. So allocate the piglet early on in the suspend path. Also change the piglet and piglet allocation functions to use km_alloc(9) instead of doing pmemrange magic. This removes a bunch of code which, in the case of the piglet allocation, is broken since it results in a NULL pointer dereference. Also switch the piglet allocation to not wait. If we can't allocate 16MB of phys contig memory on a halfway modern machine we're almost certainly under a lot of memory pressure and we're better off not trying to hibernate anyway. ok mlarkin@
2014-09-26fix the calculation of the number of items to prime the pool withDavid Gwynne
in pool_setlowat. this was stopping arm things from getting spare items into their pmap entry pools, so things that really needed them in a delicate part of boot were failing. reported by rapha@ co-debugging with miod@