summaryrefslogtreecommitdiffstats
path: root/sys/kern
Commit message (Collapse)AuthorAgeFilesLines
* The recent NFS forced unmount improvements introduced a side-effectiedowse2002-04-172-4/+18
| | | | | | | | | | | | | | | | | where some client operations might be unexpectedly cancelled during an unsuccessful non-forced unmount attempt. This causes problems for amd(8), because it periodically attempts a non-forced unmount to check if the filesystem is still in use. Fix this by adding a new mountpoint flag MNTK_UNMOUNTF that is set only during the operation of a forced unmount. Use this instead of MNTK_UNMOUNT to trigger the cancellation of hung NFS operations. Also correct a problem where dounmount() might inadvertently clear the MNTK_UNMOUNT flag. Reported by: simokawa MFC after: 1 week
* Lock proctree_lock instead of pgrpsess_lock.jhb2002-04-167-25/+25
|
* - Lock proctree_lock instead of pgrpsess_lock.jhb2002-04-162-39/+42
| | | | | | - Use temporary variables to hold a pointer to a pgrp while we dink with it while not holding either the associated proc lock or proctree_lock. It is in theory possible that p->p_pgrp could change out from under us.
* - Lock proctree_lock instead of pgrpsess_lock.jhb2002-04-161-35/+20
| | | | - Simplify return logic of setsid() and setpgid().
* - Lock proctree_lock instead of pgrpsess_lock.jhb2002-04-161-7/+7
| | | | - Exclusively lock proctree_lock while calling leavepgrp().
* - Merge the pgrpsess_lock and proctree_lock sx locks into one proctree_lockjhb2002-04-162-15/+10
| | | | | | | | | | | | sx lock. Trying to get the lock order between these locks was getting too complicated as the locking in wait1() was being fixed. - leavepgrp() now requires an exclusive lock of proctree_lock to be held when it is called. - fixjobc() no longer gets a shared lock of proctree_lock now that it requires an xlock be held by the caller. - Locking notes in sys/proc.h are adjusted to note that everything that used to be protected by the pgrpsess_lock is now protected by the proctree_lock.
* Remove two debug printfs which should never have been committed.phk2002-04-151-4/+0
|
* You have to cast int64_t's to long long if you printf them with %lld.jhb2002-04-151-2/+2
| | | | | | This now compiles on alpha without a warning. Pointy-hat to: phk
* Improve the implementation of adjtime(2).phk2002-04-154-93/+78
| | | | | | | | | | | | | | | | | | | | | | | Apply the change as a continuous slew rather than as a series of discrete steps and make it possible to adjust arbitraryly huge amounts of time in either direction. In practice this is done by hooking into the same once-per-second loop as the NTP PLL and setting a suitable frequency offset deducting the amount slewed from the remainder. If the remaining delta is larger than 1 second we slew at 5000PPM (5msec/sec), for a delta less than a second we slew at 500PPM (500usec/sec) and for the last one second period we will slew at whatever rate (less than 500PPM) it takes to eliminate the delta entirely. The old implementation stepped the clock a number of microseconds every HZ to acheive the same effect, using the same rates of change. Eliminate the global variables tickadj, tickdelta and timedelta and their various use and initializations. This removes the most significant obstacle to running timecounter and NTP housekeeping from a timeout rather than hardclock.
* Take the "tickadj" element out of struct clockinfo. Our adjtime(2)phk2002-04-151-1/+0
| | | | | implementation is being changed and the very concept of tickadj will no longer be meaningful.
* In the ntp_adjtime(2) syscall, return our actual estimate of unappliedphk2002-04-151-2/+2
| | | | offset correction instead of the most recent offset applied.
* Finish adding support code for sysctl kern.mprof. This dumps some mallocjeff2002-04-151-11/+68
| | | | | | | | | | | | | | | | | information related to bucket size effeciency. Three things are printed on each row: Size is the size the user actually asked for rounded to 16 bytes. Requests is the number of times this size was asked for. Real Size is the size we actually handed out. At the end the total memory used and total waste is displayed. Currently my system displays about 33% wasted memory. The intent of this code is to gather statistics for tuning the malloc bucket sizes. It is not intended to be run with INVARIANTS and it is not entirely mp safe. It can be enabled via 'options MALLOC_PROFILE' which was commited earlier.
* Remove malloc_type's ks_limit.jeff2002-04-151-84/+135
| | | | | | | | | | | | Updated the kmemzones logic such that the ks_size bitmap can be used as an index into it to report the size of the zone used. Create the kern.malloc sysctl which replaces the kvm mechanism to report similar data. This will provide an easy place for statistics aggregation if malloc_type statistics become per cpu data. Add some code ifdef'd under MALLOC_PROFILING to facilitate a tool for sizing the malloc buckets.
* Don't allow one to trace an ancestor when already traced.alfred2002-04-141-1/+14
| | | | | | | PR: kern/29741 Submitted by: Dave Zarzycki <zarzycki@FreeBSD.org> Fix from: Tim J. Robbins <tim@robbins.dropbear.id.au> MFC After: 2 weeks
* Use VOP_GETVOBJECT instead of accessing the member directly. This fixedjeff2002-04-141-1/+1
| | | | | | an issue with nullfs and NAMEI shared. Submitted by: Alexander Kabaev
* Regenalc2002-04-142-3/+3
|
* Remove the requirement that Giant be held around sigreturn().alc2002-04-141-1/+1
|
* o Use aiocblist::fd_file in the AIO threads rather than recomputingalc2002-04-141-45/+3
| | | | | | the file * from the calling process's descriptor table. o Eliminate sharing of the calling process's descriptor table with the AIO threads.
* - Change killpg1()'s first argument to be a thread instead of a process sojhb2002-04-131-36/+22
| | | | | | | | | | | | | | | | we can use td_ucred. - In killpg1(), the proc lock is sufficient to check if p_stat is SZOMB or not. We don't need sched_lock. - Close some races in psignal(). In psignal() there is a big switch statement based on p_stat. All the different cases are assuming that the process (or thread) isn't going to change state out from under it. To ensure this is true, just lock sched_lock for the entire switch. We practically held it the entire time already anyways. This also simplifies the locking somewhat and actually results in fewer lock operations. - Allow signotify() to be called with the sched_lock held since psignal() now does that. - Use td_ucred in a couple of places.
* - Change donice() to take a thread as the first argument instead of ajhb2002-04-131-37/+40
| | | | | | | | | | | | | | | process so it can use td_ucred. - Require the target process of donice() to be locked when donice() is called. - Use td_ucred. - Lock the target process of p_cansee() and while reading the credentials of a process. - Change the logic of rtprio() slightly so it does it's copyin() if needed prior to locking the target process. - rtprio() no longer needs Giant. In theory with full KSE it would still need Giant to protect p_ucred of curproc for the p_canfoo() functions but p_canfoo() will be changing to using td_ucred of curthread before full KSE hits the tree.
* - Change the algorithms of the syscalls to modify process credentials tojhb2002-04-131-83/+137
| | | | | | | | | | | | allocate a blank cred first, lock the process, perform checks on the old process credential, copy the old process credential into the new blank credential, modify the new credential, update the process credential pointer, unlock the process, and cleanup rather than trying to allocate a new credential after performing the checks on the old credential. - Cleanup _setugid() a little bit. - setlogin() doesn't need Giant thanks to pgrp/session locking and td_ucred.
* - Change the first argument of ktrcanset(), ktrsetchildren(), and ktrops()jhb2002-04-131-32/+57
| | | | | to a thread pointer so that ktrcanset() can use td_ucred. - Add some proc locking to partially protect p_tracep and p_traceflag.
* Use pmap_extract() instead of pmap_kextract() to retrieve the physicaltmm2002-04-131-1/+2
| | | | | | | address associated with a user virtual address in pipe_build_write_buffer(). Reviewed by: alc
* Use the correct macros for F_SETFD/F_GETFD instead of magic numbers.asmodai2002-04-131-2/+3
| | | | | | | | | Reflect that fact in the manual page. PR: 12723 Submitted by: Peter Jeremy <peter.jeremy@alcatel.com.au> Approved by: bde MFC after: 2 weeks
* Back out the last revision - it does not work correctly when one oftmm2002-04-131-17/+6
| | | | | | | | the pages in question is not in the top-level vm object, but in one of the shadow ones. Pointed out by: alc Pointy hat to: tmm
* Rework ptrace(2) to be more locking friendly. We do any needed copyin()'sjhb2002-04-121-86/+114
| | | | | | and acquire the proctree_lock if needed first. Then we lock the process if necessary and fiddle with it as appropriate. Finally we drop locks and do any needed copyout's. This greatly simplifies the locking.
* Do not use pmap_kextract() to find out the physical address of a usertmm2002-04-121-6/+17
| | | | | | | | | | | belong to a user virtual address; while this happens to work on some architectures, it can't on sparc64, since user and kernel virtual address spaces overlap there (the distinction between them is done via separate address space identifiers). Instead, look up the page in the vm_map of the process in question. Reviewed by: jake
* Fix corner case where m_len was not being initialized.hsu2002-04-121-1/+3
| | | | | Submitted by: Maksim Yevmenkin <myevmenk@digisle.net> MFC after: 1 week
* - Set the base priority of an ithread that has no handlers when we set itsjhb2002-04-111-3/+5
| | | | | | normal priority. - Lock sched_lock while we dink with the priorities. - Remove a few extra blank lines.
* Regenalc2002-04-112-3/+3
|
* Remove the requirement that Giant be held around osigreturn(). All platform-alc2002-04-111-1/+1
| | | | specific implementations are MPSAFE.
* - Change settime() to take a thread as its first argument instead of a procjhb2002-04-101-36/+27
| | | | | | | | | so it can use td_ucred. - Push Giant down into the end of settime() where we actually set the time on the timecounter and time of day clock. - Remove Giant from clock_settime(). - Push Giant down in settimeofday() to just protect the 'tz' global variable.
* Display the recursion count in the lock_instance in the show locksjhb2002-04-101-1/+2
| | | | | | output. Indirectly requested by: peter
* Cosmetic fixup in output of lock types in show locks output.jhb2002-04-101-1/+1
|
* In linker_load_module(), check that rootdev != NODEV before callingbrian2002-04-101-3/+5
| | | | | | | | | | | linker_search_module(). Without this, modules loaded from loader.conf that then try to load in additional modules (such as digi.ko loading a card's BIOS) die badly in the vn_open() called from linker_search_module(). It may be worth checking (KASSERTing?) that rootdev != NODEV in vn_open() too.
* Change linker_reference_module() so that it's passed a structbrian2002-04-101-3/+14
| | | | | | | | | | mod_depend * (which may be NULL). The only consumer of this function at the moment is digi_loadmoduledata(), and that passes a NULL mod_depend *. In linker_reference_module(), check to see if we've already got the required module loaded. If we have, bump the reference count and return that, otherwise continue the module search as normal.
* - Change fill_kinfo_proc() to require that the process is locked when itjhb2002-04-093-14/+24
| | | | | | | | | | | | | | is called. - Change sysctl_out_proc() to require that the process is locked when it is called and to drop the lock before it returns. If this proves too complex we can change sysctl_out_proc() to simply acquire the lock at the very end and have the calling code drop the lock right after it returns. - Lock the process we are going to export before the p_cansee() in the loop in sysctl_kern_proc() and hold the lock until we call sysctl_out_proc(). - Don't call p_cansee() on the process about to be exported twice in the aforementioned loop.
* Whitespace changes to wrap long lines.jhb2002-04-091-4/+8
|
* We don't need Giant to read the pgrp ID since the proc lock has protectedjhb2002-04-091-5/+3
| | | | | | p_pgrp since the pgrp locking went in. We also don't need it to check for invalid values in the options argument to wait1(), so push Giant down slightly.
* - Remove an early KSE diagnostic panic. The thread pointer here is alwaysjhb2002-04-091-4/+2
| | | | | | curthread. - We don't need Giant to do suser() checks now, so don't lock Giant until after the check.
* Don't lock the ithread lock in ithread_create(). The ithread isn't on anyjhb2002-04-091-2/+0
| | | | | lists or in any tables yet so there are no other references to it, thus we don't need to lock it.
* Implement DIOCGFRONTSTUFF ioctl which reports how many bytes from the startphk2002-04-091-0/+4
| | | | | | of the device magic stuff might occupy. Sponsored by: DARPA & NAI Labs.
* Rename DIOCGKERNELDUMP to DIOCSKERNELDUMP as it strictly speakingphk2002-04-091-1/+1
| | | | | | is a "set" not a "get" operation. Sponsored by: DARPA & NAI Labs.
* Turn #ifdef LOOKUP_SHARED into #ifndef LOOKUP_EXCLUSIVE to enable thisjeff2002-04-094-11/+11
| | | | | | | | | behavior by default. Also, change the options line to reflect this. If there are no problems reported this will become the only behavior and the knob will be removed in a month or so. Demanded by: obrien
* The fourth parameter to copystr() is a size_t, not an int.mux2002-04-082-2/+4
| | | | Approved by: peter
* Move generic disk ioctls from <sys/disklabel.h> to <sys/disk.h>.phk2002-04-081-0/+1
| | | | Sponsored by: DARPA & NAI Labs
* Put back dumppcb, but this time we put a comment to tell what it is for.phk2002-04-081-4/+12
| | | | Brucifixion by: bde
* Restructure aio_return() to eliminate duplicated code and facilitate Giantalc2002-04-081-21/+15
| | | | push down.
* There's only one socket zone so we don't need to remember ithsu2002-04-081-2/+1
| | | | in every socket structure.
* o Change kernel_vmount() interface to be more convenient : pass twomux2002-04-072-60/+68
| | | | | | | | separate strings instead of passing "foo=bar". o Don't forget to clear the VMOUNT flag on the vnode when vfs_nmount() fails because the fs doesn't implement VFS_NMOUNT (and in vfs_mount() when the fs doesn't implement VFS_MOUNT) ; also decrement the vfs refcount in the !MNT_UPDATE case.
OpenPOWER on IntegriCloud