public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* Fix MAX_STACK_ENTRIES from 100 to 32
@ 2023-07-08  1:56 wardenjohn
  2023-07-09  8:07 ` Bagas Sanjaya
  0 siblings, 1 reply; 5+ messages in thread
From: wardenjohn @ 2023-07-08  1:56 UTC (permalink / raw)
  To: jpoimboe
  Cc: jikos, mbenes, pmladek, joe.lawrence, live-patching, linux-kernel

Thanks for reading my suggestion. I found that the array for task stack entries when
doing livepatch function check is too large which seems to be unnecessary. Therefore,
I suggest to fix the MAX_STACK_ENTRIES from 100 to 32.

The patch is as follows:

From ee27da5e64daced159257f54170a31141e943710 Mon Sep 17 00:00:00 2001
From: Yongde Zhang <ydzhang@linux.alibaba.com>
Date: Sat, 8 Jul 2023 09:40:50 +0800
Subject: [PATCH] Fix MAX_STACK_ENTRIES to 32

When checking the task stack, using an stack array of size 100 
seems to be to large for a task stack. Therefore, I suggest to
change the stack size from 100 to 32. 

Signed-off-by: Yongde Zhang <ydzhang@linux.alibaba.com>
---
 kernel/livepatch/transition.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/kernel/livepatch/transition.c b/kernel/livepatch/transition.c
index e54c3d60a904..8d61c62b0c27 100644
--- a/kernel/livepatch/transition.c
+++ b/kernel/livepatch/transition.c
@@ -14,7 +14,7 @@
 #include "patch.h"
 #include "transition.h"
 
-#define MAX_STACK_ENTRIES  100
+#define MAX_STACK_ENTRIES  32
 static DEFINE_PER_CPU(unsigned long[MAX_STACK_ENTRIES], klp_stack_entries);
 
 #define STACK_ERR_BUF_SIZE 128 
-- 
2.37.3

^ permalink raw reply related	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2023-07-12 14:48 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-07-08  1:56 Fix MAX_STACK_ENTRIES from 100 to 32 wardenjohn
2023-07-09  8:07 ` Bagas Sanjaya
2023-07-09 13:09   ` wardenjohn
2023-07-10 17:13     ` Josh Poimboeuf
2023-07-12 14:48       ` wardenjohn

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox