Skip to content

Commit

Permalink
sched: swap setting for g_npidhash
Browse files Browse the repository at this point in the history
in case of crash in kmm_zalloc, and crash dump use
nxsched_foreach()

Signed-off-by: ligd <[email protected]>
  • Loading branch information
GUIDINGLI committed Oct 7, 2024
1 parent 4bbd905 commit 71c4307
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions sched/init/nx_start.c
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down

0 comments on commit 71c4307

Please sign in to comment.