sched/kconfig: add PID_INITIAL_COUNT
This adds config for initial pid limit so that to reduce reallocations quickly after boot. Signed-off-by: Yanfeng Liu <yfliu2008@qq.com>
This commit is contained in:
parent
caff9eba28
commit
56a7bd7972
@ -1939,3 +1939,12 @@ config GROUP_KILL_CHILDREN_TIMEOUT_MS
|
|||||||
> 0 means wait timeout
|
> 0 means wait timeout
|
||||||
= 0 means don't do kill signal
|
= 0 means don't do kill signal
|
||||||
|
|
||||||
|
config PID_INITIAL_COUNT
|
||||||
|
int "Initial length of pid table"
|
||||||
|
default 8 if DEFAULT_SMALL
|
||||||
|
default 16 if !DEFAULT_SMALL
|
||||||
|
---help---
|
||||||
|
This is the initial length of pid table, which the system
|
||||||
|
can still expand when needed. It is rounded up to power of
|
||||||
|
two by current implementation. If the number of threads in
|
||||||
|
your system is known at design time, setting this to it.
|
||||||
|
@ -45,6 +45,7 @@
|
|||||||
#include <nuttx/binfmt/binfmt.h>
|
#include <nuttx/binfmt/binfmt.h>
|
||||||
#include <nuttx/drivers/drivers.h>
|
#include <nuttx/drivers/drivers.h>
|
||||||
#include <nuttx/init.h>
|
#include <nuttx/init.h>
|
||||||
|
#include <nuttx/lib/math32.h>
|
||||||
|
|
||||||
#include "task/task.h"
|
#include "task/task.h"
|
||||||
#include "sched/sched.h"
|
#include "sched/sched.h"
|
||||||
@ -623,7 +624,7 @@ void nx_start(void)
|
|||||||
|
|
||||||
/* Initialize the logic that determine unique process IDs. */
|
/* Initialize the logic that determine unique process IDs. */
|
||||||
|
|
||||||
g_npidhash = 4;
|
g_npidhash = 1 << LOG2_CEIL(CONFIG_PID_INITIAL_COUNT);
|
||||||
while (g_npidhash <= CONFIG_SMP_NCPUS)
|
while (g_npidhash <= CONFIG_SMP_NCPUS)
|
||||||
{
|
{
|
||||||
g_npidhash <<= 1;
|
g_npidhash <<= 1;
|
||||||
|
Loading…
Reference in New Issue
Block a user