Skip to content

Commit 0825d2f

Browse files
committed
task: reduce default stack size for some platforms
Reduces default EDF task's stack size for some platforms, which have less memory and aren't used for more serious processing. Signed-off-by: Tomasz Lauda <tomasz.lauda@linux.intel.com>
1 parent b6b8c3f commit 0825d2f

7 files changed

Lines changed: 18 additions & 5 deletions

File tree

src/arch/xtensa/schedule/task.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
#include <sof/lib/alloc.h>
1616
#include <sof/lib/cache.h>
1717
#include <sof/lib/cpu.h>
18+
#include <sof/lib/memory.h>
1819
#include <sof/lib/wait.h>
1920
#include <sof/schedule/edf_schedule.h>
2021
#include <sof/schedule/schedule.h>
@@ -83,10 +84,10 @@ int task_context_init(void *task_ctx, void *entry, void *arg0, void *arg1,
8384
ctx->stack_size = stack_size;
8485
} else {
8586
ctx->stack_base = rballoc(0, SOF_MEM_CAPS_RAM,
86-
SOF_TASK_DEFAULT_STACK_SIZE);
87+
PLATFORM_TASK_DEFAULT_STACK_SIZE);
8788
if (!ctx->stack_base)
8889
return -ENOMEM;
89-
ctx->stack_size = SOF_TASK_DEFAULT_STACK_SIZE;
90+
ctx->stack_size = PLATFORM_TASK_DEFAULT_STACK_SIZE;
9091
ctx->flags |= XTOS_TASK_CONTEXT_OWN_STACK;
9192
}
9293
bzero(ctx->stack_base, ctx->stack_size);

src/include/sof/schedule/task.h

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,9 +27,6 @@ struct sof;
2727
#define SOF_TASK_DEADLINE_ALMOST_IDLE (SOF_TASK_DEADLINE_IDLE - 1)
2828
#define SOF_TASK_DEADLINE_NOW 0
2929

30-
/** \brief EDF task's default stack size in bytes. */
31-
#define SOF_TASK_DEFAULT_STACK_SIZE 3072
32-
3330
/** \brief Task states. */
3431
enum task_state {
3532
SOF_TASK_STATE_INIT = 0,

src/platform/baytrail/include/platform/lib/memory.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,9 @@ static inline void *platform_rfree_prepare(void *ptr)
4747

4848
#define PLATFORM_DCACHE_ALIGN sizeof(void *)
4949

50+
/** \brief EDF task's default stack size in bytes. */
51+
#define PLATFORM_TASK_DEFAULT_STACK_SIZE 2048
52+
5053
/* physical DSP addresses */
5154

5255
#define SHIM_BASE 0xFF340000

src/platform/haswell/include/platform/lib/memory.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,9 @@ static inline void *platform_rfree_prepare(void *ptr)
4848
/* data cache line alignment */
4949
#define PLATFORM_DCACHE_ALIGN sizeof(void *)
5050

51+
/** \brief EDF task's default stack size in bytes. */
52+
#define PLATFORM_TASK_DEFAULT_STACK_SIZE 2048
53+
5154
/* physical DSP addresses */
5255

5356
#define SHIM_SIZE 0x00001000

src/platform/imx8/include/platform/lib/memory.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -170,6 +170,9 @@
170170

171171
#define HEAP_BUF_ALIGNMENT PLATFORM_DCACHE_ALIGN
172172

173+
/** \brief EDF task's default stack size in bytes. */
174+
#define PLATFORM_TASK_DEFAULT_STACK_SIZE 3072
175+
173176
#if !defined(__ASSEMBLER__) && !defined(LINKER)
174177

175178
struct sof;

src/platform/imx8m/include/platform/lib/memory.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -167,6 +167,9 @@
167167

168168
#define HEAP_BUF_ALIGNMENT PLATFORM_DCACHE_ALIGN
169169

170+
/** \brief EDF task's default stack size in bytes. */
171+
#define PLATFORM_TASK_DEFAULT_STACK_SIZE 3072
172+
170173
#if !defined(__ASSEMBLER__) && !defined(LINKER)
171174

172175
struct sof;

src/platform/intel/cavs/include/cavs/lib/memory.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,9 @@
6464

6565
#define HEAP_BUF_ALIGNMENT PLATFORM_DCACHE_ALIGN
6666

67+
/** \brief EDF task's default stack size in bytes. */
68+
#define PLATFORM_TASK_DEFAULT_STACK_SIZE 3072
69+
6770
#if !defined(__ASSEMBLER__) && !defined(LINKER)
6871

6972
struct sof;

0 commit comments

Comments
 (0)