summaryrefslogtreecommitdiffstats
path: root/sys/kern
Commit message (Collapse)AuthorAgeFilesLines
* Retire td_syscalls now that it is no longer needed.jhb2010-07-152-2/+0
|
* A cosmetic change - don't output empty <flags>.ivoras2010-07-151-2/+2
|
* Rename timeevents.c to kern_clocksource.c.mav2010-07-141-0/+0
| | | | Suggested by: jhb@
* - Document layout of KTR_STRUCT payload in a comment.jhb2010-07-141-6/+4
| | | | | | | | - Simplify ktrstruct() calling convention by having ktrstruct() use strlen() rather than requiring the caller to hand-code the length of constant strings. MFC after: 1 month
* Move timeevents.c to MI code, as it is not x86-specific. I already havemav2010-07-141-0/+508
| | | | | it working on Marvell ARM SoCs, and it would be nice to unify timer code between more platforms.
* Correctly copy the M_RDONLY flag when duplicating a referencecperciva2010-07-131-0/+1
| | | | | | | | to an mbuf external buffer. Approved by: so (cperciva) Approved by: re (kensmith) Security: FreeBSD-SA-10:07.mbuf
* Use type-specific inline function imax() instead of deprecated macro MAX().jkim2010-07-121-1/+1
| | | | Prodded by: bde
* Change the implementation of vm_hold_free_pages() so that it performs atalc2010-07-111-26/+16
| | | | | | | | | most one call to pmap_qremove(), and thus one TLB shootdown, instead of one call and TLB shootdown per page. Simplify the interface to vm_hold_free_pages(). MFC after: 3 weeks
* Remove interval validation from cpu_tick_calibrate(). As I found, checkmav2010-07-111-36/+14
| | | | | | | | was needed at preliminary version of the patch, where number of CPU ticks was divided strictly on 16 seconds. Final code instead uses real interval duration, so precise interval should not be important. Same time aliasing issues around second boundary causes false positives, periodically logging useless "t_delta ... too long/short" messages when HZ set below 256.
* Add support for the VM_ALLOC_COUNT() hint to vm_page_alloc(). Consequently,alc2010-07-091-3/+2
| | | | | | | | | | | | the maintenance of vm_pageout_deficit can be localized to just two places: vm_page_alloc() and vm_pageout_scan(). This change also corrects an off-by-one error in the maintenance of vm_pageout_deficit. Historically, the buffer cache functions, allocbuf() and vm_hold_load_pages(), have not taken into account that vm_page_alloc() already increments vm_pageout_deficit by one. Reviewed by: kib
* Accidentally committed an older version of this comment rather than thejhb2010-07-091-4/+4
| | | | final one.
* Refine a comment.jhb2010-07-091-5/+4
| | | | Reviewed by: bde
* Remove redundant high >= 0.jh2010-07-091-1/+1
| | | | Reported by: rstone
* Implement optional 'precision' for numbers. Previously, it was parsed butjkim2010-07-081-11/+14
| | | | | ignored. Some third-party modules (e.g., APCICA) prefer this format over zero padding flag '0'.
* - Various style and whitespace fixes.jhb2010-07-081-2/+2
| | | | | | | - Make sugid_coredump and kern_logsigexit private to kern_sig.c. Submitted by: bde (partially) MFC after: 1 month
* Assert that low and high are >= 0. The allocator doesn't support thejh2010-07-081-2/+2
| | | | negative range.
* - Simplify logic in handling ticks wrap-upattilio2010-07-071-13/+10
| | | | | | | | | | | - Fix a bug where thread may be in sleeping state but the wchan won't be set, leading to an empty container for sleepq_type(). [0] Sponsored by: Sandvine Incorporated [0] Submitted by: Bryan Venteicher <bryanv at daemoninthecloset dot org> MFC after: 3 days X-MFC: 209577
* In revoke(), verify that VCHR vnode indeed belongs to devfs.kib2010-07-061-1/+1
| | | | | Found and tested by: pho MFC after: 1 week
* Fix a race condition, where a TTY could be destroyed twice.ed2010-07-061-1/+2
| | | | | | | | | There are special cases where tty_rel_free() can be called twice in a row, namely when closing and revoking the TTY at the same moment. Only call destroy_dev_sched_cb() once. Reported by: Jeremie Le Hen MFC after: 1 week
* Add the ability for the allocflag argument of the vm_page_grab() tokib2010-07-051-50/+11
| | | | | | | | | specify the increment of vm_pageout_deficit when sleeping due to page shortage. Then, in allocbuf(), the code to allocate pages when extending vmio buffer can be replaced by a call to vm_page_grab(). Suggested and reviewed by: alc MFC after: 2 weeks
* Extend the kernel unit number allocator for allocating specific unitjh2010-07-051-13/+168
| | | | | | | | | | | numbers. This change adds a new function alloc_unr_specific() which returns the requested unit number if it is free. If the number is already allocated or out of the range, -1 is returned. Update alloc_unr(9) manual page accordingly and add a MLINK for alloc_unr_specific(9). Discussed on: freebsd-hackers
* Obey sv_syscallnames bounds in syscallname().kib2010-07-041-2/+4
| | | | Reported and tested by: pho
* Extend ptrace(PT_LWPINFO) to report siginfo for the signal that causedkib2010-07-042-12/+70
| | | | | | | debugee stop. The change should keep the ABI. Take care of compat32. Discussed with: davidxu, jhb MFC after: 2 weeks
* Use vm_page_next() instead of vm_page_lookup() in exec_map_first_page()alc2010-07-021-1/+1
| | | | because vm_page_next() is faster.
* Move prototypes for kern_sigtimedwait() and kern_sigprocmask() tojhb2010-06-302-0/+2
| | | | <sys/syscallsubr.h> where all other kern_<syscall> prototypes live.
* Update comment for tdsignal() -> tdsendsignal() rename. Forgot to includejhb2010-06-301-1/+1
| | | | this in 209592.
* Improve bufdone_finish()'s handling of the bogus page. Specifically, ifalc2010-06-301-4/+6
| | | | | | | | one or more mappings to the bogus page must be replaced, call pmap_qenter() just once. Previously, pmap_qenter() was called for each mapping to the bogus page. MFC after: 3 weeks
* Send SIGPIPE to the thread that issued the offending system calljhb2010-06-293-5/+5
| | | | | | | | rather than to the entire process. Reported by: Anit Chakraborty Reviewed by: kib, deischen (concept) MFC after: 1 week
* Tweak the in-kernel API for sending signals to threads:jhb2010-06-294-17/+36
| | | | | | | | | | - Rename tdsignal() to tdsendsignal() and make it private to kern_sig.c. - Add tdsignal() and tdksignal() routines that mirror psignal() and pksignal() except that they accept a thread as an argument instead of a process. They send a signal to a specific thread rather than to an individual process. Reviewed by: kib
* If i is going to be used in the loop unconditionally the declarationdougb2010-06-291-2/+0
| | | | | | has to be unconditional as well. Conical head covering to: kib
* Regeneratekib2010-06-282-525/+525
|
* Despite system call deregistration drains the threads executing System Vkib2010-06-281-1/+9
| | | | | | | | | | | | | | | | shm syscalls, and initial check for the number of allocated segments in the module deinitialization code, the following might happen: after the check for active segment, while waiting for threads to leave some other syscall, shmget(2) is called. Then, we can end up with the shared segment that cannot be detached since sysvshm module is unloaded. Prevent the leak by rechecking and disclaiming a reference to the vm object owned by sysvshm module, that might have grown during the drain. Tested by: pho Reviewed by: jhb MFC after: 1 month
* Count number of threads that enter and leave dynamically registeredkib2010-06-284-19/+81
| | | | | | | | | | syscalls. On the dynamic syscall deregistration, wait until all threads leave the syscall code. This somewhat increases the safety of the loadable modules unloading. Reviewed by: jhb Tested by: pho MFC after: 1 month
* Fix a lock leak in the deadlock resolver in case the ticks counterattilio2010-06-281-2/+6
| | | | | | | | | | wrapped up. Sponsored by: Sandvine Incorporated Submitted by: pluknet <pluknet at gmail dot com> Reported by: Anton Yuzhaninov <citrin at citrin dot ru> Reviewed by: jhb MFC after: 3 days
* Correct a comment typo.jh2010-06-271-1/+1
|
* Correct arguments order.pjd2010-06-261-2/+2
|
* * Do not dereference a NULL pointer when calling an SCTP send syscalltuexen2010-06-261-2/+3
| | | | | | | | not providing a destination address and using ktrace. * Do not copy out kernel memory when providing sinfo for sctp_recvmsg(). Both bug where reported by Valentin Nechayev. The first bug results in a kernel panic. MFC after: 3 days.
* Reverse the logic of the if statement that sets the default value ofnwhitehorn2010-06-241-3/+3
| | | | | | HZ; the list of 1000 Hz platforms was getting unwieldy. Suggested by: marcel
* Move default HZ from 100 to 1000 on powerpc.nwhitehorn2010-06-231-1/+1
| | | | | Reviewed by: marcel MFC after: 2 weeks
* Remove the support for int13 FPU exception reporting on i386. It iskib2010-06-231-21/+0
| | | | | | | | | believed that all 486-class CPUs FreeBSD is capable to run on, either have no FPU and cannot use external coprocessor, or have FPU on the package and can use #MF. Reviewed by: bde Tested by: pho (previous version)
* "time lock" is no longer a spin-lock since r209371.mav2010-06-211-1/+1
| | | | Reported by: kib@
* Use ISO C99 integer types in sys/kern where possible.ed2010-06-2124-93/+94
| | | | | | There are only about 100 occurences of the BSD-specific u_int*_t datatypes in sys/kern. The ISO C99 integer types are used here more often.
* Do not report a stack garbage as the old value for debug.ncores sysctl.kib2010-06-211-1/+2
| | | | Reported by: brucec
* Implement new event timers infrastructure. It provides unified APIs formav2010-06-202-6/+238
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | writing event timer drivers, for choosing best possible drivers by machine independent code and for operating them to supply kernel with hardclock(), statclock() and profclock() events in unified fashion on various hardware. Infrastructure provides support for both per-CPU (independent for every CPU core) and global timers in periodic and one-shot modes. MI management code at this moment uses only periodic mode, but one-shot mode use planned for later, as part of tickless kernel project. For this moment infrastructure used on i386 and amd64 architectures. Other archs are welcome to follow, while their current operation should not be affected. This patch updates existing drivers (i8254, RTC and LAPIC) for the new order, and adds event timers support into the HPET driver. These drivers have different capabilities: LAPIC - per-CPU timer, supports periodic and one-shot operation, may freeze in C3 state, calibrated on first use, so may be not exactly precise. HPET - depending on hardware can work as per-CPU or global, supports periodic and one-shot operation, usually provides several event timers. i8254 - global, limited to periodic mode, because same hardware used also as time counter. RTC - global, supports only periodic mode, set of frequencies in Hz limited by powers of 2. Depending on hardware capabilities, drivers preferred in following orders, either LAPIC, HPETs, i8254, RTC or HPETs, LAPIC, i8254, RTC. User may explicitly specify wanted timers via loader tunables or sysctls: kern.eventtimer.timer1 and kern.eventtimer.timer2. If requested driver is unavailable or unoperational, system will try to replace it. If no more timers available or "NONE" specified for second, system will operate using only one timer, multiplying it's frequency by few times and uing respective dividers to honor hz, stathz and profhz values, set during initial setup.
* Backout r207970 for now, it can lead to deadlocks.pjd2010-06-171-13/+0
| | | | | Reported by: kan MFC after: 3 days
* Make DTrace syscall provider work again by including opt_kdtrace.h here.rpaulo2010-06-171-0/+1
|
* - Fix compilation of the subr_unit.c user space test program.jh2010-06-171-3/+4
| | | | - Use %zu for size_t in a few format strings.
* lock_profile_release_lock: do not compare unsigned with zeroavg2010-06-171-3/+5
| | | | | | | Found by: Coverity Prevent CID: 3660 Reviewed by: jhb MFC after: 2 weeks
* Remove the unit argument from the recently added make_dev_p().ed2010-06-171-2/+2
| | | | | | | | New code that creates character devices shouldn't use device unit numbers, but only si_drv[12] to hold pointer to per-device data. Make this function more future proof by removing the unit number argument. Discussed with: kib
* Correct the function name in a KASSERT.jh2010-06-161-1/+1
|
OpenPOWER on IntegriCloud