summaryrefslogtreecommitdiffstats
path: root/sys/kern
Commit message (Collapse)AuthorAgeFilesLines
...
* Add MAKEDEV_NOWAIT flag to make_dev_credf(9), to create a device nodekib2010-05-061-19/+28
| | | | | | | | in a no-sleep context. If resource allocation cannot be done without sleep, make_dev_credf() fails and returns NULL. Reviewed by: jh MFC after: 2 weeks
* Eliminate page queues locking around most calls to vm_page_free().alc2010-05-061-3/+1
|
* Avoid overflow.trasz2010-05-061-1/+1
| | | | Submitted by: bde@
* Style fixes and removal of unneeded variable.trasz2010-05-061-3/+3
| | | | Submitted by: bde@
* Remove page queues locking from all sf_buf_mext()-like functions. The pagealc2010-05-062-11/+2
| | | | | | lock now suffices. Fix a couple nearby style violations.
* Eliminate a small bit of unneeded code from kern_sendfile(): Whilealc2010-05-061-7/+2
| | | | | | | | | | kern_sendfile() is running, the file's vm object can't be destroyed because kern_sendfile() increments the vm object's reference count. (Once kern_sendfile() decrements the reference count and returns, the vm object can, however, be destroyed. So, sf_buf_mext() must handle the case where the vm object is destroyed.) Reviewed by: kib
* Switch to our preferred 2-clause BSD license.joel2010-05-051-24/+21
| | | | Approved by: kmacy
* Acquire the page lock around all remaining calls to vm_page_free() onalc2010-05-052-0/+4
| | | | | | | | | | | | | managed pages that didn't already have that lock held. (Freeing an unmanaged page, such as the various pmaps use, doesn't require the page lock.) This allows a change in vm_page_remove()'s locking requirements. It now expects the page lock to be held instead of the page queues lock. Consequently, the page queues lock is no longer required at all by callers to vm_page_rename(). Discussed with: kib
* Move checking against RLIMIT_FSIZE into one place, vn_rlimit_fsize().trasz2010-05-051-0/+19
| | | | Reviewed by: kib
* Fix a mistake in r207603. td_rux.rux_runtime still needs conversion.kib2010-05-051-1/+1
| | | | | | Reported and tested by: nwhitehorn Pointy hat to: kib MFC after: 6 days
* Push down the acquisition of the page queues lock into vm_page_unwire().alc2010-05-051-4/+2
| | | | | | | Update the comment describing which lock should be held on entry to vm_page_wire(). Reviewed by: kib
* Add page locking to the vm_page_cow* functions.alc2010-05-042-5/+0
| | | | | | | Push down the acquisition and release of the page queues lock into vm_page_wire(). Reviewed by: kib
* Fix typo in comment.kib2010-05-041-1/+1
| | | | MFC after: 3 days
* Remove a comment that merely repeats code.kib2010-05-041-1/+0
| | | | | Submitted by: bde MFC after: 1 week
* Use td_rux.rux_runtime for ki_runtime instead of redoing calculation.kib2010-05-041-1/+1
| | | | | Submitted by: bde MFC after: 1 week
* Implement RUSAGE_THREAD. Add td_rux to keep extended runtime and tickskib2010-05-042-12/+23
| | | | | | | | | | | | | | | information for thread to allow calcru1() (re)use. Rename ruxagg()->ruxagg_locked(), ruxagg_tlock()->ruxagg() [1]. The ruxagg_locked() function no longer clears thread ticks nor td_incruntime. Requested by: attilio [1] Discussed with: attilio, bde Reviewed by: bde Based on submission by: Alexander Krizhanovsky <ak natsys-lab com> MFC after: 1 week X-MFC-Note: td_rux shall be moved to the end of struct thread
* Acquire the page lock around vm_page_unwire() and vm_page_wire().alc2010-05-031-4/+9
| | | | Reviewed by: kib
* This is the first step in transitioning responsibility for synchronizingalc2010-05-032-0/+8
| | | | | | access to the page's wire_count from the page queues lock to the page lock. Submitted by: kmacy
* Lock the page around hold_count access.kib2010-05-021-0/+2
| | | | Reviewed by: alc
* Properly synchronize access to the page's hold_count in vfs_vmio_release().alc2010-05-021-6/+6
| | | | Reviewed by: kib
* It makes no sense for vm_page_sleep_if_busy()'s helper, vm_page_sleep(),alc2010-05-021-1/+10
| | | | | | | | | | to unconditionally set PG_REFERENCED on a page before sleeping. In many cases, it's perfectly ok for the page to disappear, i.e., be reclaimed by the page daemon, before the caller to vm_page_sleep() is reawakened. Instead, we now explicitly set PG_REFERENCED in those cases where having the page persist until the caller is awakened is clearly desirable. Note, however, that setting PG_REFERENCED on the page is still only a hint, and not a guarantee that the page should persist.
* Remove a redundant variable assignment.zec2010-05-011-2/+1
| | | | | Reviewed by: bz, rwatson MFC after: 3 days
* Extract thread_lock()/ruxagg()/thread_unlock() fragment into utilitykib2010-05-011-13/+14
| | | | | | | | function ruxagg_tlock(). Convert the definition of kern_getrusage() to ANSI C. Submitted by: Alexander Krizhanovsky <ak natsys-lab com> MFC after: 1 week
* Handle taskqueue_drain(9) correctly on a threaded taskqueue:zml2010-04-301-5/+6
| | | | | | | | | | | | taskqueue_drain(9) will not correctly detect whether a task is currently running. The check is against a field in the taskqueue struct, but for a threaded queue with more than one thread, multiple threads can simultaneously be running a task, thus stomping over the tq_running field. Submitted by: Matthew Fleming <matthew.fleming@isilon.com> Reviewed by: jhb Approved by: dfr (mentor)
* Avoid allocating MAXHOSTNAMELEN bytes on the stack in expand_name(),alfred2010-04-301-3/+19
| | | | | | | | use the heap instead. Obtained from: Juniper Networks Reviewed by: jhb
* Don't leak core_buf or gzfile if doing a compressed core file and wealfred2010-04-301-4/+7
| | | | | | hit an error condition. Obtained from: Juniper Networks
* Do not set IO_NODELOCKED while writing to vnodes as our consumersalfred2010-04-301-4/+4
| | | | | | | | do not lock the vnodes. Obtained from: Juniper Networks Reviewed by: jhb
* On Alan's advice, rather than do a wholesale conversion on a singlekmacy2010-04-306-20/+34
| | | | | | | | | | | | architecture from page queue lock to a hashed array of page locks (based on a patch by Jeff Roberson), I've implemented page lock support in the MI code and have only moved vm_page's hold_count out from under page queue mutex to page lock. This changes pmap_extract_and_hold on all pmaps. Supported by: Bitgravity Inc. Discussed with: alc, jeffr, and kib
* Remove caddr_t casts.kib2010-04-291-5/+3
| | | | | Requested by: bde MFC after: 10 days
* kern_ntptime: drop a comment that became stale after r207359avg2010-04-291-4/+0
| | | | | MFC after: 1 week X-MFC after: r207359
* periodically save system time to hardware time-of-day clockavg2010-04-291-0/+65
| | | | | | | | | | | | | | | This is done in kern_ntptime, perhaps not the best place. This is done using resettodr(). Some features: - make save period configurable via tunable and sysctl - period of zero disables saving, setting a non-zero period re-enables it or reschedules it - do saving only if system clock is ntp-synchronized - save on shutdown Discussed with: des, Peter Jeremy <peterjeremy@acm.org> X-Maybe: save time near seconds boundary for better precision MFC after: 2 weeks
* kern_ntptime: abstract time error check into a functionavg2010-04-291-23/+27
| | | | | | ... to avoid code duplication MFC after: 1 week
* - Rework the underlying ALQ storage to be a circular buffer, which amongst otherlstewart2010-04-261-89/+466
| | | | | | | | | | | | | | | | | | | | | | | things allows variable length messages to be easily supported. - Extend KPI with alq_writen() and alq_getn() to support variable length messages, which is enabled at ALQ creation time depending on the arguments passed to alq_open(). Also add variants of alq_open() and alq_post() that accept a flags argument. The KPI is still fully backwards compatible and shouldn't require any change in ALQ consumers unless they wish to utilise the new features. - Introduce the ALQ_NOACTIVATE and ALQ_ORDERED flags to allow ALQ consumers to have more control over IO scheduling and resource acquisition respectively. - Strengthen invariants checking. - Document ALQ changes in ALQ(9) man page. Sponsored by: FreeBSD Foundation Reviewed by: gnn, jeff, rpaulo, rwatson MFC after: 1 month
* Move the constants specifying the size of struct kinfo_proc intokib2010-04-241-0/+3
| | | | | | | | | | machine-specific header files. Add KINFO_PROC32_SIZE for struct kinfo_proc32 for architectures providing COMPAT_FREEBSD32. Add CTASSERT for the size of struct kinfo_proc32. Submitted by: pluknet Reviewed by: imp, jhb, nwhitehorn MFC after: 2 weeks
* - Merge soft-updates journaling from projects/suj/head into head. Thisjeff2010-04-242-3/+26
| | | | | | | | brings in support for an optional intent log which eliminates the need for background fsck on unclean shutdown. Sponsored by: iXsystems, Yahoo!, and Juniper. With help from: McKusick and Peter Holm
* Remove one zero from the double-0.bz2010-04-231-2/+2
| | | | | | This code doesn't have a license to kill. MFC after: 3 days
* Fix typo.kib2010-04-211-1/+1
| | | | | | Submitted by: emaste Pointy hat to: kib (who needs much bigger wardrobe) MFC after: 1 week
* Provide compat32 shims for kinfo_proc sysctl. This allows 32bit ps(1) tokib2010-04-211-4/+130
| | | | | | | | | | mostly work on 64bit host. The work is based on an original patch submitted by emaste, obtained from Sandvine's source tree. Reviewed by: jhb MFC after: 1 week
* Make sure that we free the passed in data message if we don't actuallyimp2010-04-201-3/+12
| | | | | | | insert it onto the queue. Also, fix a mtx leak if someone turns off devctl while we're processing a messages. MFC after: 5 days
* Fix compilation in the !SMP case.attilio2010-04-201-0/+6
| | | | | | | | Keep the interrupts disabled in order to avoid preemption problems. Reported by: tinderbox, b.f. <bf1783 at googlemail dot com> MFC: 2 weeks X-MFC: r206878
* The cache_enter(9) function shall not be called for doomed dvp.kib2010-04-201-0/+2
| | | | | | | | | | | | | | | | Assert this. In the reported panic, vdestroy() fired the assertion "vp has namecache for ..", because pseudofs may end up doing cache_enter() with reclaimed dvp, after dotdot lookup temporary unlocked dvp. Similar problem exists in ufs_lookup() for "." lookup, when vnode lock needs to be upgraded. Verify that dvp is not reclaimed before calling cache_enter(). Reported and tested by: pho Reviewed by: kan MFC after: 2 weeks
* getblk lockmgr is mostly used as a msleep() and may lead too easilly toattilio2010-04-191-0/+1
| | | | | | | false positives. Whitelist it. Reported by: Erik Cederstrand <erik at cederstrand dot dk>
* Fix a deadlock in the shutdown code:attilio2010-04-191-7/+12
| | | | | | | | | | | | | | | | | | | | | | | | | When performing a smp_rendezvous() or more likely, on amd64 and i386, a smp_tlb_shootdown() the caller will end up with the smp_ipi_mtx spinlock held, busy-waiting for other CPUs to acknowledge the operation. As long as CPUs are suspended (via cpu_reset()) between the active mask read and IPI sending there can be a deadlock where the caller will wait forever for a dead CPU to acknowledge the operation. Please note that on CPU0 that is going to be someway heavier because of the spinlocks being disabled earlier than quitting the machine. Fix this bug by calling cpu_reset() with the smp_ipi_mtx held. Note that it is very likely that a saner offline/online CPUs mechanism will help heavilly in fixing similar cases as it is likely more bugs of this type may arise in the future. Reported by: rwatson Discussed with: jhb Tested by: rnoland, Giovanni Trematerra <giovanni dot trematerra at gmail dot com> MFC: 2 weeks Special deciation to: anyone who made possible to have 16-ways machines in Netperf
* Fix typo.kib2010-04-151-1/+1
| | | | MFC after: 3 days
* Change the semantics of the debug.ktr.alq_enable control so that when youjulian2010-04-141-24/+30
| | | | | | | | disable alq, it acts as if alq had not been enabled in the build. in other words, the rest of ktr is still available for use. If you really don't want that as well, set the mask to 0. MFC after:3 weeks
* Handle a case in kern_openat() when vn_open() change file type fromkib2010-04-131-15/+2
| | | | | | | | | | | | | | DTYPE_VNODE. Only acquire locks for O_EXLOCK/O_SHLOCK if file type is still vnode, since we allow for fcntl(2) to process with advisory locks for DTYPE_VNODE only. Another reason is that all fo_close() routines need to check and release locks otherwise. For O_TRUNC, call fo_truncate() instead of truncating the vnode. Discussed with: rwatson MFC after: 2 week
* Remove XXX comment. Add another comment, describing why f_vnode assignmentkib2010-04-131-1/+6
| | | | | | is useful. MFC after: 3 days
* Initialize the virtual memory-related resource limits in a single place.alc2010-04-111-5/+12
| | | | | | | | | | | | | Previously, one of these limits was initialized in two places to a different value in each place. Moreover, because an unsigned int was used to represent the amount of pageable physical memory, some of these limits were incorrectly initialized on 64-bit architectures. (Currently, this error is masked by login.conf's default settings.) Make vm_thread_swapin() and vm_thread_swapout() static. Submitted by: bde (an earlier version) Reviewed by: kib
* - Introduce a blessed list for sxlocks that prevents the deadlkres toattilio2010-04-111-1/+31
| | | | | | | | | | panic on those ones. [0] - Fix ticks counter wrap-up Sponsored by: Sandvine Incorporated [0] Reported by: jilles [0] Tested by: jilles MFC: 1 week
* Do not leak master pty or ptmx vnode.kib2010-04-081-0/+9
| | | | | | Report and test case by: Petr Salinger <Petr.Salinger seznam cz> Reviewed by: ed MFC after: 1 week
OpenPOWER on IntegriCloud