From b90fafd6a0858f6c248ba1ab79f89c344a71091c Mon Sep 17 00:00:00 2001 From: Anas Nashif Date: Thu, 26 Mar 2020 18:05:55 -0400 Subject: [PATCH] kernel: remove unused offload workqueue option Those are used only in tests, so remove them from kernel Kconfig and set them in the tests that use them directly. Signed-off-by: Anas Nashif --- arch/arm/core/aarch64/Kconfig | 3 --- arch/x86/core/Kconfig.intel64 | 3 --- boards/arm/mps2_an385/mps2_an385_defconfig | 1 - doc/guides/optimizations/footprint.rst | 3 --- kernel/Kconfig | 9 --------- .../net/sockets/echo_client/overlay-max-stacks.conf | 1 - .../net/sockets/echo_server/overlay-max-stacks.conf | 1 - samples/net/sockets/tcp/overlay-max-stacks.conf | 1 - tests/kernel/critical/src/main.c | 12 ++++++++++-- tests/kernel/pending/src/main.c | 11 +++++++++-- 10 files changed, 19 insertions(+), 26 deletions(-) diff --git a/arch/arm/core/aarch64/Kconfig b/arch/arm/core/aarch64/Kconfig index 6566f09fac..5f4a79a442 100644 --- a/arch/arm/core/aarch64/Kconfig +++ b/arch/arm/core/aarch64/Kconfig @@ -49,9 +49,6 @@ config TEST_EXTRA_STACKSIZE config SYSTEM_WORKQUEUE_STACK_SIZE default 4096 -config OFFLOAD_WORKQUEUE_STACK_SIZE - default 4096 - config CMSIS_THREAD_MAX_STACK_SIZE default 4096 diff --git a/arch/x86/core/Kconfig.intel64 b/arch/x86/core/Kconfig.intel64 index 44755bfed5..a2e7fd9732 100644 --- a/arch/x86/core/Kconfig.intel64 +++ b/arch/x86/core/Kconfig.intel64 @@ -20,9 +20,6 @@ config TEST_EXTRA_STACKSIZE config SYSTEM_WORKQUEUE_STACK_SIZE default 8192 -config OFFLOAD_WORKQUEUE_STACK_SIZE - default 8192 - config EXCEPTION_STACK_SIZE int "Size of the exception stack(s)" default 2048 diff --git a/boards/arm/mps2_an385/mps2_an385_defconfig b/boards/arm/mps2_an385/mps2_an385_defconfig index c4fc815c37..5f8aabbcc4 100644 --- a/boards/arm/mps2_an385/mps2_an385_defconfig +++ b/boards/arm/mps2_an385/mps2_an385_defconfig @@ -34,5 +34,4 @@ CONFIG_IDLE_STACK_SIZE=8192 CONFIG_PRIVILEGED_STACK_SIZE=8192 CONFIG_TEST_EXTRA_STACKSIZE=4096 CONFIG_SYSTEM_WORKQUEUE_STACK_SIZE=2048 -CONFIG_OFFLOAD_WORKQUEUE_STACK_SIZE=4096 CONFIG_ISR_STACK_SIZE=4096 diff --git a/doc/guides/optimizations/footprint.rst b/doc/guides/optimizations/footprint.rst index 73d11995f8..ca7c3984e7 100644 --- a/doc/guides/optimizations/footprint.rst +++ b/doc/guides/optimizations/footprint.rst @@ -23,9 +23,6 @@ them for your application: :option:`CONFIG_SYSTEM_WORKQUEUE_STACK_SIZE` Set to 1024 by default -:option:`CONFIG_OFFLOAD_WORKQUEUE_STACK_SIZE` - Set to 1024 by default - :option:`CONFIG_PRIVILEGED_STACK_SIZE` Set to 1024 by default, depends on userspace feature. diff --git a/kernel/Kconfig b/kernel/Kconfig index 712faf52a0..670d24082f 100644 --- a/kernel/Kconfig +++ b/kernel/Kconfig @@ -374,15 +374,6 @@ config SYSTEM_WORKQUEUE_PRIORITY priority. This means that any work handler, once started, won't be preempted by any other thread until finished. -config OFFLOAD_WORKQUEUE_STACK_SIZE - int "Workqueue stack size for thread offload requests" - default 4096 if COVERAGE - default 1024 - -config OFFLOAD_WORKQUEUE_PRIORITY - int "Offload requests workqueue priority" - default -1 - endmenu menu "Atomic Operations" diff --git a/samples/net/sockets/echo_client/overlay-max-stacks.conf b/samples/net/sockets/echo_client/overlay-max-stacks.conf index 9a726656b5..89386a16ef 100644 --- a/samples/net/sockets/echo_client/overlay-max-stacks.conf +++ b/samples/net/sockets/echo_client/overlay-max-stacks.conf @@ -6,7 +6,6 @@ CONFIG_SYSTEM_WORKQUEUE_STACK_SIZE=65535 CONFIG_MAIN_STACK_SIZE=65535 CONFIG_IDLE_STACK_SIZE=65535 CONFIG_ISR_STACK_SIZE=65535 -CONFIG_OFFLOAD_WORKQUEUE_STACK_SIZE=65535 CONFIG_LOG_PROCESS_THREAD_STACK_SIZE=65535 CONFIG_NET_CONNECTION_MANAGER_STACK_SIZE=65535 CONFIG_SHELL_STACK_SIZE=65535 diff --git a/samples/net/sockets/echo_server/overlay-max-stacks.conf b/samples/net/sockets/echo_server/overlay-max-stacks.conf index 9a726656b5..89386a16ef 100644 --- a/samples/net/sockets/echo_server/overlay-max-stacks.conf +++ b/samples/net/sockets/echo_server/overlay-max-stacks.conf @@ -6,7 +6,6 @@ CONFIG_SYSTEM_WORKQUEUE_STACK_SIZE=65535 CONFIG_MAIN_STACK_SIZE=65535 CONFIG_IDLE_STACK_SIZE=65535 CONFIG_ISR_STACK_SIZE=65535 -CONFIG_OFFLOAD_WORKQUEUE_STACK_SIZE=65535 CONFIG_LOG_PROCESS_THREAD_STACK_SIZE=65535 CONFIG_NET_CONNECTION_MANAGER_STACK_SIZE=65535 CONFIG_SHELL_STACK_SIZE=65535 diff --git a/samples/net/sockets/tcp/overlay-max-stacks.conf b/samples/net/sockets/tcp/overlay-max-stacks.conf index 9ae3d692c9..91709d6178 100644 --- a/samples/net/sockets/tcp/overlay-max-stacks.conf +++ b/samples/net/sockets/tcp/overlay-max-stacks.conf @@ -6,5 +6,4 @@ CONFIG_SYSTEM_WORKQUEUE_STACK_SIZE=65535 CONFIG_MAIN_STACK_SIZE=65535 CONFIG_IDLE_STACK_SIZE=65535 CONFIG_ISR_STACK_SIZE=65535 -CONFIG_OFFLOAD_WORKQUEUE_STACK_SIZE=65535 CONFIG_LOG_PROCESS_THREAD_STACK_SIZE=65535 diff --git a/tests/kernel/critical/src/main.c b/tests/kernel/critical/src/main.c index 1e5f81c4d9..e7a8186bcd 100644 --- a/tests/kernel/critical/src/main.c +++ b/tests/kernel/critical/src/main.c @@ -35,12 +35,20 @@ #define NUM_MILLISECONDS 5000 #define TEST_TIMEOUT 20000 +#ifdef CONFIG_COVERAGE +#define OFFLOAD_WORKQUEUE_STACK_SIZE 4096 +#else +#define OFFLOAD_WORKQUEUE_STACK_SIZE 1024 +#endif + +#define OFFLOAD_WORKQUEUE_PRIORITY (-1) + static u32_t critical_var; static u32_t alt_thread_iterations; static struct k_work_q offload_work_q; static K_THREAD_STACK_DEFINE(offload_work_q_stack, - CONFIG_OFFLOAD_WORKQUEUE_STACK_SIZE); + OFFLOAD_WORKQUEUE_STACK_SIZE); #define STACK_SIZE (1024 + CONFIG_TEST_EXTRA_STACKSIZE) @@ -203,7 +211,7 @@ static void init_objects(void) k_work_q_start(&offload_work_q, offload_work_q_stack, K_THREAD_STACK_SIZEOF(offload_work_q_stack), - CONFIG_OFFLOAD_WORKQUEUE_PRIORITY); + OFFLOAD_WORKQUEUE_PRIORITY); } static void start_threads(void) diff --git a/tests/kernel/pending/src/main.c b/tests/kernel/pending/src/main.c index f5d05bd340..455cf415a7 100644 --- a/tests/kernel/pending/src/main.c +++ b/tests/kernel/pending/src/main.c @@ -30,9 +30,16 @@ #define NON_NULL_PTR ((void *)0x12345678) +#ifdef CONFIG_COVERAGE +#define OFFLOAD_WORKQUEUE_STACK_SIZE 4096 +#else +#define OFFLOAD_WORKQUEUE_STACK_SIZE 1024 +#endif + +#define OFFLOAD_WORKQUEUE_PRIORITY (-1) static struct k_work_q offload_work_q; static K_THREAD_STACK_DEFINE(offload_work_q_stack, - CONFIG_OFFLOAD_WORKQUEUE_STACK_SIZE); + OFFLOAD_WORKQUEUE_STACK_SIZE); struct fifo_data { intptr_t reserved; @@ -244,7 +251,7 @@ void task_high(void) k_work_q_start(&offload_work_q, offload_work_q_stack, K_THREAD_STACK_SIZEOF(offload_work_q_stack), - CONFIG_OFFLOAD_WORKQUEUE_PRIORITY); + OFFLOAD_WORKQUEUE_PRIORITY); counter = SEM_TEST_START;