aboutsummaryrefslogtreecommitdiff
path: root/sys/kern
Commit message (Collapse)AuthorAgeFilesLines
* Move prototypes for kern_sigtimedwait() and kern_sigprocmask() toJohn Baldwin2010-06-302-0/+2
| | | | | | | <sys/syscallsubr.h> where all other kern_<syscall> prototypes live. Notes: svn path=/head/; revision=209613
* Update comment for tdsignal() -> tdsendsignal() rename. Forgot to includeJohn Baldwin2010-06-301-1/+1
| | | | | | | this in 209592. Notes: svn path=/head/; revision=209612
* Improve bufdone_finish()'s handling of the bogus page. Specifically, ifAlan Cox2010-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 Notes: svn path=/head/; revision=209605
* Send SIGPIPE to the thread that issued the offending system callJohn Baldwin2010-06-293-5/+5
| | | | | | | | | | | rather than to the entire process. Reported by: Anit Chakraborty Reviewed by: kib, deischen (concept) MFC after: 1 week Notes: svn path=/head/; revision=209595
* Tweak the in-kernel API for sending signals to threads:John Baldwin2010-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 Notes: svn path=/head/; revision=209592
* If i is going to be used in the loop unconditionally the declarationDoug Barton2010-06-291-2/+0
| | | | | | | | | has to be unconditional as well. Conical head covering to: kib Notes: svn path=/head/; revision=209582
* RegenerateKonstantin Belousov2010-06-282-525/+525
| | | | Notes: svn path=/head/; revision=209581
* Despite system call deregistration drains the threads executing System VKonstantin Belousov2010-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 Notes: svn path=/head/; revision=209580
* Count number of threads that enter and leave dynamically registeredKonstantin Belousov2010-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 Notes: svn path=/head/; revision=209579
* Fix a lock leak in the deadlock resolver in case the ticks counterAttilio Rao2010-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 Notes: svn path=/head/; revision=209577
* Correct a comment typo.Jaakko Heinonen2010-06-271-1/+1
| | | | Notes: svn path=/head/; revision=209549
* Correct arguments order.Pawel Jakub Dawidek2010-06-261-2/+2
| | | | Notes: svn path=/head/; revision=209543
* * Do not dereference a NULL pointer when calling an SCTP send syscallMichael Tuexen2010-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. Notes: svn path=/head/; revision=209540
* Reverse the logic of the if statement that sets the default value ofNathan Whitehorn2010-06-241-3/+3
| | | | | | | | | HZ; the list of 1000 Hz platforms was getting unwieldy. Suggested by: marcel Notes: svn path=/head/; revision=209492
* Move default HZ from 100 to 1000 on powerpc.Nathan Whitehorn2010-06-231-1/+1
| | | | | | | | Reviewed by: marcel MFC after: 2 weeks Notes: svn path=/head/; revision=209490
* Remove the support for int13 FPU exception reporting on i386. It isKonstantin Belousov2010-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) Notes: svn path=/head/; revision=209461
* "time lock" is no longer a spin-lock since r209371.Alexander Motin2010-06-211-1/+1
| | | | | | | Reported by: kib@ Notes: svn path=/head/; revision=209403
* Use ISO C99 integer types in sys/kern where possible.Ed Schouten2010-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. Notes: svn path=/head/; revision=209390
* Do not report a stack garbage as the old value for debug.ncores sysctl.Konstantin Belousov2010-06-211-1/+2
| | | | | | | Reported by: brucec Notes: svn path=/head/; revision=209389
* Implement new event timers infrastructure. It provides unified APIs forAlexander Motin2010-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. Notes: svn path=/head/; revision=209371
* Backout r207970 for now, it can lead to deadlocks.Pawel Jakub Dawidek2010-06-171-13/+0
| | | | | | | | Reported by: kan MFC after: 3 days Notes: svn path=/head/; revision=209260
* Make DTrace syscall provider work again by including opt_kdtrace.h here.Rui Paulo2010-06-171-0/+1
| | | | Notes: svn path=/head/; revision=209258
* - Fix compilation of the subr_unit.c user space test program.Jaakko Heinonen2010-06-171-3/+4
| | | | | | | - Use %zu for size_t in a few format strings. Notes: svn path=/head/; revision=209256
* lock_profile_release_lock: do not compare unsigned with zeroAndriy Gapon2010-06-171-3/+5
| | | | | | | | | | Found by: Coverity Prevent CID: 3660 Reviewed by: jhb MFC after: 2 weeks Notes: svn path=/head/; revision=209247
* Remove the unit argument from the recently added make_dev_p().Ed Schouten2010-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 Notes: svn path=/head/; revision=209244
* Correct the function name in a KASSERT.Jaakko Heinonen2010-06-161-1/+1
| | | | Notes: svn path=/head/; revision=209237
* Implement flexible BPF timestamping framework.Jung-uk Kim2010-06-151-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - Allow setting format, resolution and accuracy of BPF time stamps per listener. Previously, we were only able to use microtime(9). Now we can set various resolutions and accuracies with ioctl(2) BIOCSTSTAMP command. Similarly, we can get the current resolution and accuracy with BIOCGTSTAMP command. Document all supported options in bpf(4) and their uses. - Introduce new time stamp 'struct bpf_ts' and header 'struct bpf_xhdr'. The new time stamp has both 64-bit second and fractional parts. bpf_xhdr has this time stamp instead of 'struct timeval' for bh_tstamp. The new structures let us use bh_tstamp of same size on both 32-bit and 64-bit platforms without adding additional shims for 32-bit binaries. On 64-bit platforms, size of BPF header does not change compared to bpf_hdr as its members are already all 64-bit long. On 32-bit platforms, the size may increase by 8 bytes. For backward compatibility, struct bpf_hdr with struct timeval is still the default header unless new time stamp format is explicitly requested. However, the behaviour may change in the future and all relevant code is wrapped around "#ifdef BURN_BRIDGES" for now. - Add experimental support for tagging mbufs with time stamps from a lower layer, e.g., device driver. Currently, mbuf_tags(9) is used to tag mbufs. The time stamps must be uptime in 'struct bintime' format as binuptime(9) and getbinuptime(9) do. Reviewed by: net@ Notes: svn path=/head/; revision=209216
* Virtualize pci_remap_msi_irq() call from general MSI code. It allows MSIAlexander Motin2010-06-141-0/+22
| | | | | | | (FSB interrupts) to be used by non-PCI devices, such as HPET. Notes: svn path=/head/; revision=209154
* Add another variation of make_dev(9), make_dev_p(9), that is allowedKonstantin Belousov2010-06-121-24/+53
| | | | | | | | | | | to fail and can return useful error code. Requested by: jh Reviewed by: imp, jh MFC after: 3 weeks Notes: svn path=/head/; revision=209106
* When make_dev_credf(MAKEDEV_WAITOK) is called, useKonstantin Belousov2010-06-121-4/+4
| | | | | | | | | | | devctl_notify_f(M_WAITOK) for devfs notifications. Suggested by: jh Reviewed by: imp, jh MFC after: 3 weeks Notes: svn path=/head/; revision=209105
* Add modifications of devctl_notify(9) functions that take flags. UseKonstantin Belousov2010-06-121-6/+21
| | | | | | | | | | | | | | flags to specify M_WAITOK/M_NOWAIT. M_WAITOK allows devctl to sleep for the memory allocation. As Warner noted, allowing the functions to sleep might cause reordering of the queued notifications. Reviewed by: imp, jh MFC after: 3 weeks Notes: svn path=/head/; revision=209104
* fix a few cases where a string is passed via format argument instead ofAndriy Gapon2010-06-112-2/+2
| | | | | | | | | | | | | via %s Most of the cases looked harmless, but this is done for the sake of correctness. In one case it even allowed to drop an intermediate buffer. Found by: clang MFC after: 2 week Notes: svn path=/head/; revision=209062
* Update several places that iterate over CPUs to use CPU_FOREACH().John Baldwin2010-06-118-27/+12
| | | | Notes: svn path=/head/; revision=209059
* Add INVARIANTS checking that numfreebufs values are sane. Also add aMatthew D Fleming2010-06-111-10/+54
| | | | | | | | | | | | per-buf flag to catch if a buf is double-counted in the free count. This code was useful to debug an instance where a local patch at Isilon was incorrectly managing numfreebufs for a new buf state. Reviewed by: jeff Approved by: zml (mentor) Notes: svn path=/head/; revision=209053
* In another move to join with the age of the Fruitbat, increase SYSVIvan Voras2010-06-112-5/+5
| | | | | | | | | | | | | | shared resources defaults beyond absolute minimums. The new values are chosen mostly by magic. They are still fairly small and will need increasing for large installations (especially SHMMAX). However, they are now enough to e.g. start PostgreSQL installations with ~~300 users and nearly 512 MB of shared buffers. Reviewed by: A short discussion on hackers@ Notes: svn path=/head/; revision=209037
* Store interrupt trap frame into struct thread. It allows interrupt handlerAlexander Motin2010-06-101-0/+8
| | | | | | | | | | to obtain both trap frame and opaque argument submitted on registrction. After kernel and all drivers get used to it, legacy hack can be removed. Reviewed by: jhb@ Notes: svn path=/head/; revision=208988
* Unconfuse THREAD and SMT flagsIvan Voras2010-06-101-1/+3
| | | | Notes: svn path=/head/; revision=208983
* Cosmetic change to XML - less ugly newlinesIvan Voras2010-06-101-2/+2
| | | | Notes: svn path=/head/; revision=208982
* Reorganize the code in bdwrite() which handles move of dirtinessKonstantin Belousov2010-06-081-70/+65
| | | | | | | | | | | | | | | | | | | | | | | from the buffer pages to buffer. Combine the code to set buffer dirty range (previously in vfs_setdirty()) and to clean the pages (vfs_clean_pages()) into new function vfs_clean_pages_dirty_buf(). Now the vm object lock is acquired only once. Drain the VPO_BUSY bit of the buffer pages before setting valid and clean bits in vfs_clean_pages_dirty_buf() with new helper vfs_drain_busy_pages(). pmap_clear_modify() asserts that page is not busy. In vfs_busy_pages(), move the wait for draining of VPO_BUSY before the dirtyness handling, to follow the structure of vfs_clean_pages_dirty_buf(). Reported and tested by: pho Suggested and reviewed by: alc MFC after: 2 weeks Notes: svn path=/head/; revision=208920
* Fix a sign bug that caused adaptive spinning in sx_xlock() to not workJohn Baldwin2010-06-081-1/+1
| | | | | | | | | | | properly. Among other things it did not drop Giant while spinning leading to livelocks. Reviewed by: rookie, kib, jmallett MFC after: 3 days Notes: svn path=/head/; revision=208912
* Call BUS_PROBE_NOMATCH() when device detached due to driver unload.Alexander Motin2010-06-071-0/+4
| | | | | | | This allows bus to power-down device when driver unloaded on-flight. Notes: svn path=/head/; revision=208898
* Declare ip6 as (struct in6_addr *) instead of (struct in_addr *). This isColin Percival2010-06-041-1/+1
| | | | | | | | | | | | a harmless bug since we never actually use ip6 as anything other than an opaque pointer. Found with: Coverty Prevent(tm) CID: 4319 MFC after: 1 month Notes: svn path=/head/; revision=208803
* Assert that the thread lock is held in sched_pctcpu() instead ofJohn Baldwin2010-06-032-2/+2
| | | | | | | | | | recursively acquiring it. All of the current callers already hold the lock. MFC after: 1 month Notes: svn path=/head/; revision=208787
* The 'acl_cnt' field is unsigned; no point in checking if it's >= 0.Edward Tomasz Napierala2010-06-031-1/+1
| | | | | | | | Found with: Coverity Prevent CID: 3688 Notes: svn path=/head/; revision=208781
* The 'acl_cnt' field is unsigned; no point in checking if it's >= 0.Edward Tomasz Napierala2010-06-031-1/+1
| | | | | | | | Found with: Coverity Prevent CID: 3684 Notes: svn path=/head/; revision=208780
* The acl_cnt field is unsigned; no point in checking if it's >= 0.Edward Tomasz Napierala2010-06-031-1/+0
| | | | | | | | Found with: Coverity Prevent CID: 3683 Notes: svn path=/head/; revision=208779
* Sometimes vnodes share the lock despite being different vnodes onKonstantin Belousov2010-06-031-2/+3
| | | | | | | | | | | | | | | | different mount points, e.g. the nullfs vnode and the covered vnode from the lower filesystem. In this case, existing assertion in vop_rename_pre() may be triggered. Check for vnode locks equiality instead of the vnodes itself to not trip over the situation. Submitted by: Mikolaj Golub <to.my.trociny@gmail.com> Tested by: pho MFC after: 2 weeks Notes: svn path=/head/; revision=208773
* Minimize the use of the page queues lock for synchronizing access to theAlan Cox2010-06-022-4/+0
| | | | | | | | page's dirty field. With the exception of one case, access to this field is now synchronized by the object lock. Notes: svn path=/head/; revision=208745
* Add a facility to dynamically adjust or unconfigure p1003_1b mib.Konstantin Belousov2010-06-022-5/+37
| | | | | | | | | | | | Use it to allow to tune sem_nsem_max at runtime, only when sem.ko module is present in kernel. Requested and tested by: amdmi3 Reviewed by: jhb MFC after: 3 days Notes: svn path=/head/; revision=208731
* Revert taskqueue(9) related commits until mdf@ is approved and canZachary Loafman2010-06-011-14/+6
| | | | | | | | | resolve issues. This reverts commits r207439, r208623, r208624 Notes: svn path=/head/; revision=208715