summaryrefslogtreecommitdiffstats
path: root/sys/kern
Commit message (Collapse)AuthorAgeFilesLines
* Introduce EVFILT_TIMER, which allows a process to establish anjlemon2001-07-191-2/+66
| | | | | | | arbitrary number of timers, both oneshot and periodic. Repeatedly reminded to commit by: jayanth Reviewed by: peter (a while back)
* Don't use kp->arg0 as a format string, grr.kris2001-07-191-1/+1
| | | | MFC after: 1 week
* Keep track of all "struct snoop"'s so that snp_modevent can fail withdd2001-07-181-1/+9
| | | | EBUSY if there's a device still open.
* Increase NMBCLUSTERS by 4x.obrien2001-07-171-1/+1
| | | | This takes a GENERIC kernel (MAXUSERS=32) from 1536 to 3072.
* Move the hints gunk to a seperate file. It isn't really part of thepeter2001-07-141-299/+0
| | | | newbus structure (no more than subr_rman.c is anyway).
* Go back to having either static OR dynamic hints, with fallbackpeter2001-07-142-32/+82
| | | | | | | | support. Trying to fix the merged set where dynamic overrode static was getting more and more complicated by the day. This should fix the duplicate atkbd, psm, fd* etc in GENERIC. (which paniced the alpha, but not the i386)
* Correct spelling in a comment and remove trailing newline from add2001-07-111-2/+2
| | | | panic() call (panic() adds it itself).
* Constify the fstype argument to vfs_mount(). This eliminates at least onedes2001-07-092-2/+2
| | | | "call discards qualifier" warning (in sys/compat/linux/linux_file.c).
* Don't share sig handlers after an execguido2001-07-091-1/+23
| | | | Reviewed by: Alfred Perlstein
* Get rid of useless bcopy (the next statement was equivalent)guido2001-07-091-2/+0
|
* Backout mwakeup, etc.jake2001-07-062-52/+4
|
* o Replace calls to p_can(..., P_CAN_xxx) with calls to p_canxxx().rwatson2001-07-057-88/+39
| | | | | | | | | | | | | | | | | | | | | The p_can(...) construct was a premature (and, it turns out, awkward) abstraction. The individual calls to p_canxxx() better reflect differences between the inter-process authorization checks, such as differing checks based on the type of signal. This has a side effect of improving code readability. o Replace direct credential authorization checks in ktrace() with invocation of p_candebug(), while maintaining the special case check of KTR_ROOT. This allows ktrace() to "play more nicely" with new mandatory access control schemes, as well as making its authorization checks consistent with other "debugging class" checks. o Eliminate "privused" construct for p_can*() calls which allowed the caller to determine if privilege was required for successful evaluation of the access control check. This primitive is currently unused, and as such, serves only to complicate the API. Approved by: ({procfs,linprocfs} changes) des Obtained from: TrustedBSD Project
* Spelling fix in a KASSERT: runq_chose -> runq_choose.jhb2001-07-041-1/+1
|
* cleanup: GIANT macros, rename DEPRECIATE to DEPRECATEdillon2001-07-041-3/+0
| | | | | Move p_giant_optional to proc zero'd section Remove (old) XXX zfree comment in pipe code
* With Alfred's permission, remove vm_mtx in favor of a fine-grained approachdillon2001-07-0419-204/+103
| | | | | | | | | (this commit is just the first stage). Also add various GIANT_ macros to formalize the removal of Giant, making it easy to test in a more piecemeal fashion. These macros will allow us to test fine-grained locks to a degree before removing Giant, and also after, and to remove Giant in a piecemeal fashion via sysctl's on those subsystems which the authors believe can operate without Giant.
* postsig() currently requires Giant to be held. Giant is held properly atdillon2001-07-041-0/+2
| | | | | the first postsig() call, but not always held at the second place, resulting in an occassional panic.
* Implement mwakeup, mwakeup_one, cv_signal_drop and cv_broadcast_drop.jake2001-07-042-4/+52
| | | | | | | | | These take an additional mutex argument, which is dropped before any processes are made runnable. This can avoid contention on the mutex if the processes would immediately acquire it, and is done in such a way that wakeups will not be lost. Reviewed by: jhb
* Constify the format string.des2001-07-031-1/+1
| | | | Submitted by: Mike Barcroft <mike@q9media.com>
* Make the code to read the kernel message buffer via sysctl machine-tmm2001-07-031-0/+45
| | | | | independent and rename the corresponding sysctls from machdep.msgbuf and machdep.msgbuf_clear (i386 only) to kern.msgbuf and kern.msgbuf_clear.
* Remove spl's in uio_yield() that are covered by the sched_lock.jhb2001-07-031-3/+0
|
* Remove commented-out garbage that skipped updating schedcpu() stats forjhb2001-07-031-2/+0
| | | | ithreads in SWAIT.
* Just check p_oncpu when determining if a process is executing or not.jhb2001-07-031-4/+1
| | | | | | | We already did this in the SMP case, and it is now maintained in the UP case as well, and makes the code slightly more readable. Note that curproc is always executing, thus the p != curproc test does not need to be performed if the p_oncpu check is made.
* Axe spl's that are covered by the sched_lock (and have been for quitejhb2001-07-031-30/+4
| | | | some time.)
* Include the wait message and channel for msleep() in the KTR tracepoint.jhb2001-07-031-1/+2
|
* Remove bogus need_resched() of the current CPU in roundrobin().jhb2001-07-031-3/+6
| | | | | | | We don't actually need to force a context switch of the current process. The act of firing the event triggers a context switch to softclock() and then switching back out again which is equivalent to a preemption, thus no further work is needed on the local CPU.
* Grab Giant around postsig() since sendsig() can call into the vm tojhb2001-07-032-6/+2
| | | | grow the stack and we already needed Giant for KTRACE.
* o Unfold p31b_proc() into the individual posix4 system calls so as torwatson2001-06-301-66/+60
| | | | | | | | | allow call-specific authorization. o Modify the authorization model so that p_can() is used to check scheduling get/set events, using P_CAN_SEE for gets, and P_CAN_SCHED for sets. This brings the checks in line with get/setpriority(). Obtained from: TrustedBSD Project
* Remove the p_spinlocks spin lock count that was obsoleted by thejhb2001-06-301-1/+0
| | | | per-CPU spinlocks list.
* Replace some use of 'p' with 'targetp' so as to not scarily overload therwatson2001-06-301-11/+17
| | | | | | passed 'p' argument. No functional change. Obtained from: USENIX Emporium, Cheap Tricks Department
* Make the schedlock saved critical section state a per-thread property.jhb2001-06-302-4/+3
|
* Move ast() and userret() to sys/kern/subr_trap.c now that they are MI.jhb2001-06-291-1162/+17
|
* Add a new MI pointer to the process' trapframe p_frame instead of usingjhb2001-06-291-3/+3
| | | | | | various differently named pointers buried under p_md. Reviewed by: jake (in principle)
* Grab Giant around trap_pfault() for now.jhb2001-06-291-0/+4
|
* Fix up indentation.jlemon2001-06-292-4/+4
|
* Remove a fascinating but confusing construct involving chainingrwatson2001-06-281-33/+31
| | | | | | | | conditional clauses in the following way: (0 || a || b); No functional change.
* Add error checking for copyin() operations in posix4 scheduling code.rwatson2001-06-281-2/+6
|
* Don't check witness assertions if the lock doesn't use witness or witnessjhb2001-06-281-0/+3
| | | | is dead.
* - Fix a mntvnode and vnode interlock reversal.jhb2001-06-281-6/+13
| | | | - Protect the mnt_vnode list with the mntvnode lock.
* - Add trylock variants of shared and exclusive locks.jhb2001-06-271-4/+42
| | | | | | | | | | | - The sx assertions don't actually need the internal sx mutex lock, so don't bother doing so. - Add a new assertion SX_ASSERT_LOCKED() that asserts that either a shared or exclusive lock should be held. This assertion should be used instead of SX_ASSERT_SLOCKED() in almost all cases. - Adjust some KASSERT()'s to include file and line information. - Use the new witness_assert() function in the WITNESS case for sx slock asserts to verify that the current thread actually owns a slock.
* - Add a new witness_assert() to perform arbitrary locking assertions.jhb2001-06-271-13/+77
| | | | | | | | - Clean up the KTR tracepoints to be slighlty more consistent and useful - Fix a bug in WITNESS where we would recurse indefinitely and blow the stack when acquiring Giant after sleeping with a sleepable lock held. Reported by: tanimura (3)
* - Always use the proc lock of the task leader to protect the peers list ofjhb2001-06-271-15/+12
| | | | | | | | | | | | | | processes. - Don't construct fake call args and then call kill(). psignal is not anymore complicated and is quicker and not prone to locking problems. Calling psignal() avoids having to do a pfind() since we already have a proc pointer and also allows us to keep the task leader locked while we kill all the peer processes so the list is kept coherent. - When a kthread exits, do a wakeup() on its proc pointers. This can be used by kernel modules that have kthreads and want to ensure they have safely exited before completely the MOD_UNLOAD event. Connectivity provided by: Usenix wireless
* - Move the 'clk' spinlock below other spin locks since KTR trace eventsjhb2001-06-251-6/+39
| | | | | | | | | | | | | | | may need the clock lock for nanotime(). - Add KTR trace events for lock list manipulations and other witness operations. - Use a temporary variable instead of setting the lock list head directly and then setting up the links to add a new lock list entry to the lock list. This small race could result in witness "forgetting" about all the locks held by this process temporarily during an interrupt. - Close a more fatal race condition when removing a lock from a list. Removing a lock from the list entails both decrementing the count of items in this bucket as well as shuffling items in the current bucket up a notch to replace the gap left by the removed item. Wrap these operations in a critical section.
* - Replace the unused KTR_IDLELOOP trace class with a new KTR_WITNESS tracejhb2001-06-251-14/+17
| | | | | | | | | | | | | | class to trace witness events. - Make the ktr_cpu field of ktr_entry be a standard field rather than one present only in the KTR_EXTEND case. - Move the default definition of KTR_ENTRIES from sys/ktr.h to kern/kern_ktr.c. It has not been needed in the header file since KTR was un-inlined. - Minor include cleanup in kern/kern_ktr.c. - Fiddle with the ktr_cpumask in ktr_tracepoint() to disable KTR events on the current CPU while we are processing an event. - Set the current CPU inside of the critical section to ensure we don't migrate CPU's after the critical section but before we set the CPU.
* - Sort includes.jhb2001-06-251-9/+9
| | | | | | | - Count the context switches during shutdown when we give ithreads a chance to run as volutary context switches. Submitted by: bde (2)
* Count the context switch when blocking on a mutex as a voluntary contextjhb2001-06-252-0/+6
| | | | | | | | switch. Count the context switch when preempting the current thread to let a higher priority thread blocked on a mutex we just released run as an involuntary context switch. Reported by: bde
* Count the switch when an ithread goes idle as a voluntary context switch.jhb2001-06-251-0/+1
| | | | Submitted by: bde
* Don't dereference a NULL pointer if we fail to get a sendfilebuf.dwmalone2001-06-241-1/+2
|
* After exhaustive discussions and some meandering and confusion, enoughdillon2001-06-241-0/+6
| | | | | | | | | | | | | | | people are on track with the cause and effect of this, and although fixing this severely degenerate case appears to violate the letter of POSIX.1-200x, Bruce and I (and enough others) agree that it should be comitted. So, this patch generates an ENOENT error for any attempt to do a path lookup through an empty symlink (e.g. open(), stat()). Submitted by: "Andrey A. Chernov" <ache@nagual.pp.ru> Reviewed by: bde Discussed exhaustively on: freebsd-current Previously committed to: NetBSD 4 years ago
* - Lock CURSIG() with the proc lock to close the signal race with psignal.jhb2001-06-221-99/+67
| | | | | | | | | | | | | | | | - Grab Giant around ktrace points. - Clean up KTR_PROC tracepoints to not display the value of sched_lock.mtx_lock as it isn't really needed anymore and just obfuscates the messages. - Add a few if conditions to replace gotos. - Ensure that every msleep KTR event ends up with a matching msleep resume KTR event (this was broken when we didn't do a mi_switch()). - Only note via ktrace that we resumed from a switch once rather than twice in several places in msleep(). - Remove spl's rom asleep and await as the proc lock and sched_lock provide all the needed locking. - In mawait() add in a needed ktrace point for noting that we are about to switch out.
* - Lock CURSIG with the proc lock and don't release the proc lock untiljhb2001-06-221-4/+10
| | | | | after grabbing the sched lock to close a race. - Lock ktrace points with Giant.
OpenPOWER on IntegriCloud