summaryrefslogtreecommitdiffstats
path: root/sys/kern
Commit message (Collapse)AuthorAgeFilesLines
* better integrate cyclic module with clocksource/eventtimer subsystemavg2011-05-161-12/+61
| | | | | | | | | | Now in the case when one-shot timers are used cyclic events should fire closer to theier scheduled times. As the cyclic is currently used only to drive DTrace profile provider, this is the area where the change makes a difference. Reviewed by: mav (earlier version, a while ago) X-MFC after: clocksource/eventtimer subsystem
* Correctly use INOUT for the offset/len parameters to vop_allocate. Asmdf2011-05-131-2/+2
| | | | far as I can tell this is for documentation only at the moment.
* Refactor Xen PV code to use new event timers subsystem. That uses one-shotmav2011-05-131-5/+0
| | | | | | | | | | | Xen timer and time counter to provide one-shot and periodic time events. On my tests this reduces idle interruts rate down to about 30Hz, and accor- ding to Xen VM Manager reduces host CPU load by three times comparing to the previous periodic 100Hz clock. Also now, when needed, it is possible to increase HZ rate without useless CPU burning during idle periods. Now only ia64 and some ARMs left not migrated to the new event timers.
* Use a name instead of a magic number for kern_yield(9) when the prioritymdf2011-05-136-7/+9
| | | | | | | | should not change. Fetch the td_user_pri under the thread lock. This is probably not necessary but a magic number also seems preferable to knowing the implementation details here. Requested by: Jason Behmer < jason DOT behmer AT isilon DOT com >
* - Do no try to drop a NULL filedesc pointer.stas2011-05-121-1/+2
|
* - Commit work from libprocstat project. These patches add support for runtimestas2011-05-122-170/+322
| | | | | | | | | | | | | | | | | | | | | | | file and processes information retrieval from the running kernel via sysctl in the form of new library, libprocstat. The library also supports KVM backend for analyzing memory crash dumps. Both procstat(1) and fstat(1) utilities have been modified to take advantage of the library (as the bonus point the fstat(1) utility no longer need superuser privileges to operate), and the procstat(1) utility is now able to display information from memory dumps as well. The newly introduced fuser(1) utility also uses this library and able to operate via sysctl and kvm backends. The library is by no means complete (e.g. KVM backend is missing vnode name resolution routines, and there're no manpages for the library itself) so I plan to improve it further. I'm commiting it so it will get wider exposure and review. We won't be able to MFC this work as it relies on changes in HEAD, which was introduced some time ago, that break kernel ABI. OTOH we may be able to merge the library with KVM backend if we really need it there. Discussed with: rwatson
* To avoid duplicated warning, move WITNESS_WARN() added in r221597 to thejh2011-05-071-1/+2
| | | | | | branch which doesn't call malloc(9). Suggested by: kib
* Add WITNESS_WARN() to getenv() to explicitly note that the function mayjh2011-05-071-0/+1
| | | | | sleep. This helps to expose bugs when the requested environment variable doesn't exist.
* Add make_dev_alias_p() function. It is similar to make_dev_alias(),ae2011-05-031-10/+51
| | | | | | | but it may return an error like make_dev_p() does. Reviewed by: kib (previous version) MFC after: 2 weeks
* Change the way rctl interfaces with jails by introducing prison_raccttrasz2011-05-033-72/+153
| | | | | | structure, which acts as a proxy between them. This makes jail rules persistent, i.e. they can be added before jail gets created, and they don't disappear when the jail gets destroyed.
* Add a new bus method, BUS_ADJUST_RESOURCE() that is intended to be ajhb2011-04-292-0/+56
| | | | | | | wrapper around rman_adjust_resource(). Include a generic implementation, bus_generic_adjust_resource() which passes the request up to the parent bus. There is currently no default implementation. A bus_adjust_resource() wrapper is provided for use in drivers.
* Extend the rman(9) API to support altering an existing resource.jhb2011-04-291-0/+158
| | | | | | | | | | | | | | | | | | Specifically, these changes allow a resource to back a relocatable and resizable resource such as the I/O window decoders in PCI-PCI bridges. - rman_adjust_resource() can adjust the start and end address of an existing resource. It only succeeds if the newly requested address space is already free. It also supports shrinking a resource in which case the freed space will be marked unallocated in the rman. - rman_first_free_region() and rman_last_free_region() return the start and end addresses for the first or last unallocated region in an rman, respectively. This can be used to determine by how much the resource backing an rman must be adjusted to accomodate an allocation request that does not fit into the existing rman. While here, document the rm_start and rm_end fields in struct rman, rman_is_region_manager(), the bound argument to rman_reserve_resource_bound(), and rman_init_from_resource().
* Change rman_manage_region() to actually honor the rm_start and rm_endjhb2011-04-291-0/+4
| | | | | | | | | | constraints on the rman and reject attempts to manage a region that is out of range. - Fix various places that set rm_end incorrectly (to ~0 or ~0u instead of ~0ul). - To preserve existing behavior, change rman_init() to set rm_start and rm_end to allow managing the full range (0 to ~0ul) if they are not set by the caller when rman_init() is called.
* Add the watchdogs patting during the (shutdown time) disk syncing andattilio2011-04-282-0/+18
| | | | | | | | | | | | | | | | disk dumping. With the option SW_WATCHDOG on, these operations are doomed to let watchdog fire, fi they take too long. I implemented the stubs this way because I really want wdog_kern_* KPI to not be dependant by SW_WATCHDOG being on (and really, the option only enables watchdog activation in hardclock) and also avoid to call them when not necessary (avoiding not-volountary watchdog activations). Sponsored by: Sandvine Incorporated Discussed with: emaste, des MFC after: 2 weeks
* If the 4BSD scheduler tries to schedule a thread that has been pinned orrstone2011-04-261-19/+21
| | | | | | | | | | bound to an AP before SMP has started, the system will panic when we try to touch per-CPU state for that AP because that state has not been initialized yet. Fix this in the same way as ULE: place all threads in the global run queue before SMP has started. Reviewed by: jhb MFC after: 1 month
* Implement the delayed task execution extension to the taskqueuekib2011-04-261-13/+115
| | | | | | | | | mechanism. The caller may specify a timeout in ticks after which the task will be scheduled. Sponsored by: The FreeBSD Foundation Reviewed by: jeff, jhb MFC after: 1 month
* - Catch up to falloc() changes.jeff2011-04-261-4/+11
| | | | | - PHOLD() before using a task structure on the stack. - Fix a LOR between the sleepq lock and thread lock in _intr_drain().
* Fix a LOR in vfs_busy() where, after msleeping, it would lockrmacklem2011-04-231-1/+2
| | | | | | | | | | | | the mutexes in the wrong order for the case where the MBF_MNTLSTLOCK is set. I believe this did have the potential for deadlock. For example, if multiple nfsd threads called vfs_busyfs(), which calls vfs_busy() with MBF_MNTLSTLOCK. Thanks go to pho for catching this during his testing. Tested by: pho Submitted by: kib MFC after: 2 weeks
* Utilize vfs_sanitizeopts() in vfs_mergeopts() to merge options. Becausejh2011-04-221-57/+14
| | | | | | | | | | | vfs_sanitizeopts() can handle "ro" and "rw" options properly, there is no more need to add "noro" in vfs_donmount() to cancel "ro". This also fixes a problem of canceling options beginning with "no". For example, "noatime" didn't cancel "nonoatime". Thus it was possible that both "noatime" and "nonoatime" were active at the same time. Reviewed by: bde
* Allow VOP_ALLOCATE to be iterative, and have kern_posix_fallocate(9)mdf2011-04-193-48/+61
| | | | | | drive looping and potentially yielding. Requested by: kib
* Fix a copy/paste whitespace error.mdf2011-04-181-3/+3
|
* Regen.mdf2011-04-183-2/+31
|
* Add the posix_fallocate(2) syscall. The default implementation inmdf2011-04-184-0/+224
| | | | | | | | | | | | | | vop_stdallocate() is filesystem agnostic and will run as slow as a read/write loop in userspace; however, it serves to correctly implement the functionality for filesystems that do not implement a VOP_ALLOCATE. Note that __FreeBSD_version was already bumped today to 900036 for any ports which would like to use this function. Also reserve space in the syscall table for posix_fadvise(2). Reviewed by: -arch (previous version)
* ktrace: Log the code for all signals (PSIG events).jilles2011-04-171-2/+2
| | | | | | | | | | | The code provides information on how the signal was generated. Formerly, the code was only logged for traps, much like only signal handlers for traps received a meaningful si_code before FreeBSD 7.0. In rare cases, no information is available and 0 is still logged. MFC after: 1 week
* Remove malloc(9) return value checks when M_WAITOK is used.dchagin2011-04-162-44/+0
| | | | MFC after: 2 Week
* Revert r194662, since it breaks ng_ksocket(4) and may breakglebius2011-04-141-3/+0
| | | | | | | | other socket consumers with alternate sb_upcall. PR: kern/154676 Submitted by: Arnaud Lacombe <lacombar gmail.com> MFC after: 7 days
* Remove stale M_ZOMBIE malloc type.pluknet2011-04-141-3/+0
| | | | | | This type is unused since embedding p_ru into struct proc. MFC after: 1 week
* Add a new DDB command, "show rmans", which will show the address and briefgavin2011-04-131-4/+25
| | | | | | | | | | details of each rman header, but not the contents of all rman structures in the system. This is especially useful on platforms where some rmans have many thousands of entries in rmans, making scrolling through the output of "show all rman" impractical. Individual rmans can then be viewed including their contents with "show rman 0xaddr" as usual. Reviewed by: jhb
* Staticize malloc types.pluknet2011-04-131-2/+1
| | | | | Approved by: lstewart MFC after: 1 week
* Use the full and proper company name for Swinburne University of Technologylstewart2011-04-122-6/+6
| | | | | | | | throughout the source tree. Requested by: Grenville Armitage, Director of CAIA at Swinburne University of Technology MFC after: 3 days
* Rename a misnamed structure field (hr_loginclass), and reorder priv(9)trasz2011-04-101-19/+19
| | | | constants to match the order and naming of syscalls. No functional changes.
* Some callers of proc_reparent() already have the parent process locked.kib2011-04-101-2/+6
| | | | | | Detect the situation and avoid process lock recursion. Reported by: Fabian Keil <freebsd-listen fabiankeil de>
* Reintroduce the fix already discussed in r216805 (please check its historyattilio2011-04-081-24/+198
| | | | | | | | | | | | | | | for a detailed explanation of the problems). The only difference with the previous fix is in Solution2: CPUBLOCK is no longer set when exiting from callout_reset_*() functions, which avoid the deadlock (leading to r217161). There is no need to CPUBLOCK there because the running-and-migrating assumption is strong enough to avoid problems there. Furthermore add a better !SMP compliancy (leading to shrinked code and structures) and facility macros/functions. Tested by: gianni, pho, dim MFC after: 3 weeks
* Add RACCT_NOFILE accounting.trasz2011-04-061-2/+38
| | | | | Sponsored by: The FreeBSD Foundation Reviewed by: kib (earlier version)
* Style fix.trasz2011-04-063-6/+3
| | | | Submitted by: jhb@
* Add accounting for SysV-related resources.trasz2011-04-063-12/+84
| | | | | Sponsored by: The FreeBSD Foundation Reviewed by: kib (earlier version)
* Fix several places to ignore processes that are not yet fully constructed.jhb2011-04-065-6/+20
| | | | MFC after: 1 week
* Add ucred pointer to the SysV-related memory structures. This is requiredtrasz2011-04-063-0/+13
| | | | | | | | | | for racct. Note that after this commit, ipcs(1) needs to be rebuilt. Otherwise, it will fail with "ipcs: sysctlbyname: kern.ipc.msqids: Cannot allocate memory". Sponsored by: The FreeBSD Foundation Reviewed by: kib (earlier version)
* Add accounting for most of the memory-related resources.trasz2011-04-053-3/+18
| | | | | Sponsored by: The FreeBSD Foundation Reviewed by: kib (earlier version)
* Add missing stubs.trasz2011-04-051-0/+12
|
* Remove malloc type M_NETADDR unused since splitting into vfs_subr.cpluknet2011-04-041-2/+0
| | | | | | and vfs_export.c. MFC after: 1 week
* Add accounting for RACCT_NPTS.trasz2011-04-021-6/+25
|
* After the r219999 is merged to stable/8, rename fallocf(9) to falloc(9)kib2011-04-019-22/+15
| | | | | | | | and remove the falloc() version that lacks flag argument. This is done to reduce the KPI bloat. Requested by: jhb X-MFC-note: do not
* Add support for executing the FreeBSD 1/i386 a.out binaries on amd64.kib2011-04-012-23/+85
| | | | | | | | | | | | | | | In particular: - implement compat shims for old stat(2) variants and ogetdirentries(2); - implement delivery of signals with ancient stack frame layout and corresponding sigreturn(2); - implement old getpagesize(2); - provide a user-mode trampoline and LDT call gate for lcall $7,$0; - port a.out image activator and connect it to the build as a module on amd64. The changes are hidden under COMPAT_43. MFC after: 1 month
* Enable accounting for RACCT_NPROC and RACCT_NTHR.trasz2011-03-314-5/+55
| | | | | Sponsored by: The FreeBSD Foundation Reviewed by: kib (earlier version)
* Notify racct when process credentials change.trasz2011-03-311-0/+10
| | | | | Sponsored by: The FreeBSD Foundation Reviewed by: kib (earlier version)
* Clearing the flag when preempting will let the preempted thread runfabient2011-03-312-7/+4
| | | | | | | | | | | | | | | | | too much time. This can finish in a scheduler deadlock with ping-pong between two threads. One sample of this is: - device lapic (to have a preemption point on critical_exit()) - options DEVICE_POLLING with HZ>1499 (to have lapic freq = hardclock freq) - running a cpu intensive task (that does not enter the kernel) - only one CPU on SMP or no SMP. As requested by jhb@ 4BSD have received the same type of fix instead of propagating the flag to the new thread. Reviewed by: jhb, jeff MFC after: 1 month
* Regenerate.trasz2011-03-303-2/+157
|
* Add rctl. It's used by racct to take user-configurable actions basedtrasz2011-03-303-0/+1869
| | | | | | | | on the set of rules it maintains and the current resource usage. It also privides userland API to manage that ruleset. Sponsored by: The FreeBSD Foundation Reviewed by: kib (earlier version)
* Provide compat32 shims for kldstat(2).kib2011-03-301-23/+30
| | | | | Requested and tested by: jpaetzel MFC after: 1 week
OpenPOWER on IntegriCloud