summaryrefslogtreecommitdiffstats
path: root/sys/kern
Commit message (Collapse)AuthorAgeFilesLines
...
* Remove a comment which relates to the old name cache code, whichdwmalone2002-04-071-4/+0
| | | | | | was replaced in 1997. Approved by: phk
* Reduce the duplication of code for error handling in _aio_aqueue().alc2002-04-071-19/+7
|
* Change jobref and *ijoblist from int to long in order to avoidalc2002-04-071-3/+3
| | | | a catastrophe after the 2^32nd AIO operation on 64-bit architectures.
* Remove a stale comment.jake2002-04-061-4/+0
|
* Include machine/ktr.h for sparc64 so we pick up KTR_CPU.jake2002-04-061-0/+3
|
* Use CTASSERT rather than a runtime check to detect kinfo_proc size changes.jake2002-04-061-16/+2
| | | | Remove the ugly yuck code to busy wait for 20 seconds.
* Added the new kernel dumping support for pc98.nyan2002-04-061-1/+1
|
* Updated a doubly stale comment about signotify(). Fixed a nearby long line.bde2002-04-051-4/+5
|
* Increase the size of the register stack storage on ia64 from 32K to 2MB sopeter2002-04-051-1/+7
| | | | | | | | | that we can compile gcc. This is a hack because it adds a fixed 2MB to each process's VSIZE regardless of how much is really being used since there is no grow-up stack support. At least it isn't physical memory. Sigh. Add a sysctl to enable tweaking it for new processes.
* Add a generic implementation of inittodr() and resettodr(), as well astmm2002-04-043-0/+676
| | | | | | | | | | a set of helper routines to deal with real-time clocks. The generic functions access the clock diver using a kobj interface. This is intended to reduce code reduplication and make it easy to support more than one clock model on a single architecture. This code is currently only used on sparc64, but it is planned to convert the code of the other architectures to it later.
* Change callers of mtx_init() to pass in an appropriate lock type name. Injhb2002-04-0423-38/+38
| | | | | | | most cases NULL is passed, but in some cases such as network driver locks (which use the MTX_NETWORK_LOCK macro) and UMA zone locks, a name is used. Tested on: i386, alpha, sparc64
* Change mtx_init() to now take an extra argument. The third argument isjhb2002-04-042-16/+22
| | | | | | the generic lock type for use with witness. If this argument is NULL then the lock name is used as the lock type. Add a macro for a lock type name for network driver locks.
* Set the lock type equal to the lock name for now as all of the currentjhb2002-04-041-1/+1
| | | | sx locks don't use very specific lock names.
* Add a new char * pointer lo_type to struct lock_object that is used tojhb2002-04-041-19/+28
| | | | | | | | | | point to a more generic name for a lock that is more suitable for use by witness when grouping locks. For example, although network driver locks use the interface name for the name of each lock, they should all use the same witness and be treated the same as witness. Another example is that all UMA zone locks should be treated the same. The witness code has also been updated to print out the lock type in addition to the lock name in a few places where it is relevant.
* Delete the bogus d_boot[01] fields from struct disklabel.phk2002-04-041-0/+14
| | | | | | | | | | | | | This shrinks the size 4 bytes on alpha, down to the same 276 bytes as all other platforms. Construct a hack to make old ioctls work on new kernels. Once world is recompiled only the new and correct sysctls will be used. This hack will become annoying around 1st of may to make people rebuild their worlds and it will be gone before 5.0.
* Moved signal handling and rescheduling from userret() to ast() so thatbde2002-04-042-25/+71
| | | | | | | | | | | they aren't in the usual path of execution for syscalls and traps. The main complication for this is that we have to set flags to control ast() everywhere that changes the signal mask. Avoid locking in userret() in most of the remaining cases. Submitted by: luoqi (first part only, long ago, reorganized by me) Reminded by: dillon
* Optimized the check for unmasked pending signals in CURSIG() using a newbde2002-04-041-8/+2
| | | | | | | | | | | inline function sigsetmasked() and a new macro SIGPENDING(). CURSIG() will soon be moved out of the normal path of execution for syscalls and traps. Then its efficiency will be less important but the new interfaces will be useful for checking for unmasked pending signals in more places. Submitted by: luoqi (long ago, in a slightly different form) Assert that sched_lock is not held in CURSIG().
* o aio_process needn't fhold()/fdrop() the fp now that _aio_aqueue() andalc2002-04-041-13/+6
| | | | | | aio_free_entry() do this. o Remove two unnecessary/unused variables from aio_process() and one field from aiocblist.
* Avoid a lock order reversal by dropping the eventhandler_mutex earlier.alfred2002-04-041-2/+1
| | | | | | | | We get enough protection from the lock on the individual lists that we aquire later. Noticed/Tested by: Steven G. Kargl <kargl@troutmask.apl.washington.edu> Submitted by: Jonathan Mini <mini@haikugeek.com>
* - Axe a stale comment. We haven't allowed the ucred pointer passed tojhb2002-04-031-9/+2
| | | | | | | | securelevel_*() to be NULL for a while now. - Use KASSERT() instead of if (foo) panic(); to optimize the !INVARIANTS case. Submitted by: Martin Faxer <gmh003532@brfmasthugget.se>
* Add two forgotten vfs_unbusy() calls, in vfs_mount() and vfs_nmount().mux2002-04-032-0/+4
| | | | Reviewed by: phk
* Dike out a highly insecure UCONSOLE option.ru2002-04-031-4/+14
| | | | | | TIOCCONS must be able to VOP_ACCESS() /dev/console to succeed. Obtained from: OpenBSD
* brelse() was improperly clearing B_DELWRI in the B_DELWRI|B_INVAL casedillon2002-04-031-5/+2
| | | | | | | | | | | without removing the buffer from the vnode's dirty buffer list, which can result in a panic in NFS. Replaced the code with a call to bundirty() which deals with it properly. PR: kern/36108, kern/36174 Submitted by: various people Special mention: to Danny Schales <dan@coes.LaTech.edu> for providing a core dump that helped me track this down. MFC after: 1 day
* Revert to open hashing. It makes the code simpler, and works farily welldes2002-04-022-32/+20
| | | | | | | even when the number of records approaches the size of the hash table. Besides, the previous implementation (using linear probing) was broken :) Also, use the newly introduced MTX_SYSINIT.
* - Move the MI mutexes sched_lock and Giant from being declared in thejhb2002-04-022-0/+54
| | | | | | | | | | various machdep.c's to being declared in kern_mutex.c. - Add a new function mutex_init() used to perform early initialization needed for mutexes such as setting up thread0's contested lock list and initializing MI mutexes. Change the various MD startup routines to call this function instead of duplicating all the code themselves. Tested on: alpha, i386
* Spelling police.jhb2002-04-022-2/+2
|
* Enforce an implicit lock order of sleepable locks before non-sleepablejhb2002-04-021-1/+12
| | | | locks.
* - Add a mutex to lock the global securelevel value.arr2002-04-021-1/+9
| | | | - Make use of MTX_SYSINIT() as the means to initialize our mutex lock.
* Fix leakage of p_pgrp lock.tanimura2002-04-022-1/+5
|
* Explicitly document how we implicitly enforce the lock order of sleepjhb2002-04-021-0/+5
| | | | locks before spin locks.
* - Add MTX_SYSINIT and SX_SYSINIT as macro glue for allowing sx and mtxarr2002-04-023-0/+30
| | | | | | | | | | locks to be able to setup a SYSINIT call. This helps in places where a lock is needed to protect some data, but the data is not truly associated with a subsystem that can properly initialize it's lock. The macros use the mtx_sysinit() and sx_sysinit() functions, respectively, as the handler argument to SYSINIT(). Reviewed by: alfred, jhb, smp@
* Instead of get_cyclecount(9), use nanotime(9) to record acquisition anddes2002-04-022-38/+56
| | | | | | | release times. Measurements are made and stored in nanoseconds but presented in microseconds, which should be sufficient for the locks for which we actually want this (those that are held long and / or often). Also, rename some variables and structure members to unit-agnostic names.
* Retire the bogus ioctl DIOCGPART in toto.phk2002-04-021-8/+0
| | | | | | | Once again we can notice that badly thought out hacks ferment and infect far more code than initially expected. Sponsored by: DARPA and NAI Labs.
* Don't compile the dummy dumpsys for ia64.marcel2002-04-021-1/+1
|
* Update comment regarding the locking of the sysctl tree.rwatson2002-04-021-10/+10
| | | | | | | | Rename memlock to sysctllock, and MEMLOCK()/MEMUNLOCK() to SYSCTL_LOCK()/ SYSCTL_UNLOCK() and related changes to make the lock names make more sense. Submitted by: Jonathan Mini <mini@haikugeek.com>
* Use sx locks instead of flags+tsleep locks.alfred2002-04-021-31/+11
| | | | Submitted by: Jonathan Mini <mini@haikugeek.com>
* Use sx locks rather than lockmgr locks for eventhandlers.alfred2002-04-021-5/+6
| | | | Submitted by: Jonathan Mini <mini@haikugeek.com>
* Mutex profiling code, conditional on the MUTEX_PROFILING option. Adds thedes2002-04-022-4/+318
| | | | | | | | | | | | | | | | | | | | | | | following sysctl variables: debug.mutex.prof.enable enable / disable profiling debug.mutex.prof.acquisitions number of mutex acquisitions recorded debug.mutex.prof.records number of acquisition points recorded debug.mutex.prof.maxrecords max number of acquisition points debug.mutex.prof.rejected number of rejections (due to full table) debug.mutex.prof.hashsize hash size debug.mutex.prof.collisions number of hash collisions debug.mutex.prof.stats profiling statistics The code records four numbers for each acquisition point (identified by source file name and line number): longest time held, total time held, number of non-recursive acquisitions, average time held. The measurements are in clock cycles (as returned by get_cyclecount(9)); this may cause measurements on some SMP systems to be unreliable. This can probably be worked around by replacing get_cyclecount(9) by some incarnation of nanotime(9). This work was derived from initial patches by eivind.
* Stage-2 commit of the critical*() code. This re-inlines cpu_critical_enter()dillon2002-04-013-0/+3
| | | | | | | | | | | | | | | | | | | | | and cpu_critical_exit() and moves associated critical prototypes into their own header file, <arch>/<arch>/critical.h, which is only included by the three MI source files that need it. Backout and re-apply improperly comitted syntactical cleanups made to files that were still under active development. Backout improperly comitted program structure changes that moved localized declarations to the top of two procedures. Partially re-apply one of the program structure changes to move 'mask' into an intermediate block rather then in three separate sub-blocks to make the code more readable. Re-integrate bug fixes that Jake made to the sparc64 code. Note: In general, developers should not gratuitously move declarations out of sub-blocks. They are where they are for reasons of structure, grouping, readability, compiler-localizability, and to avoid developer-introduced bugs similar to several found in recent years in the VFS and VM code. Reviewed by: jake
* Change the suser() API to take advantage of td_ucred as well as do ajhb2002-04-0125-138/+119
| | | | | | | | | | | | general cleanup of the API. The entire API now consists of two functions similar to the pre-KSE API. The suser() function takes a thread pointer as its only argument. The td_ucred member of this thread must be valid so the only valid thread pointers are curthread and a few kernel threads such as thread0. The suser_cred() function takes a pointer to a struct ucred as its first argument and an integer flag as its second argument. The flag is currently only used for the PRISON_ROOT flag. Discussed on: smp@
* Whitespace only change: use ANSI function declarations instead of K&R.jhb2002-04-011-130/+46
|
* Extend a hack to also hack around PC98's definition of __i386__phk2002-04-011-1/+1
|
* Fix style bug in previous commit.jhb2002-04-011-1/+1
|
* ktr changes to improve performance and make writing a userland utility tojake2002-04-011-70/+47
| | | | | | | | | | | | | | | | | | | | | | | | | | dump the trace buffer feasible. - Remove KTR_EXTEND. This changes the format of the trace entries when activated, making writing a userland tool which is not tied to a specific kernel configuration difficult. - Use get_cyclecount() for timestamps. nanotime() is much too heavy weight and requires recursion protection due to ktr traces occuring as a result of ktr traces. KTR_VERBOSE may still require recursion protection, which is now conditional on it. - Allow KTR_CPU to be overridden by MD code. This is so that it is possible to trace early in startup before pcpu and/or curthread are setup. - Add a version number for the ktr interface. A userland tool can check this to detect mismatches. - Use an array for the parameters to make decoding in userland easier. - Add file and line recording to the non-extended traces now that the extended version is no more. These changes will break gdb macros to decode the extended version of the trace buffer which are floating around. Users of these macros should either use the show ktr command in ddb, or use the userland utility which can be run on a core dump. Approved by: jhb Tested on: i386, sparc64
* Here follows the new kernel dumping infrastructure.phk2002-03-313-194/+50
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Caveats: The new savecore program is not complete in the sense that it emulates enough of the old savecores features to do the job, but implements none of the options yet. I would appreciate if a userland hacker could help me out getting savecore to do what we want it to do from a users point of view, compression, email-notification, space reservation etc etc. (send me email if you are interested). Currently, savecore will scan all devices marked as "swap" or "dump" in /etc/fstab _or_ any devices specified on the command-line. All architectures but i386 lack an implementation of dumpsys(), but looking at the i386 version it should be trivial for anybody familiar with the platform(s) to provide this function. Documentation is quite sparse at this time, more to come. Details: ATA and SCSI drivers should work as the dump formatting code has been removed. The IDA, TWE and AAC have not yet been converted. Dumpon now opens the device and uses ioctl(DIOCGKERNELDUMP) to set the device as dumpdev. To implement the "off" argument, /dev/null is used as the device. Savecore will fail if handed any options since they are not (yet) implemented. All devices marked "dump" or "swap" in /etc/fstab will be scanned and dumps found will be saved to diskfiles named from the MD5 hash of the header record. The header record is dumped in readable format in the .info file. The kernel is not saved. Only complete dumps will be saved. All maintainer rights for this code are disclaimed: feel free to improve and extend. Sponsored by: DARPA, NAI Labs
* Implement the two "GEOM" ioctls DIOCGSECTORSIZE and DIOCGMEDIASIZE forphk2002-03-311-0/+13
| | | | | | | the non-GEOM code as well. This simplifies the the kernel-dumping and disk-management tools as less compatibility cruft will be needed. Sponsored by: DARPA and NAI Labs.
* Keep the reference to the file acquired in _aio_aqueue() until the operationalc2002-03-311-3/+7
| | | | | | completes. The reference is released in aio_free_entry(). Submitted by: tegge
* Close some holes with p->p_args by NULL'ing out the p->p_args pointeralfred2002-03-312-4/+14
| | | | | | | while holding the proc lock, and by holding the pargs structure when accessing it from outside of the owner. Submitted by: Jonathan Mini <mini@haikugeek.com>
* Centralize the "bootdev" and "dumpdev" variables. They are still prettyphk2002-03-313-0/+3
| | | | | bogus all things considered, but at least now they don't camouflage as being MD variables.
* Add a local proc *p in exec_new_vmspace() to avoid repeated dereferencingalc2002-03-311-6/+7
| | | | to obtain it.
OpenPOWER on IntegriCloud