summaryrefslogtreecommitdiffstats
path: root/sys/kern
Commit message (Collapse)AuthorAgeFilesLines
* Redo the sigio locking.alfred2002-05-018-62/+30
| | | | | | | | | | | Turn the sigio sx into a mutex. Sigio lock is really only needed to protect interrupts from dereferencing the sigio pointer in an object when the sigio itself is being destroyed. In order to do this in the most unintrusive manner change pgsigio's sigio * argument into a **, that way we can lock internally to the function.
* Cosmetic tweaks. Try and keep the style more consistent, catch some straypeter2002-05-012-45/+43
| | | | whitespace and update a comment.
* kern_tc.c doesn't use <machine/psl.h>, and having this #include breakspeter2002-05-011-2/+0
| | | | other platforms.
* Remove this Perl script. There have been zero bug reports againstobrien2002-05-011-355/+0
| | | | vnode_if.awk.
* Convert longs to u_longs in stats. This will hold off wrap arounds for ajeff2002-04-301-1/+1
| | | | while longer.
* o Convert the vm_page buckets mutex to a spin lock. (This resolvesalc2002-04-301-0/+1
| | | | | | | an issue on the Alpha platform found by jeff@.) o Simplify vm_page_lookup(). Reviewed by: jhb
* Brucifixion ? Yes, out that door, row on the left, one patch each.phk2002-04-301-87/+101
| | | | Many thanks to: bde
* These are Alexander Kabaev's VFSops fixes (see the thread 'Found: moduledillon2002-04-301-21/+82
| | | | | | | | | | | | | | | | | loading breakage'). The patch fixes serious issues with the VFS operations vector array which results in a crash when a filesystem module adding a new VOP is loaded into the kernel. Basically what was happening before was that the old operations vector was being freed and a new one allocated. The original MALLOC code tended to reuse the same address for the case and so the bug did not rear its ugly head until the new memory subsystem was emplaced. This patch replaces the temporary workaround Dave O'Brien comitted in 1.58. The patch is clean enough that I intend to MFC it to stable at some point. Submitted by: Alexander Kabaev <ak03@gte.com> MFC after: 1 week
* Add a new UMA debugging facility. This will overwrite freed memory withjeff2002-04-301-2/+8
| | | | | | | | | | | 0xdeadc0de and then check for it just before memory is handed off as part of a new request. This will catch any post free/pre alloc modification of memory, as well as introduce errors for anything that tries to dereference it as a pointer. This code takes the form of special init, fini, ctor and dtor routines that are specificly used by malloc. It is in a seperate file because additional debugging aids will want to live here as well.
* Move the implementation of M_ZERO into UMA so that it can be passed tojeff2002-04-301-3/+0
| | | | | | uma_zalloc and friends. Remove this functionality from the malloc wrapper. Document this change in uma.h and adjust variable names in uma_core.
* Revert the change of #includes in sys/filedesc.h and sys/socketvar.h.tanimura2002-04-303-21/+24
| | | | | | | | | | Requested by: bde Since locking sigio_lock is usually followed by calling pgsigio(), move the declaration of sigio_lock and the definitions of SIGIO_*() to sys/signalvar.h. While I am here, sort include files alphabetically, where possible.
* Re-add the 16384 bucket also.rwatson2002-04-291-0/+1
| | | | Submitted by: green
* Revert a portion of kern_malloc.c:1.99, which (in addition to addingrwatson2002-04-291-1/+3
| | | | | | | | | | | | | malloc profiling) also modified the set of pre-defined buckets for the memory allocator. For reasons unknown to me, this resulted in extensive memory corruption in the kernel, in particular on SMP boxes, so I'm committing this work-around until Jeff gets a chance to debug it properly. David Wolfskill pointed me at this commit as the one that might be a problem; I've been running this code on two dual-processor burn-in boxes for about 12 hours now, and the rate of panics due to memory corruption has dropped to zero (from one every five minutes). Hopefully not treading on the toes of: jeff
* Add a sysctl which disables the logging of console output.dwmalone2002-04-291-0/+7
| | | | | Approved by: phk MFC after: 2 weeks
* Fix indention which I did wrong in a previous commit.asmodai2002-04-291-1/+1
| | | | Submitted by: bde
* Stylistic sweep through the timecounter code.phk2002-04-281-142/+222
| | | | Renovate comments.
* Don't screw up our uptime with historical dates.phk2002-04-281-1/+1
|
* Avoid the user-visible effect of setting SA_NOCLDWAIT when theiedowse2002-04-272-6/+9
| | | | | | | SIGCHLD handler is SIG_IGN. This is a reimplementation of the problematic revision 1.131 of kern_exit.c. To avoid accessing process UPAGES, we set a new procsig flag when the SIGCHLD handler is SIG_IGN and use that instead.
* Finish fixing hints. Remember the use_kenv state for the next run.peter2002-04-271-8/+10
| | | | | | | | | Otherwise we fall back to using the static hints the next time around. We still have the leftover fallback code there which meant that we skipped the use_hints checking on the second and subsequent calls. Also, be a bit more careful about walking off the end of the envp array. I've extracted this from a larger diff. I hope I didn't miss anything...
* Partial fix for hintspeter2002-04-271-2/+4
| | | | Obtained from: mux
* Remove a stale comment saying that the vnode lock must be the firstiedowse2002-04-271-3/+0
| | | | | element in the structure pointed to by vp->v_data; the vnode lock is now within the vnode structure itself.
* Fix the code fragment clobbered in my last commit.tanimura2002-04-272-0/+4
|
* Add a global sx sigio_lock to protect the pointer to the sigio objecttanimura2002-04-273-26/+140
| | | | | | | | | | of a socket. This avoids lock order reversal caused by locking a process in pgsigio(). sowakeup() and the callers of it (sowwakeup, soisconnected, etc.) now require sigio_lock to be locked. Provide sowwakeup_locked(), soisconnected_locked(), and so on in case where we have to modify a socket and wake up a process atomically.
* Explain magic number.phk2002-04-271-2/+15
| | | | | | | Add magic date no explanation. Add a delta which was lost in transit yesterday which prevented other timecounters from actually being used.
* Make the dummy timecounter actually tick or we will never get anyhere.phk2002-04-271-1/+1
|
* Whitespace bogon.jhb2002-04-271-1/+1
|
* Insert a semi-colon between label 'skip:' and the closing bracemarcel2002-04-271-0/+1
| | | | of the FOREACH loop to silence GCC 3.
* Move the new byte order function prototypes from <sys/param.h> tomike2002-04-261-0/+1
| | | | <sys/endian.h>. This puts us in line with NetBSD and OpenBSD.
* Now that the private parts of timecounters are no longer being fingeredphk2002-04-261-143/+109
| | | | | | | | | | | | | by other bits of code, split struct timecounter into two. struct timecounter contains just the bits which pertains to the hardware counter and the reading of it. struct timehands (as in "the hands on a clock") contains all the ugly bit fidling stuff. Statically compile ten timehands. This commit is the functional part. A later cosmetic patch will rename various variables and fieldnames.
* Hide the private parts of timecounter from a couple of places that don'tphk2002-04-263-9/+13
| | | | really need to know the gory details.
* Simplify the RFC2783 and PPS_SYNC timestamp collection API.phk2002-04-261-16/+37
|
* Move the winding of timecounters out of hardclock and into a normalphk2002-04-262-4/+39
| | | | | | | | | timeout loop. Limit the rate at which we wind the timecounters to approx 1000 Hz. This limits the precision of the get{bin,nano,micro}[up]time(9) functions to roughly a millisecond.
* Various cleanup and sorting of clock reading functions. Add the twophk2002-04-261-71/+79
| | | | functions missing in the complete 12 function complement.
* Rename tco_setscales() and tco_delta() to use the same tc_ prefix asphk2002-04-261-11/+8
| | | | the rest of this file.
* Remove the tc_update() function. Any frequency change to thephk2002-04-261-6/+0
| | | | | | timecounter will be used starting at the next second, which is good enough for sysctl purposes. If better adjustment is needed the NTP PLL should be used.
* Test if rootvnode is NULL rather than if rootdev is NODEV when determiningbrian2002-04-261-1/+1
| | | | | | | | if there's a filesystem present. rootdev can be NODEV in the NFS-mounted root scenario. Discussed with: Harti Brandt <brandt@fokus.gmd.de>, iedowse
* Make sure that sockets undergoing accept filtering are aborted in asilby2002-04-263-4/+15
| | | | | | | | | LRU fashion when the listen queue fills up. Previously, there was no mechanism to kick out old sockets, leading to an easy DoS of daemons using accept filtering. Reviewed by: alfred MFC after: 3 days
* Add the mutex profiling lock to the witness list. This hopefully unbreaksdes2002-04-251-0/+1
| | | | | | the MUTEX_PROFILING + WITNESS + !WITNESS_SKIPSPIN case. Submitted by: Hiten Pandya <hiten@uk.FreeBSD.org>
* Fixed some longstanding bugs in _getenv_static():bde2002-04-251-3/+4
| | | | | | | | | | | | | - malformed environment strings (ones without an '=') were not rejected. There shouldn't be any of these, but when the static environment is empty it always begins with one of these; this one should be considered as the terminator after the end of the environment, but it isn't. - the comparison of the name being looked up with the name in the environment was fuzzy -- only the characters up to the length of the latter were compared, so _getenv_static("foobar") matched "foo=..." in the environment and everything matched "" in the empty environment. MFC after: 3 days
* Break the following implementation of panic(3):bde2002-04-251-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | #!bin/sh # Original version of this by Michael Reifenberger # <root@nihil.plaut.de>. mdconfig -d -u 11 >/dev/null 2>&1 dd if=/dev/zero of=zz bs=1m count=1 while : do mdconfig -a -t vnode -f zz -u 11 fdisk -f - -iv /dev/md11 <<EOF1 g c1 h64 s32 p 1 165 0 2048 a 1 EOF1 mdconfig -d -u 11 done Garbage pointers in __si_u were not cleared by destroy_dev(). Not clearing si_disk made the above fatal because the disk layer uses si_disk as a flag to indicate that the dev_t has been completely initialized. disk_destroy() clears si_disk for the parent dev_t but doesn't get called for children. Not fixed: - setting the undocumented sysctl debug.free_devt should cause more complete destruction of the dev_t including clearing of __si_u, but actually causes the above to panic a little earlier. - the loop leaks 10 memory allocations per iteration (4 DEVFS, 2 devbuf and 4 dev_t). Reviewed by: timeout by MAINTAINER after 3 months
* Don't use the symbol name to lookup the symbol value when we can usemarcel2002-04-252-16/+110
| | | | | | | | | | | | the symbol index defined by the relocation. The elf_lookup() support function is to be used by elf_reloc() when symbol lookups need to be done. The elf_lookup() function operates on the symbol index and will do a symbol name based lookup when such is required, otherwise it uses the symbol index directly. This solves the problem seen on ia64 where the symbol hash table does not contain local symbols and a symbol name based lookup would fail for those symbols. Don't pass the symbol name to elf_reloc(), as it isn't used any more.
* Free(9) should be Giant-free.tanimura2002-04-241-1/+1
| | | | Suggested by: jhb
* Remove sodropablereq - this function hasn't been used since thesilby2002-04-242-88/+0
| | | | | | syncache went in. MFC after: 3 days
* The cold and panicstr variables do not need to be protected by sched_lock.hsu2002-04-231-9/+13
| | | | | Submitted by: Jennifer Yang (yangjihui@yahoo.com) Reviewed by: jake & jhb in principle
* Add a basic sanity check on pointers passed to free(9).phk2002-04-231-0/+10
| | | | Should be improved by: jeff
* Don't call malloc(9) to allocate zero bytes softc data for devices.phk2002-04-231-1/+1
|
* Slightly restructure extattr_get_vp() so that there's only one entry pointrwatson2002-04-232-16/+30
| | | | | | | to VOP_GETEXTATTR(). This simplifies code flow when inserting MAC hooks. Obtained from: TrustedBSD Project Sponsored by: DARPA, NAI Labs
* Don't FILEDESC_LOCK around calls to falloc().alfred2002-04-221-2/+0
|
* Usage style sweep: spell "usage" with a small 'u'.des2002-04-221-1/+1
| | | | | Also change one case of blatant __progname abuse (several more remain) This commit does not touch anything in src/{contrib,crypto,gnu}/.
* Comment out Kirks io-request priority hack until we can do this in aphk2002-04-221-0/+5
| | | | | | | | | | | | | | | | | | | | | | | | | civilized way which doesn't cause grief. The problem is that it is not generally safe to cast a "struct bio *" to a "struct buf *". Things like ccd, vinum, ata-raid and GEOM constructs bio's which are not entrails of a struct buf. Also, curthread may or may not have anything to do with the I/O request at hand. The correct solution can either be to tag struct bio's with a priority derived from the requesting threads nice and have disksort act on this field, this wouldn't address the "silly-seek syndrome" where two equal processes bang the diskheads from one edge to the other of the disk repeatedly. Alternatively, and probably better: a sleep should be introduced either at the time the I/O is requested or at the time it is completed where we can be sure to sleep in the right thread. The sleep also needs to be in constant timeunits, 1/hz can be practicaly any sub-second size, at high HZ the current code practically doesn't do anything.
OpenPOWER on IntegriCloud