sched: swap setting for g_npidhash

in case of crash in kmm_zalloc, and crash dump use
nxsched_foreach()

Signed-off-by: ligd <liguiding1@xiaomi.com>
This commit is contained in:
ligd 2024-03-28 22:37:18 +08:00 committed by Xiang Xiao
parent aff700f8ca
commit 07b27cd199
1 changed files with 6 additions and 4 deletions

View File

@ -606,15 +606,17 @@ void nx_start(void)
/* Initialize the logic that determine unique process IDs. */
g_npidhash = 1 << LOG2_CEIL(CONFIG_PID_INITIAL_COUNT);
while (g_npidhash <= CONFIG_SMP_NCPUS)
i = 1 << LOG2_CEIL(CONFIG_PID_INITIAL_COUNT);
while (i <= CONFIG_SMP_NCPUS)
{
g_npidhash <<= 1;
i <<= 1;
}
g_pidhash = kmm_zalloc(sizeof(*g_pidhash) * g_npidhash);
g_pidhash = kmm_zalloc(sizeof(*g_pidhash) * i);
DEBUGASSERT(g_pidhash);
g_npidhash = i;
/* IDLE Group Initialization **********************************************/
idle_group_initialize();