kernel: Add the old "multi queue" scheduler algorithm as an option
Zephyr 1.12 removed the old scheduler and replaced it with the choice of a "dumb" list or a balanced tree. But the old multi-queue algorithm is still useful in the space between these two (applications with large-ish numbers of runnable threads, but that don't need fancy features like EDF or SMP affinity). So add it as a CONFIG_SCHED_MULTIQ option. Signed-off-by: Andy Ross <andrew.j.ross@intel.com>
This commit is contained in:
parent
225c74bbdf
commit
9f06a35450
5 changed files with 106 additions and 19 deletions
|
@ -44,4 +44,20 @@ void _priq_rb_add(struct _priq_rb *pq, struct k_thread *thread);
|
|||
void _priq_rb_remove(struct _priq_rb *pq, struct k_thread *thread);
|
||||
struct k_thread *_priq_rb_best(struct _priq_rb *pq);
|
||||
|
||||
/* Traditional/textbook "multi-queue" structure. Separate lists for a
|
||||
* small number (max 32 here) of fixed priorities. This corresponds
|
||||
* to the original Zephyr scheduler. RAM requirements are
|
||||
* comparatively high, but performance is very fast. Won't work with
|
||||
* features like deadline scheduling which need large priority spaces
|
||||
* to represet their requirements.
|
||||
*/
|
||||
struct _priq_mq {
|
||||
sys_dlist_t queues[32];
|
||||
unsigned int bitmask; /* bit 1<<i set if queues[i] is non-empty */
|
||||
};
|
||||
|
||||
void _priq_mq_add(struct _priq_mq *pq, struct k_thread *thread);
|
||||
void _priq_mq_remove(struct _priq_mq *pq, struct k_thread *thread);
|
||||
struct k_thread *_priq_mq_best(struct _priq_mq *pq);
|
||||
|
||||
#endif /* _sched_priq__h_ */
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue