Age | Commit message (Collapse) | Author |
|
|
|
|
|
|
|
|
|
The new turnstile module provides priority propagation capable sleep
queues, tightly coupled with the scheduler, and can be used to implement
synchronization facilities with priority inheritance.
|
|
This module provides simple generic sleep queues that can be used to
implement higher level synchronization facilities such as mutexes and
condition variables.
|
|
Counting thread references seems unavoidable for the near-future changes
that are currently brewing.
|
|
|
|
|
|
|
|
Using a single header for all types causing inclusion circular
dependencies isn't very elegant and doesn't scale.
|
|
|
|
|
|
|
|
|
|
This macro is used to build kernel thread names.
|
|
|
|
This change was done using astyle, with a few manual editing here and
there.
|
|
|
|
Remove comment.
|
|
|
|
|
|
This change affects more files than it apparently would at first glance.
This is because circular dependencies can easily be created between the
thread, mutex, condition and spinlock modules. As a result, some of the
types of these modules are now defined in kern/types.h.
|
|
The thread_sleep function takes a spin lock as a parameter. This lock is
used as an interlock allowing either the thread waking up or the thread
being awaken to run. But when threads don't need a lock to provide that
guarantee, the interlock is only overhead. This change makes thread_sleep
assume disabling preemption is used as a synchronization mechanism when
the interlock is NULL.
|
|
Use a global checkpoint identifier as a generation counter and remove
reset interrupts.
For some reason I can't remember, using reset interrupts was thought to
be more efficient, perhaps because accessing a global variable on each
checkpoint looked expensive. But it's really not scalable, and a
read-mostly global variable can get cached locally and not incur expensive
access.
In addition, add a decent amount of documentation about the semantics
with regard to the rest of the system. Explicitely state that checkpoints
are triggered by context switches and that it's not allowed to block
inside read-side critical sections. Make periodic events attempt to trigger
checkpoints too. Add a thread-local read-side critical section nesting
counter so that it can be reliably determined whether the processor is
running a read-side critical section or not.
|
|
|
|
|
|
|
|
These functions allow accessing thread-local variables from a different
thread, typically before starting a thread.
|
|
|
|
|
|
Start application processors once the kernel is completely initialized,
right before starting the scheduler. This simplifies the procedure with
regard to inter-processor pmap updates.
|
|
|
|
Make spin locks and mutexes encode their state on an int rather than
a long.
|
|
Make passing attributes and passing a thread name mandatory.
|
|
Rename THREAD_RESCHEDULE to THREAD_YIELD and thread_reschedule to
thread_yield for better clarity, and add the thread_schedule inline
function that checks for the THREAD_YIELD flag before calling
thread_yield (yielding only checks if preemption is enabled).
|
|
|
|
Refer to scheduling class data instead of context.
|
|
Processor affinity can be set before a thread is created, but currently not
changed afterwards.
|
|
|
|
|
|
Rename sched_policy to policy.
|
|
|
|
In order to implement synchronization primitives, the thread_sleep and
thread_wakeup functions are changed so that a thread waiting for an event
can be reliably awaken, without ever missing a wakeup request.
|
|
Instead of using idler threads to provide thread context during bootstrap,
use a fake "booter" thread. This makes the creation of idler threads easier
because they're not (even partially) used while being initialized when
interrupts occur.
|
|
|
|
Change the name for consistency, move it for better alignment.
|
|
This prevents switching from one round to the next (and in turn round
balancing) happening too frequently (or infrequently) when the timer
frequency is increased (or decreased).
|
|
|
|
|