summaryrefslogtreecommitdiffstats
path: root/sys/kern
Commit message (Collapse)AuthorAgeFilesLines
* Include <sys/gmon.h> instead of <machine/profile.h> for the declarationbde2004-05-191-3/+3
| | | | | | of kmupetext(). The declaration is misplaced in <machine/profile.h> since it is not MD and not related to the lowest level of profiling. It will be moved, but getting it via <sys/gmon.h> already works.
* syncache broke rev 1.23 which was done to fix the "thundering herd"ps2004-05-192-2/+2
| | | | | | problem in Apache. Fix it. Reviewed by: peter
* If a symbol has section+offset definitions provided, always use insteadpeter2004-05-181-6/+9
| | | | of doing a name lookup for global symbols. This fixes the snd_pcm module.
* Remove leftover padding variables.peter2004-05-181-8/+4
| | | | | Convert some silent 'ignore programmer error' cases into panics Remove 'align' field from section table (no longer needed)
* Since we go to the trouble of compiling the kobj ops table for each class,peter2004-05-171-0/+1
| | | | | | | | | | | | and cannot handle it going away, add an explicit reference to the kobj class inside each linker class. Without this, a class with no modules loaded will sit with an idle refcount of 0. Loading and unloading a module with it causes a 0->1->0 transition which frees the ops table and causes subsequent loads using that class to explode. Normally, the "kernel" module will remain forever loaded and prevent this happening, but if you have more than one linker class active, only one owns the "kernel". This finishes making modules work for kldload(8) on amd64.
* Clean up the code some more. Unify the text/data (progbits) and bsspeter2004-05-171-236/+249
| | | | | | (nobits) tables to simplify some code. Try and shorten some of the very wide lines. Somewhere along the way, I think I fixed the memory corruption that caused panics after going multiuser.
* Oops, use the generic ELF_ST_BIND() macro instead of ELF64_ST_BIND.peter2004-05-171-5/+5
| | | | Submitted by: marks
* Make a small revision to the api between the elf linker core and thepeter2004-05-161-7/+14
| | | | | | elf_reloc() backends for two reasons. First, to support the possibility of there being two elf linkers in the kernel (eg: amd64), and second, to pass the relocbase explicitly (for relocating .o format kld files).
* Fixed some common printf format errors. Don't assume that "struct foo *"bde2004-05-142-33/+27
| | | | | | | | is "void *" (it isn't) or that the default promotion of pid_t is int. Instead, assume that casting "struct foo *" to "void *" and printing the result with %p is useful, and that all pid_t's are representable as longs. Fixed some minor style bugs (mainly spelling errors in comments).
* Split sleepq_wakeup_thread() into two functions. sleepq_remove_thread()jhb2004-05-131-13/+50
| | | | | | | | | | | | | | removes a specific thread from a sleep queue. sleepq_resume_thread() resumes scheduling of a thread that has been previously removed from a sleep queue. - sleepq_catch_signals() just removes a thread from the queue it was just added to when a pending signal is found. - sleepq_signal() and sleepq_broadcast() remove threads from a queue, drop the queue lock, and then resume all the previously removed threads. This doesn't completely fix the sched_lock <-> sleepq chain LOR, but it makes it a little better as we no longer call setrunnble() with a sleep queue lock held meaning if setrunnable() tries to wakeup the swapper we don't try to lock two sleep queue chains at the same time.
* Eliminate a memory leak in kern_symlink() that could occur iftjr2004-05-112-2/+2
| | | | vn_start_write() failed.
* Remove misplaced duplicate comment and slightly reformat thejulian2004-05-091-16/+6
| | | | version that was in the right place.
* set m_len to reflect mbuf contents on return from m_dup1; fixes an obscuresam2004-05-091-0/+1
| | | | | | | m_pullup case that contributed to breaking ipcomp in tunnel mode for kame Submitted by: itojun Obtained from: kame
* Fix rtprio() to do sensible things when called from threaded processes.julian2004-05-081-4/+45
| | | | | | | | | | | It's not quite correct from a posix Point Of view, but it is a lot better than what was there before. This will be revisited later when we decide what form our priority extensions will take. Posix doesn't specify how a system scope thread can change its priority so you need to add non-standard extensions to be able to do it.. For now make this slightly non standard to allow it to be done. Submitted by: Dan Eischen originally, changed by myself.
* Avoid pointless zeroing of the bogus page in vfs_bio_clrbuf().alc2004-05-081-6/+8
| | | | Suggested by: tegge@ (from October of last year)
* Unconditionally lock Giant in do_sendfile(), rather than locking itrwatson2004-05-081-2/+2
| | | | | | | conditional on debug.mpsafenet. We can try pushing down Giant here later, but we don't want to enter VFS without holding Giant. Bumped into by: kris
* Compare t_brkc against (char)_POSIX_VDISABLE, not against -1.cognet2004-05-071-1/+1
| | | | Discussed with: bde
* Move the CPU newbus attachment to i386 legacy. The acpi_cpu device willnjl2004-05-061-70/+0
| | | | | | become just "cpu" and provide attachments in the !legacy case. Tested by: des
* Make vm_page's PG_ZERO flag immutable between the time of the page'salc2004-05-062-15/+1
| | | | | | | | | | allocation and deallocation. This flag's principal use is shortly after allocation. For such cases, clearing the flag is pointless. The only unusual use of PG_ZERO is in vfs_bio_clrbuf(). However, allocbuf() never requests a prezeroed page. So, vfs_bio_clrbuf() never sees a prezeroed page. Reviewed by: tegge@
* Add /* !MAC */ to final #endif.rwatson2004-05-031-1/+1
|
* Bump copyright date for NETA to 2004.rwatson2004-05-031-1/+1
|
* Add MAC_STATIC, a kernel option that disables internal MAC Frameworkrwatson2004-05-031-0/+25
| | | | | | | | | | synchronization protecting against dynamic load and unload of MAC policies, and instead simply blocks load and unload. In a static configuration, this allows you to avoid the synchronization costs associated with introducing dynamicism. Obtained from: TrustedBSD Project Sponsored by: DARPA, McAfee Research
* Fix a race condition which could result in profprocs being decrementedcperciva2004-05-031-0/+2
| | | | | more than once if stopprofclock is called multiple times on the same process.
* Checkpoint commit for an alternative WIP kernel module loader that isn'tpeter2004-04-301-1058/+695
| | | | | | | | | | | | | | | | | | | as dependent on binutils features/quirks as the current one. This one loads plain .o files without having to mess with shared object mode. This happens to be essential on amd64, because binutils hasn't implemented all the quirks/features that we need for producing the hack non-PIC shared objects. As it turned out, .o format isn't all that inconvenient after all. It looks like the ability to use the same .o files for linking directly into a static kernel or loading as a module might be worth it. It is still very much a work-in-progress, but it is almost usable. Other changes are still needed in order to use it though, these have not been committed yet. There is still a memory corruption/overrun bug somewhere. For example, test modules load and work, but the machine explodes a few minutes later in vm_forkproc() or the like. Notable missing things include kldxref support, and loader(8) support. I wanted to figure out a working baseline set of code first.
* Keep track of threads waiting in kse_release() to avoid a racedeischen2004-04-283-33/+79
| | | | | | | | | | | condition where kse_wakeup() doesn't yet see them in (interruptible) sleep queues. Also add an upcall check to sleepqueue_catch_signals() suggested by jhb. This commit should fix recent mysql hangs. Reviewed by: jhb, davidxu Mysql'd by: Robin P. Blanchard <robin.blanchard at gactr uga edu>
* If the buffer supplied to kenv(KENV_DUMP, ...) isn't big enough,das2004-04-281-21/+18
| | | | | return the number of bytes needed instead of 0. The manpage claims that we do this anyway.
* Give jail(8) the feature to allow raw sockets from within abmilekic2004-04-261-0/+5
| | | | | | | | | | | | | | | | | | | | | jail, which is less restrictive but allows for more flexible jail usage (for those who are willing to make the sacrifice). The default is off, but allowing raw sockets within jails can now be accomplished by tuning security.jail.allow_raw_sockets to 1. Turning this on will allow you to use things like ping(8) or traceroute(8) from within a jail. The patch being committed is not identical to the patch in the PR. The committed version is more friendly to APIs which pjd is working on, so it should integrate into his work quite nicely. This change has also been presented and addressed on the freebsd-hackers mailing list. Submitted by: Christian S.J. Peron <maneo@bsdpro.com> PR: kern/65800
* Always use nd.ni_vp->v_mount as an argument for VFS_QUOTACTL(), just likepjd2004-04-262-10/+8
| | | | | | in RELENG_4. Pointed out by: Alex Lyashkov <umka@sevinter.net>
* The paper "Hashed Timers and Hierarchical Wheels: Data Structures for thehmp2004-04-251-1/+1
| | | | | | | Efficient Implementation of a Timer Facility" was co-author'ed by T. Lauk, not A. Lauk. Adjust nearby whitespace.
* Utilize sf_buf_alloc() rather than pmap_qenter() (and sometimesalc2004-04-232-20/+13
| | | | | kmem_alloc_wait()) for mapping the image header. On all machines with a direct virtual-to-physical mapping and SMP/HTT i386s, this is a clear win.
* There was a thread on "unusually high load averages" when running underobrien2004-04-221-2/+2
| | | | | | | | | | sched_ule, in January 2004. Looking at this, "pagezero" is (one of) the culprit(s). We had no provision for processes with P_NOLOAD set. With pagezero not running at PRI_ITHD, kseq_load_{add,rem} count pagezero as another-normal-process, thus the "expected-plus-one" load reported in the above thread. Submitted by: Nikos Ntarmos <ntarmos@ceid.upatras.gr>
* Look out! vn_start_write() is able to return 0 and NULL 'mp'.pjd2004-04-222-0/+4
| | | | Submitted by: Alex Lyashkov <shadow@psoft.net>
* Include <sys/mutex.h> and its prerequisite <sys/lock.h> instesd of dependingbde2004-04-211-5/+8
| | | | | | on namespace pollution in <sys/vnode.h>. Sorted includes.
* 1. Remove callout_stop binary compatibility.cperciva2004-04-201-10/+0
| | | | | | | 2. Document that this means that kernel modules must be rebuilt. 3. While I'm here, fix my sorting error in callout.h Requested by: many [1], scottl [2], bde [3]
* If you're trying to find out if a thread is valid and inmtm2004-04-191-4/+4
| | | | | | | | | the same process as the current thread it makes absolutely no sense to lock the parent process through the pointer in said thread. Submitted by: pho (with minor correction) Pointy Hat To: mtm
* constify the last argument of m_copyback.luigi2004-04-181-1/+1
|
* Fixed some style bugs in previous commit (mainly an insertion sort errorbde2004-04-171-9/+10
| | | | | | for declarations, and poorly worded messages). Fixed some nearby style bugs (unsorted declarations).
* - Enable (unmask) interrupt sources earlier in the ithread loop.jhb2004-04-161-8/+33
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Specifically, we used to enable the source after locking sched_lock and just before we had already decided to do a context switch. This meant that an ithread could never process more than one interrupt per context switch. Enabling earlier in the loop before sched_lock is acquired allows an ithread to handle multiple interrupts per context switch if interrupts fire very rapidly. For the case of heavy interrupt load this can reduce the number of context switches (and thus overhead) as well as reduce interrupt latency. - Now that we can handle multiple interrupts per context switch, add simple interrupt storm protection to threaded interrupts. If X number of consecutive interrupts are triggered before the itherad voluntarily yields to another thread, then the interrupt thread will sleep with the associated interrupt source disabled (masked) for 1/10th of a second. The default value of X is 500, but it can be tweaked via the tunable/ sysctl hw.intr_storm_threshold. If an interrupt storm is detected, then a message is output to the kernel console on the first occurrence per interrupt thread. Interrupt storm protection can be disabled completely by setting this value to 0. There is no scientific reasoning for the 1/10th of a second or 500 interrupts values, so they may require tweaking at some point in the future. Tested by: rwatson (an earlier version w/o the storm protection) Tested by: mux (reportedly made a machine with two PCI interrupts storming usable rather than hard locked) Reviewed by: imp
* At some point during the history of m_getcl(), MAC support began torwatson2004-04-161-6/+6
| | | | | | | | | unconditionally initialize the mbuf header even if cluster allocation failed, which could result in a NULL pointer dereference in low-memory conditions. PR: kern/65548 Submitted by: Stephan Uphoff <ups@tree.com>
* Ensure that the poll_burst <= poll_burst_max constraint really holds.ru2004-04-151-0/+2
| | | | Reviewed by: luigi
* Fix off by one error, twice.imp2004-04-121-2/+2
| | | | Submitted by: Carlos Velasco (first one), jhb (second one)
* stop() no longer needs sched_lock held; in fact, holding sched_lock causescperciva2004-04-121-3/+2
| | | | | | | | a LOR against sleepq. Fix the comment, and fix ptracestop() to pick up sched_lock after stop() rather than before. Reported by: Scott Sipe <cscotts@mindspring.com> Reviewed by: rwatson, jhb
* Put deprecated sysctl code inside BURN_BRIDGES.mux2004-04-111-3/+5
|
* Use vm_page_hold() rather than vm_page_wire() for short-duration pagealc2004-04-111-2/+2
| | | | wiring. The reason being that vm_page_hold() is cheaper.
* Remove a comment that complains about the lack of %qd, to justifymux2004-04-101-3/+2
| | | | | | truncating a rlim_t to a long. We have %qd since some time now. However, the correct format to use here is %jd and a cast to intmax_t, so do this.
* Plug minor memory leak of module_t structures when unloading a filepeadar2004-04-091-1/+3
| | | | | | from the kernel. Reviewed By: Doug Rabson (dfr@)
* Spell "switches" a more conventional way.cognet2004-04-091-1/+1
|
* Compare pointers with NULL rather than using pointers are booleans inrwatson2004-04-091-51/+53
| | | | | if/for statements. Assign pointers to NULL rather than typecast 0. Compare pointers with NULL rather than 0.
* Fix a regression in my change which sends headers along with data; asilby2004-04-081-2/+8
| | | | | | | | side effect of that change caused headers to not be sent if a 0 byte file was passed to sendfile. This change fixes that behavior, allowing sendfile to send out the headers even with a 0 byte file again. Noticed by: Dirk Engling
* Do not assume that the initial thread (i.e. the thread with the IDmarcel2004-04-081-6/+9
| | | | | | | | equal to the process ID) is still present when we dump a core. It already may have been destroyed. In that case we would end up dereferencing a NULL pointer, so specifically test for that as well. Reported & tested by: Dan Nelson <dnelson@allantgroup.com>
OpenPOWER on IntegriCloud