summaryrefslogtreecommitdiff
path: root/sys/kern
AgeCommit message (Collapse)Author
2013-11-14Use (N * sizeof(struct klist)) instead of (N * sizeof(struct klist *))Charles Longeau
when malloc'ing struct klist *. Similar diff found upstream: http://svnweb.freebsd.org/base?view=revision&revision=197575 Found by LLVM/Clang Static Analyzer. ok tedu@ krw@ guenther@
2013-11-09Remove hibernate_get_next_rle function (unused, and we need to redo itMike Larkin
anyway as we move toward a streamed implmentation)
2013-11-09Add KASSERT()s to tsleep() and msleep() to verify that bogus flagsPhilip Guenther
aren't being passed to them. Fix UVM_WAIT() to not pass PNORELOCK to tsleep(), as that flag only does something with msleep(). ok beck@ dlg@
2013-11-09ticks is compared against mcl_grown to see if time has elapsed sinceDavid Gwynne
the rx ring was last allowed to grow and then assigned to it. it is erroneous to do this because mcl_grown is a u_int and ticks is an int. this makes mcl_grown an int, and follows the idiom in kern_timeout.c of going "thing - ticks < diff", which better copes with ticks wrapping around and being used to calculate relative intervals. ok pirofti@ guenther@
2013-11-09unbias the chunks and chunktable writing and reading. as a result, itTheo de Raadt
is now possible to move the chunktable right after the chunks, not at the end of the swap. ok mlarkin
2013-11-06simplify a crazy expressionTheo de Raadt
2013-11-06In hibernate_write_chunks(), keep track of relative block numbers insteadTheo de Raadt
of absolute, so that we can add range checking. ok mlarkin
2013-11-06spacingTheo de Raadt
2013-11-06return the known error, instead of EIOTheo de Raadt
2013-11-06shorten dev_t in hib_infoTheo de Raadt
2013-11-06shorten variable name for the hibernate info struct, throughout. MuchTheo de Raadt
easier to read now. ok mlarkin
2013-11-06use DEV_BSIZE instead of "secsize"Theo de Raadt
ok mlarkin
2013-11-06teach the side-effect free drivers about the partition they are dealingTheo de Raadt
by passing a start/length in the HIB_INIT op. Then rebase all hibernate-time block offsets to be relative to the start of that partition. This simplifies things a lot. ok mlarkin
2013-11-06Errant assignment that snuck in long ago. Pointed out by deraadt@Mike Larkin
2013-11-05Change an #if 0 surrounding a debug printf into a DPRINTF instead.Mike Larkin
2013-11-05new function uvm_hibswap() finds a the largest free zone in swap, whichTheo de Raadt
hibernate can use place the data. ok mlarkin
2013-11-05remove pool constructors and destructors. theyre called for everyDavid Gwynne
get and put, so they dont save us anything by caching constructed objects. there were no real users of them, and this api was never documented. removing conditionals in a hot path cant be a bad idea either. ok deraadt@ krw@ kettenis@
2013-11-05Replace direct references to p_size, p_offset and d_secperunit withKenneth R Westerback
DL_[GET|SET]PSIZE(), DL_[GET|SET]POFFSET(), DL_[GET|SET]DSIZE() in order to get|set correct value that includes the high bits of the value.
2013-11-04move kernel sensor tasks from using workqs to tasks. while hereDavid Gwynne
whack the locking and task cancellation. sensor updates tested locally, and by mpi@ on ugold(4). ok mpi@
2013-11-01Sprinkle (long long) casts where %lld is being used to print daddr_tKenneth R Westerback
variables. Some random whitespace/knf repairs encountered on the way. ok miod@ on inspection, feedback & more suggestions from millert@
2013-10-30Use local variables for ap->a_p where appropriate.Philip Guenther
ok deraadt@
2013-10-30deprecate taskq_systq() and replace it with extern struct taskqDavid Gwynne
*const systq defined in task.h this reduces the cost of using the system taskq and looks less ugly. requested by and ok kettenis@
2013-10-29since taskq_create is only callable from autoconf or process context, itDavid Gwynne
is safe to ask malloc to wait for memory. pointed out by millert@
2013-10-29sys/task.h includes sys/queue.h, so kern/kern_task.c doesnt needDavid Gwynne
to do that again. kern/kern_task.c doesnt use pools so we dont need sys/pool.h either.
2013-10-29use unsigned int instead of u_int to reduce the depend on types.h.David Gwynne
might make jsg a little happier.
2013-10-29introduce tasks and taskqs as an alternative to workqs.David Gwynne
tasks are modelled on the timeout api, so users familiar with timeout_set, timeout_add, and timeout_del will already know what to expect from task_set, task_add, and task_del. i wrote this because workq_add_task can fail in the place you actually need it, and there arent any good ways of recovering at that point. workq_queue_task was added to try and help, but required external state to be stored for users of that api to know whether something was already queued or not. workqs also didnt provide a way to cancel or remove work. this has been percolating with a bunch of people. putting it in as i wrote it so i can apply their feedback to the code with the history kept in cvs.
2013-10-29Unlock the vnode while calling a device's d_close routine, except whenPhilip Guenther
it's locked for changing the type (i.e., revoke()). We already unlock it while calling the d_open, d_read, and d_write routines and this is safe for the same reason: the device routines operate at a lower level and don't need the protection of the vnode locks. This is important as the device close routine may block indefinitely. "don't see anything wrong" tedu@
2013-10-25fix commentTodd C. Miller
2013-10-25Move the declarations for dogetrusage(), itimerround(), and dowait4()Philip Guenther
to sys/*.h headers so that the compat/linux code can use them. Change dowait4() to not copyout() the status value, but rather leave that for its caller, as compat/linux has to translate it, with the side benefit of simplifying the native code. Originally written months ago as part of the time_t work; long memory, prodding, and ok from pirofti@
2013-10-22- add UNIX-domain socket info to struct kinfo_file2Philip Guenther
- convert netstat from kvm_getfiles() to kvm_getfile2() using that - delete kvm_getfiles() and KERN_FILE as no longer used (bump libkvm's major) - rename kvm_getfile2() to kvm_getfiles(), kinfo_file2 to kinfo_file and KERN_FILE2 to KERN_FILE. ok deraadt@, millert@ ports scan sthen@
2013-10-20Informational message on unpack startMike Larkin
2013-10-20KNF a long line.Kenneth R Westerback
2013-10-20Provide more debugging aids when failing to read the packed image from diskMike Larkin
during hibernate resume. requested by deraadt
2013-10-20DPRINTFs for various failure cases, disabled by default (uncommentMike Larkin
HIB_DEBUG to see these)
2013-10-20Flush the cache after bouncing the inflate page to the piglet.Mike Larkin
Fixes resume time stream corruption seen on x230 with large (16GB) unhibernation
2013-10-20Use a second inflate page for stream finalize, since it is possibleMike Larkin
(though unlikely) for the end of stream marker to overflow from one page. This should fix a few (but not all) spurious failure-to-hibernate errors. Also remove an unnecessary cache flush during deflate. ok deraadt
2013-10-19Use daddr_t * instead of int * for the partoffp parameter toKenneth R Westerback
readdoslabel(). Ditto all the MD variables whose addresses are passed to readdoslabel() via partoffp. Fix some 512-byte block vs disk sector confusion in hppa and sgi. All the DL_GETxxxxx() defines return disk sector values. All DL_SETxxxx() take disk sector values. These changes should be no-ops until a drive using non-512-byte-sectors is encountered. ok deraadt@
2013-10-19When hooks are called, allow them to disestablish themselves by usingReyk Floeter
the safe version to traverse the TAILQ list. ok deraadt@
2013-10-17another lurking ecoff reference is found..Theo de Raadt
2013-10-17Remove support for a.out and ecoff. We only do elf now.Theo de Raadt
ok miod
2013-10-15repair typo talking about a.outTheo de Raadt
2013-10-14Display correct values (i.e. blocks where blocks are meant) inKenneth R Westerback
diskerr() messages by doing DL_SECTOBLK() dance repeatedly.
2013-10-11poll(2) on a closed tty should return POLLIN|POLLHUP in reventsTodd C. Miller
when events is set to POLLIN and POLLHUP when events is set to POLLOUT. In the pty case we need to be careful to only treat the pty as closed if carrier is on. This fixes a hang on close problem seen with ssh and xterm.
2013-10-08Fix delivery of SIGPROF and SIGVTALRM to threaded processes by havingPhilip Guenther
hardclock() set a flag on the running thread and force AST processing, and then have the thread signal itself from userret(). idea and flag names from FreeBSD ok jsing@
2013-10-08If a thread sends a signal to its own process, then have that threadPhilip Guenther
take the signal by preference if it's eligible (unblocked or sigwaiting). ok jsing@
2013-10-07disk sizes, partition sizes and partition offsets are u_int64_tKenneth R Westerback
values rather than daddr_t values. So use u_int64_t to store them and %llu to print them in checkdisklabel().
2013-10-06Tweak commentPhilip Guenther
2013-10-06Replace some XXX casts with an inline function that explains what's going onPhilip Guenther
ok deraadt@
2013-10-06Add CLOCK_UPTIME, a clock which measures time-running-not-suspended, soPhilip Guenther
that mlarkin@ can fix programs that report rates-over-uptime. ok kettenis@ manpage corrections jmc@ (which I've probably broken again)
2013-10-06Back out POLLHUP change until a problem with xterm hanging on closeTodd C. Miller
is fixed.