aboutsummaryrefslogtreecommitdiff
path: root/sys/kern
Commit message (Collapse)AuthorAgeFilesLines
* If the 4BSD scheduler tries to schedule a thread that has been pinned orRyan Stone2011-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 Notes: svn path=/head/; revision=221081
* Implement the delayed task execution extension to the taskqueueKonstantin Belousov2011-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 Notes: svn path=/head/; revision=221059
* - Catch up to falloc() changes.Jeff Roberson2011-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(). Notes: svn path=/head/; revision=221055
* Fix a LOR in vfs_busy() where, after msleeping, it would lockRick Macklem2011-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 Notes: svn path=/head/; revision=220967
* Utilize vfs_sanitizeopts() in vfs_mergeopts() to merge options. BecauseJaakko Heinonen2011-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 Notes: svn path=/head/; revision=220937
* Allow VOP_ALLOCATE to be iterative, and have kern_posix_fallocate(9)Matthew D Fleming2011-04-193-48/+61
| | | | | | | | | drive looping and potentially yielding. Requested by: kib Notes: svn path=/head/; revision=220846
* Fix a copy/paste whitespace error.Matthew D Fleming2011-04-181-3/+3
| | | | Notes: svn path=/head/; revision=220793
* Regen.Matthew D Fleming2011-04-183-2/+31
| | | | Notes: svn path=/head/; revision=220792
* Add the posix_fallocate(2) syscall. The default implementation inMatthew D Fleming2011-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) Notes: svn path=/head/; revision=220791
* ktrace: Log the code for all signals (PSIG events).Jilles Tjoelker2011-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 Notes: svn path=/head/; revision=220740
* Remove malloc(9) return value checks when M_WAITOK is used.Dmitry Chagin2011-04-162-44/+0
| | | | | | | MFC after: 2 Week Notes: svn path=/head/; revision=220730
* Revert r194662, since it breaks ng_ksocket(4) and may breakGleb Smirnoff2011-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 Notes: svn path=/head/; revision=220622
* Remove stale M_ZOMBIE malloc type.Sergey Kandaurov2011-04-141-3/+0
| | | | | | | | | This type is unused since embedding p_ru into struct proc. MFC after: 1 week Notes: svn path=/head/; revision=220621
* Add a new DDB command, "show rmans", which will show the address and briefGavin Atkinson2011-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 Notes: svn path=/head/; revision=220606
* Staticize malloc types.Sergey Kandaurov2011-04-131-2/+1
| | | | | | | | Approved by: lstewart MFC after: 1 week Notes: svn path=/head/; revision=220592
* Use the full and proper company name for Swinburne University of TechnologyLawrence Stewart2011-04-122-6/+6
| | | | | | | | | | | throughout the source tree. Requested by: Grenville Armitage, Director of CAIA at Swinburne University of Technology MFC after: 3 days Notes: svn path=/head/; revision=220560
* Rename a misnamed structure field (hr_loginclass), and reorder priv(9)Edward Tomasz Napierala2011-04-101-19/+19
| | | | | | | constants to match the order and naming of syscalls. No functional changes. Notes: svn path=/head/; revision=220527
* Some callers of proc_reparent() already have the parent process locked.Konstantin Belousov2011-04-101-2/+6
| | | | | | | | | Detect the situation and avoid process lock recursion. Reported by: Fabian Keil <freebsd-listen fabiankeil de> Notes: svn path=/head/; revision=220526
* Reintroduce the fix already discussed in r216805 (please check its historyAttilio Rao2011-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 Notes: svn path=/head/; revision=220456
* Add RACCT_NOFILE accounting.Edward Tomasz Napierala2011-04-061-2/+38
| | | | | | | | Sponsored by: The FreeBSD Foundation Reviewed by: kib (earlier version) Notes: svn path=/head/; revision=220400
* Style fix.Edward Tomasz Napierala2011-04-063-6/+3
| | | | | | | Submitted by: jhb@ Notes: svn path=/head/; revision=220399
* Add accounting for SysV-related resources.Edward Tomasz Napierala2011-04-063-12/+84
| | | | | | | | Sponsored by: The FreeBSD Foundation Reviewed by: kib (earlier version) Notes: svn path=/head/; revision=220398
* Fix several places to ignore processes that are not yet fully constructed.John Baldwin2011-04-065-6/+20
| | | | | | | MFC after: 1 week Notes: svn path=/head/; revision=220390
* Add ucred pointer to the SysV-related memory structures. This is requiredEdward Tomasz Napierala2011-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) Notes: svn path=/head/; revision=220388
* Add accounting for most of the memory-related resources.Edward Tomasz Napierala2011-04-053-3/+18
| | | | | | | | Sponsored by: The FreeBSD Foundation Reviewed by: kib (earlier version) Notes: svn path=/head/; revision=220373
* Add missing stubs.Edward Tomasz Napierala2011-04-051-0/+12
| | | | Notes: svn path=/head/; revision=220372
* Remove malloc type M_NETADDR unused since splitting into vfs_subr.cSergey Kandaurov2011-04-041-2/+0
| | | | | | | | | and vfs_export.c. MFC after: 1 week Notes: svn path=/head/; revision=220328
* Add accounting for RACCT_NPTS.Edward Tomasz Napierala2011-04-021-6/+25
| | | | Notes: svn path=/head/; revision=220279
* After the r219999 is merged to stable/8, rename fallocf(9) to falloc(9)Konstantin Belousov2011-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 Notes: svn path=/head/; revision=220245
* Add support for executing the FreeBSD 1/i386 a.out binaries on amd64.Konstantin Belousov2011-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 Notes: svn path=/head/; revision=220238
* Enable accounting for RACCT_NPROC and RACCT_NTHR.Edward Tomasz Napierala2011-03-314-5/+55
| | | | | | | | Sponsored by: The FreeBSD Foundation Reviewed by: kib (earlier version) Notes: svn path=/head/; revision=220222
* Notify racct when process credentials change.Edward Tomasz Napierala2011-03-311-0/+10
| | | | | | | | Sponsored by: The FreeBSD Foundation Reviewed by: kib (earlier version) Notes: svn path=/head/; revision=220212
* Clearing the flag when preempting will let the preempted thread runFabien Thomas2011-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 Notes: svn path=/head/; revision=220198
* Regenerate.Edward Tomasz Napierala2011-03-303-2/+157
| | | | Notes: svn path=/head/; revision=220164
* Add rctl. It's used by racct to take user-configurable actions basedEdward Tomasz Napierala2011-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) Notes: svn path=/head/; revision=220163
* Provide compat32 shims for kldstat(2).Konstantin Belousov2011-03-301-23/+30
| | | | | | | | Requested and tested by: jpaetzel MFC after: 1 week Notes: svn path=/head/; revision=220158
* Remove pointless (always true) KASSERTs.Edward Tomasz Napierala2011-03-291-19/+0
| | | | | | | Submitted by: pjd Notes: svn path=/head/; revision=220146
* Add racct. It's an API to keep per-process, per-jail, per-loginclassEdward Tomasz Napierala2011-03-297-1/+920
| | | | | | | | | | | | and per-loginclass resource accounting information, to be used by the new resource limits code. It's connected to the build, but the code that actually calls the new functions will come later. Sponsored by: The FreeBSD Foundation Reviewed by: kib (earlier version) Notes: svn path=/head/; revision=220137
* Fix the check for vm_map_remove() error.Konstantin Belousov2011-03-281-1/+1
| | | | | | | | Pointed out by: alc MFC after: 2 weeks Notes: svn path=/head/; revision=220114
* Trim white spaces, adjust style.Konstantin Belousov2011-03-281-10/+12
| | | | | | | MFC after: 2 weeks Notes: svn path=/head/; revision=220102
* Handle zero length in copyout_unmap().Konstantin Belousov2011-03-281-0/+3
| | | | | | | | Submitted by: John Wehle <john feith com> MFC after: 2 weeks Notes: svn path=/head/; revision=220101
* Promote ksyms_map() and ksyms_unmap() to general facilityKonstantin Belousov2011-03-281-0/+49
| | | | | | | | | | copyout_map() and copyout_unmap() interfaces. Submitted by: John Wehle <john feith com>, nox MFC after: 2 weeks Notes: svn path=/head/; revision=220100
* Fix some style issues in r219925.Jaakko Heinonen2011-03-261-5/+2
| | | | | | | | Reported by: bde MFC after: 1 month Notes: svn path=/head/; revision=220040
* Add O_CLOEXEC flag to open(2) and fhopen(2).Konstantin Belousov2011-03-252-3/+12
| | | | | | | | | | | The new function fallocf(9), that is renamed falloc(9) with added flag argument, is provided to facilitate the merge to stable branch. Reviewed by: jhb MFC after: 1 week Notes: svn path=/head/; revision=219999
* Fix some locking nits with the p_state field of struct proc:John Baldwin2011-03-245-25/+18
| | | | | | | | | | | | | | | | | | | | | - Hold the proc lock while changing the state from PRS_NEW to PRS_NORMAL in fork to honor the locking requirements. While here, expand the scope of the PROC_LOCK() on the new process (p2) to avoid some LORs. Previously the code was locking the new child process (p2) after it had locked the parent process (p1). However, when locking two processes, the safe order is to lock the child first, then the parent. - Fix various places that were checking p_state against PRS_NEW without having the process locked to use PROC_LOCK(). Every place was already locking the process, just after the PRS_NEW check. - Remove or reduce the use of PROC_SLOCK() for places that were checking p_state against PRS_NEW. The PROC_LOCK() alone is sufficient for reading the current state. - Reorder fill_kinfo_proc() slightly so it only acquires PROC_SLOCK() once. MFC after: 1 week Notes: svn path=/head/; revision=219968
* Recognize "ro", "rdonly", "norw", "rw" and "noro" as equal options inJaakko Heinonen2011-03-231-0/+26
| | | | | | | | | | | | | vfs_equalopts(). This allows vfs_sanitizeopts() to filter redundant occurrences of these options. It was possible that for example both "ro" and "rw" options became active concurrently. PR: kern/133614 Discussed on: freebsd-hackers MFC after: 1 month Notes: svn path=/head/; revision=219925
* Modestly increase the maximum allowed size of the kmem map on i386.Alan Cox2011-03-232-16/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Also, express this new maximum as a fraction of the kernel's address space size rather than a constant so that increasing KVA_PAGES will automatically increase this maximum. As a side-effect of this change, kern.maxvnodes will automatically increase by a proportional amount. While I'm here ensure that this change doesn't result in an unintended increase in maxpipekva on i386. Calculate maxpipekva based upon the size of the kernel address space and the amount of physical memory instead of the size of the kmem map. The memory backing pipes is not allocated from the kmem map. It is allocated from its own submap of the kernel map. In short, it has no real connection to the kmem map. (In fact, the commit messages for the maxpipekva auto-sizing talk about using the kernel map size, cf. r117325 and r117391, even though the implementation actually used the kmem map size.) Although the calculation is now done differently, the resulting value for maxpipekva should remain almost the same on i386. However, on amd64, the value will be reduced by 2/3. This is intentional. The recent change to VM_KMEM_SIZE_SCALE on amd64 for the benefit of ZFS also had the unnecessary side-effect of increasing maxpipekva. This change is effectively restoring maxpipekva on amd64 to its prior value. Eliminate init_param3() since it is no longer used. Notes: svn path=/head/; revision=219920
* Small style fix.John Baldwin2011-03-231-1/+1
| | | | Notes: svn path=/head/; revision=219905
* Make UFS use PSARC/2010/029 NFSv4 ACL semantics by default, bringingEdward Tomasz Napierala2011-03-221-2/+2
| | | | | | | | | it in line with ZFSv28. X-MFC-After: ZFSv28. Notes: svn path=/head/; revision=219880
* Move the code around so that libc behaviour does not depend on a variableEdward Tomasz Napierala2011-03-221-8/+28
| | | | | | | that was supposed to be kernel-only. There should be no functional changes. Notes: svn path=/head/; revision=219878