diff options
author | Richard Braun <rbraun@sceen.net> | 2017-03-04 15:51:04 +0100 |
---|---|---|
committer | Richard Braun <rbraun@sceen.net> | 2017-03-04 16:47:59 +0100 |
commit | ef9426483f2f388c4874c6b12e0800645c3dbce4 (patch) | |
tree | 0cc9eb58a28d8cf0bb02c8b38cced1a4f37ac73f /kern/thread_i.h | |
parent | 6fecd5cef7a2f549b4d81053a3b80365ed7828f5 (diff) |
kern/{thread,turnstile}: implement priority inheritance
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.
Diffstat (limited to 'kern/thread_i.h')
-rw-r--r-- | kern/thread_i.h | 31 |
1 files changed, 29 insertions, 2 deletions
diff --git a/kern/thread_i.h b/kern/thread_i.h index 55f96082..865787a0 100644 --- a/kern/thread_i.h +++ b/kern/thread_i.h @@ -26,6 +26,7 @@ #include <kern/macros.h> #include <kern/mutex_types.h> #include <kern/param.h> +#include <kern/turnstile_types.h> #include <machine/atomic.h> #include <machine/tcb.h> @@ -103,6 +104,19 @@ struct thread { /* Sleep queue available for lending */ struct sleepq *priv_sleepq; + /* Turnstile available for lending */ + struct turnstile *priv_turnstile; + + /* Per-thread turnstile data */ + struct turnstile_td turnstile_td; + + /* + * True if priority must be propagated when preemption is reenabled + * + * This member is thread-local. + */ + bool propagate_priority; + /* Thread-local members */ unsigned short preempt; unsigned short pinned; @@ -111,8 +125,21 @@ struct thread { /* Processors on which this thread is allowed to run */ struct cpumap cpumap; - /* Scheduling data */ - struct thread_sched_data sched_data; + /* + * Scheduling data. + */ + struct thread_sched_data user_sched_data; /* User-provided */ + struct thread_sched_data real_sched_data; /* Computed from + priority propagation */ + + /* + * True if the real scheduling data are not the user scheduling data. + * + * Note that it doesn't provide any information about priority inheritance. + * A thread may be part of a priority inheritance chain without its + * priority being boosted. + */ + bool boosted; /* Class specific scheduling data */ union { |