#
7ab24ea3 |
| 26-Oct-2007 |
Julian Elischer <julian@FreeBSD.org> |
Introduce a way to make pure kernal threads. kthread_add() takes the same parameters as the old kthread_create() plus a pointer to a process structure, and adds a kernel thread to that process.
kpro
Introduce a way to make pure kernal threads. kthread_add() takes the same parameters as the old kthread_create() plus a pointer to a process structure, and adds a kernel thread to that process.
kproc_kthread_add() takes the parameters for kthread_add, plus a process name and a pointer to a pointer to a process instead of just a pointer, and if the proc * is NULL, it creates the process to the specifications required, before adding the thread to it.
All other old kthread_xxx() calls return, but act on (struct thread *) instead of (struct proc *). One reason to change the name is so that any old kernel modules that are lying around and expect kthread_create() to make a process will not just accidentally link.
fix top to show kernel threads by their thread name in -SH mode add a tdnam formatting option to ps to show thread names.
make all idle threads actual kthreads and put them into their own idled process. make all interrupt threads kthreads and put them in an interd process (mainly for aesthetic and accounting reasons) rename proc 0 to be 'kernel' and it's swapper thread is now 'swapper'
man page fixes to follow.
show more ...
|
#
05dc0eb2 |
| 09-Oct-2007 |
Jeff Roberson <jeff@FreeBSD.org> |
- Restore historical sched_yield() behavior by changing sched_relinquish() to simply switch rather than lowering priority and switching. This allows threads of equal priority to run but not le
- Restore historical sched_yield() behavior by changing sched_relinquish() to simply switch rather than lowering priority and switching. This allows threads of equal priority to run but not lesser priority.
Discussed with: davidxu Reported by: NIIMI Satoshi <sa2c@sa2c.net> Approved by: re
show more ...
|
#
54b0e65f |
| 21-Sep-2007 |
Jeff Roberson <jeff@FreeBSD.org> |
- Redefine p_swtime and td_slptime as p_swtick and td_slptick. This changes the units from seconds to the value of 'ticks' when swapped in/out. ULE does not have a periodic timer that scans a
- Redefine p_swtime and td_slptime as p_swtick and td_slptick. This changes the units from seconds to the value of 'ticks' when swapped in/out. ULE does not have a periodic timer that scans all threads in the system and as such maintaining a per-second counter is difficult. - Change computations requiring the unit in seconds to subtract ticks and divide by hz. This does make the wraparound condition hz times more frequent but this is still in the range of several months to years and the adverse effects are minimal.
Approved by: re
show more ...
|
#
b61ce5b0 |
| 17-Sep-2007 |
Jeff Roberson <jeff@FreeBSD.org> |
- Move all of the PS_ flags into either p_flag or td_flags. - p_sflag was mostly protected by PROC_LOCK rather than the PROC_SLOCK or previously the sched_lock. These bugs have existed for some
- Move all of the PS_ flags into either p_flag or td_flags. - p_sflag was mostly protected by PROC_LOCK rather than the PROC_SLOCK or previously the sched_lock. These bugs have existed for some time. - Allow swapout to try each thread in a process individually and then swapin the whole process if any of these fail. This allows us to move most scheduler related swap flags into td_flags. - Keep ki_sflag for backwards compat but change all in source tools to use the new and more correct location of P_INMEM.
Reported by: pho Reviewed by: attilio, kib Approved by: re (kensmith)
show more ...
|
#
6ea38de8 |
| 18-Jul-2007 |
Jeff Roberson <jeff@FreeBSD.org> |
- Remove the global definition of sched_lock in mutex.h to break new code and third party modules which try to depend on it. - Initialize sched_lock in sched_4bsd.c. - Declare sched_lock in spar
- Remove the global definition of sched_lock in mutex.h to break new code and third party modules which try to depend on it. - Initialize sched_lock in sched_4bsd.c. - Declare sched_lock in sparc64 pmap.c and assert that we're compiling with SCHED_4BSD to prevent accidental crashes from running ULE. This is the sole remaining file outside of the scheduler that uses the global sched_lock.
Approved by: re
show more ...
|
#
fe54587f |
| 12-Jun-2007 |
Jeff Roberson <jeff@FreeBSD.org> |
- Move some common code out of sched_fork_exit() and back into fork_exit().
|
#
710eacdc |
| 06-Jun-2007 |
Jeff Roberson <jeff@FreeBSD.org> |
- Placing the 'volatile' on the right side of the * in the td_lock declaration removes the need for __DEVOLATILE().
Pointed out by: tegge
|
#
95e3a0bc |
| 05-Jun-2007 |
Jeff Roberson <jeff@FreeBSD.org> |
- Better fix for previous error; use DEVOLATILE on the td_lock pointer it can actually sometimes be something other than sched_lock even on schedulers which rely on a global scheduler lock.
Te
- Better fix for previous error; use DEVOLATILE on the td_lock pointer it can actually sometimes be something other than sched_lock even on schedulers which rely on a global scheduler lock.
Tested by: kan
show more ...
|
#
c219b097 |
| 05-Jun-2007 |
Jeff Roberson <jeff@FreeBSD.org> |
- Pass &sched_lock as the third argument to cpu_switch() as this will always be the correct lock and we don't get volatile warnings this way.
Pointed out by: kan
|
#
7b20fb19 |
| 05-Jun-2007 |
Jeff Roberson <jeff@FreeBSD.org> |
Commit 1/14 of sched_lock decomposition. - Move all scheduler locking into the schedulers utilizing a technique similar to solaris's container locking. - A per-process spinlock is now used to pr
Commit 1/14 of sched_lock decomposition. - Move all scheduler locking into the schedulers utilizing a technique similar to solaris's container locking. - A per-process spinlock is now used to protect the queue of threads, thread count, suspension count, p_sflags, and other process related scheduling fields. - The new thread lock is actually a pointer to a spinlock for the container that the thread is currently owned by. The container may be a turnstile, sleepqueue, or run queue. - thread_lock() is now used to protect access to thread related scheduling fields. thread_unlock() unlocks the lock and thread_set_lock() implements the transition from one lock to another. - A new "blocked_lock" is used in cases where it is not safe to hold the actual thread's lock yet we must prevent access to the thread. - sched_throw() and sched_fork_exit() are introduced to allow the schedulers to fix-up locking at these points. - Add some minor infrastructure for optionally exporting scheduler statistics that were invaluable in solving performance problems with this patch. Generally these statistics allow you to differentiate between different causes of context switches.
Tested by: kris, current@ Tested on: i386, amd64, ULE, 4BSD, libthr, libkse, PREEMPTION, etc. Discussed with: kris, attilio, kmacy, jhb, julian, bde (small parts each)
show more ...
|
#
4d70511a |
| 27-Feb-2007 |
John Baldwin <jhb@FreeBSD.org> |
Use pause() rather than tsleep() on stack variables and function pointers.
|
#
c6226eea |
| 02-Feb-2007 |
Julian Elischer <julian@FreeBSD.org> |
Move the seting of the idle_mask bits to a place where they can't be wrong. Also use the IDLETD bit in the thread mask to test if its an idle thread rather than doing a PCPU access.
|
#
f0393f06 |
| 23-Jan-2007 |
Jeff Roberson <jeff@FreeBSD.org> |
- Remove setrunqueue and replace it with direct calls to sched_add(). setrunqueue() was mostly empty. The few asserts and thread state setting were moved to the individual schedulers. sched_a
- Remove setrunqueue and replace it with direct calls to sched_add(). setrunqueue() was mostly empty. The few asserts and thread state setting were moved to the individual schedulers. sched_add() was chosen to displace it for naming consistency reasons. - Remove adjustrunqueue, it was 4 lines of code that was ifdef'd to be different on all three schedulers where it was only called in one place each. - Remove the long ifdef'd out remrunqueue code. - Remove the now redundant ts_state. Inspect the thread state directly. - Don't set TSF_* flags from kern_switch.c, we were only doing this to support a feature in one scheduler. - Change sched_choose() to return a thread rather than a td_sched. Also, rely on the schedulers to return the idlethread. This simplifies the logic in choosethread(). Aside from the run queue links kern_switch.c mostly does not care about the contents of td_sched.
Discussed with: julian
- Move the idle thread loop into the per scheduler area. ULE wants to do something different from the other schedulers.
Suggested by: jhb
Tested on: x86/amd64 sched_{4BSD, ULE, CORE}.
show more ...
|
Revision tags: release/6.2.0_cvs, release/6.2.0 |
|
#
2da78e38 |
| 31-Dec-2006 |
Robert Watson <rwatson@FreeBSD.org> |
Prefer a more traditional spelling of inhibited in comments and panic messages.
|
#
34e1241b |
| 24-Dec-2006 |
David Xu <davidxu@FreeBSD.org> |
Fix typo, p_slptime should be td_slptime.
|
#
ad1e7d28 |
| 06-Dec-2006 |
Julian Elischer <julian@FreeBSD.org> |
Threading cleanup.. part 2 of several.
Make part of John Birrell's KSE patch permanent.. Specifically, remove: Any reference of the ksegrp structure. This feature was never fully utilised and made t
Threading cleanup.. part 2 of several.
Make part of John Birrell's KSE patch permanent.. Specifically, remove: Any reference of the ksegrp structure. This feature was never fully utilised and made things overly complicated. All code in the scheduler that tried to make threaded programs fair to unthreaded programs. Libpthread processes will already do this to some extent and libthr processes already disable it.
Also: Since this makes such a big change to the scheduler(s), take the opportunity to rename some structures and elements that had to be moved anyhow. This makes the code a lot more readable.
The ULE scheduler compiles again but I have no idea if it works.
The 4bsd scheduler still reqires a little cleaning and some functions that now do ALMOST nothing will go away, but I thought I'd do that as a separate commit.
Tested by David Xu, and Dan Eischen using libthr and libpthread.
show more ...
|
#
de38cd9d |
| 20-Nov-2006 |
Julian Elischer <julian@FreeBSD.org> |
whitespace fix only
|
#
65338575 |
| 14-Nov-2006 |
David Xu <davidxu@FreeBSD.org> |
Fix a copy-paste bug in NON-KSE case.
|
#
5a215147 |
| 11-Nov-2006 |
David Xu <davidxu@FreeBSD.org> |
Unbreak userland priority inheriting in NO_KSE case.
|
#
8460a577 |
| 26-Oct-2006 |
John Birrell <jb@FreeBSD.org> |
Make KSE a kernel option, turned on by default in all GENERIC kernel configs except sun4v (which doesn't process signals properly with KSE).
Reviewed by: davidxu@
|
#
3db720fd |
| 25-Aug-2006 |
David Xu <davidxu@FreeBSD.org> |
Add user priority loaning code to support priority propagation for 1:1 threading's POSIX priority mutexes, the code is no-op unless priority-aware umtx code is committed.
|
#
1f36c876 |
| 02-Jul-2006 |
Maxim Konovalov <maxim@FreeBSD.org> |
o Fix grammar in the comment, indent macros. No functional changes.
|
#
75d960eb |
| 02-Jul-2006 |
Maxim Konovalov <maxim@FreeBSD.org> |
o Remove rev. 1.57 leftover, not reached code.
|
#
2e4db89c |
| 29-Jun-2006 |
David E. O'Brien <obrien@FreeBSD.org> |
Fix building with GCC 4.2: define data types before referring to them.
|
#
36ec198b |
| 15-Jun-2006 |
David Xu <davidxu@FreeBSD.org> |
Add scheduler API sched_relinquish(), the API is used to implement yield() and sched_yield() syscalls. Every scheduler has its own way to relinquish cpu, the ULE and CORE schedulers have two internal
Add scheduler API sched_relinquish(), the API is used to implement yield() and sched_yield() syscalls. Every scheduler has its own way to relinquish cpu, the ULE and CORE schedulers have two internal run- queues, a timesharing thread which calls yield() syscall should be moved to inactive queue.
show more ...
|