summaryrefslogtreecommitdiffstats
path: root/sys/kern
Commit message (Collapse)AuthorAgeFilesLines
* - Call sched_exit_{kse,thread} and sched_fork{kse,thread} so that thr worksjeff2003-04-111-0/+6
| | | | with ULE. This was not strictly required by sched_4bsd.
* - Add sched_exit_*jeff2003-04-111-6/+17
| | | | - Call sched_exit_kse() from sched_exit() instead of implementing it here.
* - Only select kseqs with more than one kse to steal. The running ksejeff2003-04-111-1/+1
| | | | is reflected in the load now and you can't very well migrate that.
* - When migrating a kse from one kseq to the next actually insert it ontojeff2003-04-111-22/+19
| | | | | | | | the second kseq's run queue so that it is referenced by the kse when it is switched out. - Spell ksq_rslices properly. Reported by: Ian Freislich <ianf@za.uu.net>
* The data in an sf_buf should not be modified by the mbuf system. Markalc2003-04-111-1/+1
| | | | | | the mbuf as read only. Reviewed by: gallatin
* - Add a SYSCTL node for the ule scheduler.jeff2003-04-111-300/+406
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | - Allow user adjustable min and max time slices (suggested by hiten). - Change the SLP_RUN_MAX to 100ms from 2 seconds so that we learn whether a process is interactive or not much more quickly. - Place a process on the current run queue if it is interactive or if it is running at an interrupt thread priority due to priority prop. - Use the 'current' timeshare queue for interrupt threads, realtime threads, and idle threads that are running at higher priority due to priority prop. This fixes problems where priorities would have been elevated but we would not check the timeshare run queue until other lower priority tasks were no longer runnable. - Keep an array of loads indexed by the priority class as well as a global load. - Keep an bucket of nice values with a count of the number of kses currently runnable with that nice value. - Keep track of the minimum nice value of any running thread. - Remove the unused short term sleep accounting. I was attempting to use this for load balancing but it didn't work out. - Define a kseq_print() for use with debugging. - Add KTR debugging at useful places so we can easily debug slice and priority assignment. - Decouple the runq assignment from the kseq assignment. kseq_add now keeps track of statistics. This is done so that the nice and load is still tracked for the currently running process. Previously if a niced process was added while a non nice process was running the niced process would still get a slice since it was not aware of the unnice process. - Make adjustments for the sched api changes.
* - Catch up with sched api changes.jeff2003-04-111-15/+48
|
* - Adjust sched hooks for fork and exec to take processes as arguments insteadjeff2003-04-114-14/+10
| | | | | | | | | | of ksegs since they primarily operation on processes. - KSEs take ticks so pass the kse through sched_clock(). - Add a sched_class() routine that adjusts a ksegrp pri class. - Define a sched_fork_{kse,thread,ksegrp} and sched_exit_{kse,thread,ksegrp} that will be used to tell the scheduler about new instances of these structures within the same process. These will be used by THR and KSE. - Change sched_4bsd to reflect this API update.
* Move the _oncpu entry from the KSE to the thread.julian2003-04-1011-13/+17
| | | | | The entry in the KSE still exists but it's purpose will change a bit when we add the ability to lock a KSE to a cpu.
* Regen.mike2003-04-092-2/+4
|
* o In struct prison, add an allprison linked list of prisons (protectedmike2003-04-095-108/+350
| | | | | | | | | | | | | | | by allprison_mtx), a unique prison/jail identifier field, two path fields (pr_path for reporting and pr_root vnode instance) to store the chroot() point of each jail. o Add jail_attach(2) to allow a process to bind to an existing jail. o Add change_root() to perform the chroot operation on a specified vnode. o Generalize change_dir() to accept a vnode, and move namei() calls to callers of change_dir(). o Add a new sysctl (security.jail.list) which is a group of struct xprison instances that represent a snapshot of active jails. Reviewed by: rwatson, tjr
* Remove some dead code.alc2003-04-081-8/+1
|
* Introduce an M_ASSERTPKTHDR() macro which performs the very common taskdes2003-04-082-6/+5
| | | | | | | of asserting that an mbuf has a packet header. Use it instead of hand- rolled versions wherever applicable. Submitted by: Hiten Pandya <hiten@unixdaemons.com>
* Merged from kern_thread.c 1.113, avoid a panic in cpu_throw when the firstjake2003-04-081-0/+2
| | | | | | | thread of a multithreaded process exits. This unrelated and possibly wrong change was not mentioned in the commit message for kern_thread.c 1.113.
* Inherit blocked thread's context for upcall thread.davidxu2003-04-082-14/+10
|
* Search for "elf32 kernel" (and elf64) and "elf32 module" (and elf64)peter2003-04-062-4/+12
| | | | | as well as "elf kernel" and "elf module". This is a precursor to x86-64 support in the i386 loader so it can load an elf64 x86-64 kernel.
* Remove an unnecessary trunc_page() from vmapbuf().alc2003-04-061-1/+1
| | | | Reviewed by: tegge
* Don't reinitialize fields that are already initialized by getpbuf().alc2003-04-052-2/+2
|
* Sufficient access checks are performed by vmapbuf() that callingalc2003-04-051-15/+1
| | | | | | useracc() is pointless. Remove the call to useracc() from physio(). Reviewed by: tegge
* o Remove useracc() calls from aio_qphysio(); they are redundantalc2003-04-041-20/+1
| | | | | | given the checks performed by vmapbuf(). Reviewed by: tegge
* o Check the b_bufsize passed to vmapbuf() returning an erroralc2003-04-041-2/+2
| | | | | | | if it is invalid. o Remove a debugging printf() from vmapbuf(). Suggested by: tegge
* Remove BIO_SETATTR from non-GEOM part of kernel as well.phk2003-04-031-1/+0
|
* - Keep seperate statistics and run queues for different scheduling classes.jeff2003-04-031-48/+134
| | | | | | | | - Treat each class specially in kseq_{choose,add,rem}. Let the rest of the code be less aware of scheduling classes. - Skip the interactivity calculation for non TIMESHARE ksegrps. - Move slice and runq selection into kseq_add(). Uninline it now that it's big.
* Commit a partial lazy thread switch mechanism for i386. it isn't as lazypeter2003-04-026-4/+62
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | as it could be and can do with some more cleanup. Currently its under options LAZY_SWITCH. What this does is avoid %cr3 reloads for short context switches that do not involve another user process. ie: we can take an interrupt, switch to a kthread and return to the user without explicitly flushing the tlb. However, this isn't as exciting as it could be, the interrupt overhead is still high and too much blocks on Giant still. There are some debug sysctls, for stats and for an on/off switch. The main problem with doing this has been "what if the process that you're running on exits while we're borrowing its address space?" - in this case we use an IPI to give it a kick when we're about to reclaim the pmap. Its not compiled in unless you add the LAZY_SWITCH option. I want to fix a few more things and get some more feedback before turning it on by default. This is NOT a replacement for Bosko's lazy interrupt stuff. This was more meant for the kthread case, while his was for interrupts. Mine helps a little for interrupts, but his helps a lot more. The stats are enabled with options SWTCH_OPTIM_STATS - this has been a pseudo-option for years, I just added a bunch of stuff to it. One non-trivial change was to select a new thread before calling cpu_switch() in the first place. This allows us to catch the silly case of doing a cpu_switch() to the current process. This happens uncomfortably often. This simplifies a bit of the asm code in cpu_switch (no longer have to call choosethread() in the middle). This has been implemented on i386 and (thanks to jake) sparc64. The others will come soon. This is actually seperate to the lazy switch stuff. Glanced at by: jake, jhb
* Lock the process before sending it a SIGIO. Not doing so is a panic(2)jhb2003-04-021-2/+7
| | | | implementation with INVARIANTS.
* Need to hold the same SMP lock for (knote) list traversal as forhsu2003-04-021-1/+1
| | | | | list manipulation. This lock also protects read-modify-write operations on the pipe_state field.
* - Make the interactivity calculator decay faster.jeff2003-04-021-2/+2
| | | | - Make the pcpu estimator update faster.
* - I meant divide by two and not shift by two in SCHED_PRI_NHALF.jeff2003-04-021-1/+1
|
* - Make casuptr return the old value of the location we're trying to update,jake2003-04-021-10/+13
| | | | | | and change the umtx code to expect this. Reviewed by: jeff
* - Add in support for KSEs with 0 slice values on the run queue. If we tryjeff2003-04-021-34/+90
| | | | | | | | | | | | | | | | to select a KSE with a slice of 0 we will update its slice and insert it onto the next queue. - Pass the KSE instead of the ksegrp into sched_slice(). This more accurately reflects the behavior of the code. Slices are granted to kses. - Add a function kseq_nice_min() which finds the smallest nice value assigned to the kseg of any KSE on the queue. - Rewrite the logic in sched_slice(). Add a large comment describing the new slice selection scheme. To summarize, slices are assigned based on the nice value. Priorities are still calculated based on the nice and interactivity of a process. Slice sizes of 0 may be granted for KSEs whos nice is 20 or futher away from the lowest nice on the run queue. Other nice values are scaled across the range [min, min+20]. This fixes ULEs bad behavior with positively niced processes.
* - Fix UC_COPY_SIZE. Adding up the size of structure fields doesn't takejake2003-04-011-4/+3
| | | | | | alignment into account. - Return EJUSTRETURN from set_context on success to avoid clobbering the first 2 out registers with td_retval on sparc64.
* #include <geom/geom_disk.h>phk2003-04-011-0/+1
|
* Introduce bioq_flush() function.phk2003-04-011-0/+15
|
* - p will be unused in cursig() if INVARIANTS is not defined. Access itjeff2003-04-011-3/+1
| | | | | | through td->td_proc to avoid the unused variable. Spotted by: Maxim Konovalov <maxim@macomnet.ru>
* - Regen.jeff2003-04-012-6/+6
|
* - thr_exit() should no longer be called with Giant held.jeff2003-04-011-2/+0
|
* - Mark the various thr syscalls as MP safe. Previously there was a bug ifjeff2003-04-011-4/+4
| | | | this was not done since thr_exit() unwinds giant.
* - Borrow the KSE single threading code for exec and exit. We use the checkjeff2003-04-016-10/+25
| | | | | | | | if (p->p_numthreads > 1) and not a flag because action is only necessary if there are other threads. The rest of the system has no need to identify thr threaded processes. - In kern_thread.c use thr_exit1() instead of thread_exit() if P_THREADED is not set.
* - Regen for umtx.jeff2003-04-012-2/+6
|
* - Include umtx.h in files generated by makesyscalls.shjeff2003-04-012-0/+3
| | | | - Add system calls for umtx.
* - Add an api for doing smp safe locks in userland.jeff2003-04-011-0/+303
| | | | | | | | | | | | - umtx_lock() is defined as an inline in umtx.h. It tries to do an uncontested acquire of a lock which falls back to the _umtx_lock() system-call if that fails. - umtx_unlock() is also an inline which falls back to _umtx_unlock() if the uncontested unlock fails. - Locks are keyed off of the thr_id_t of the currently running thread which is currently just the pointer to the 'struct thread' in kernel. - _umtx_lock() uses the proc pointer to synchronize access to blocked thread queues which are stored in the first blocked thread.
* - We now have to include umtx.h and ucontext.h in the system call relatedjeff2003-04-011-0/+2
| | | | headers.
* - Regen for thr related system calls.jeff2003-04-012-2/+10
|
* - Add the four thr related system calls.jeff2003-04-011-0/+4
|
* - Add two files to support the thr threading interface.jeff2003-04-011-0/+259
| | | | | | - sys/thr.h contains the user space visible api that is intended only for use in threading library packages. - kern/kern_thr.c contains thr system calls and other thr specific code.
* - Regen for the sig*wait* system calls.jeff2003-03-312-6/+8
|
* - Define sigwait, sigtimedwait, and sigwaitinfo in terms ofjeff2003-03-312-3/+178
| | | | | | kern_sigtimedwait() which is capable of supporting all of their semantics. - These should be POSIX compliant but more careful review is needed before we announce this.
* - Move p->p_sigmask to td->td_sigmask. Signal masks will be per thread withjeff2003-03-3110-146/+269
| | | | | | | a follow on commit to kern_sig.c - signotify() now operates on a thread since unmasked pending signals are stored in the thread. - PS_NEEDSIGCHK moves to TDF_NEEDSIGCHK.
* Do NOT return from an non-interruptable cv_wait, falselyjulian2003-03-311-2/+0
| | | | claiming to have timed out. I don't know what I was thinking..
* - Mark signals which may be delivered to any thread in the process withjeff2003-03-311-31/+32
| | | | | SA_PROC. Signals without this flag should be directed to a particular thread if this is possible.
OpenPOWER on IntegriCloud