kernel: support for more than 32 total priorities

In addition to more priorities taking more memory to host them, finding
the next thread to run when it is not cached is slower since each extra
set of 32 priorities maps to a loop iteration. That loop is remove
entirely when the number of priorities is less than 32 (31 + the idle
thread).

Fixes ZEP-1303.

Change-Id: I3205df90d379a0f4456ff1d7f1aaa67ad2cddf15
Signed-off-by: Benjamin Walsh <benjamin.walsh@windriver.com>
This commit is contained in:
Benjamin Walsh 2016-11-18 15:35:05 -05:00 committed by Anas Nashif
commit 358a53cb2f
5 changed files with 48 additions and 14 deletions

View file

@ -107,7 +107,7 @@ struct _ready_q {
struct k_thread *cache;
/* bitmap of priorities that contain at least one ready thread */
uint32_t prio_bmap[1];
uint32_t prio_bmap[K_NUM_PRIO_BITMAPS];
/* ready queues, one per priority */
sys_dlist_t q[K_NUM_PRIORITIES];