* [PATCH] fgraph: Separate size of ret_stack from PAGE_SIZE
@ 2024-10-19 19:29 Steven Rostedt
2024-10-21 8:01 ` Ryan Roberts
2024-10-21 14:58 ` Masami Hiramatsu
0 siblings, 2 replies; 3+ messages in thread
From: Steven Rostedt @ 2024-10-19 19:29 UTC (permalink / raw)
To: LKML, Linux trace kernel
Cc: Masami Hiramatsu, Mark Rutland, Mathieu Desnoyers, Ryan Roberts
From: Steven Rostedt <rostedt@goodmis.org>
The ret_stack (shadow stack used by function graph infrastructure) is
currently defined as PAGE_SIZE. But some architectures which have 64K
PAGE_SIZE, this is way overkill. Also there's an effort to allow the
PAGE_SIZE to be defined at boot up.
Hard code it for now to 4096. In the future, this size may change and even
be dependent on specific architectures.
Link: https://lore.kernel.org/all/e5067bb8-0fcd-4739-9bca-0e872037d5a1@arm.com/
Suggested-by: Ryan Roberts <ryan.roberts@arm.com>
Signed-off-by: Steven Rostedt (Google) <rostedt@goodmis.org>
---
kernel/trace/fgraph.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/kernel/trace/fgraph.c b/kernel/trace/fgraph.c
index ee829d65f301..51e81b299a0d 100644
--- a/kernel/trace/fgraph.c
+++ b/kernel/trace/fgraph.c
@@ -153,7 +153,7 @@ enum {
* SHADOW_STACK_OFFSET: The size in long words of the shadow stack
* SHADOW_STACK_MAX_OFFSET: The max offset of the stack for a new frame to be added
*/
-#define SHADOW_STACK_SIZE (PAGE_SIZE)
+#define SHADOW_STACK_SIZE (4096)
#define SHADOW_STACK_OFFSET (SHADOW_STACK_SIZE / sizeof(long))
/* Leave on a buffer at the end */
#define SHADOW_STACK_MAX_OFFSET \
--
2.45.2
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH] fgraph: Separate size of ret_stack from PAGE_SIZE
2024-10-19 19:29 [PATCH] fgraph: Separate size of ret_stack from PAGE_SIZE Steven Rostedt
@ 2024-10-21 8:01 ` Ryan Roberts
2024-10-21 14:58 ` Masami Hiramatsu
1 sibling, 0 replies; 3+ messages in thread
From: Ryan Roberts @ 2024-10-21 8:01 UTC (permalink / raw)
To: Steven Rostedt, LKML, Linux trace kernel
Cc: Masami Hiramatsu, Mark Rutland, Mathieu Desnoyers
On 19/10/2024 20:29, Steven Rostedt wrote:
> From: Steven Rostedt <rostedt@goodmis.org>
>
> The ret_stack (shadow stack used by function graph infrastructure) is
> currently defined as PAGE_SIZE. But some architectures which have 64K
> PAGE_SIZE, this is way overkill. Also there's an effort to allow the
> PAGE_SIZE to be defined at boot up.
>
> Hard code it for now to 4096. In the future, this size may change and even
> be dependent on specific architectures.
>
> Link: https://lore.kernel.org/all/e5067bb8-0fcd-4739-9bca-0e872037d5a1@arm.com/
>
> Suggested-by: Ryan Roberts <ryan.roberts@arm.com>
> Signed-off-by: Steven Rostedt (Google) <rostedt@goodmis.org>
LGTM!
Reviewed-by: Ryan Roberts <ryan.roberts@arm.com>
> ---
> kernel/trace/fgraph.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/kernel/trace/fgraph.c b/kernel/trace/fgraph.c
> index ee829d65f301..51e81b299a0d 100644
> --- a/kernel/trace/fgraph.c
> +++ b/kernel/trace/fgraph.c
> @@ -153,7 +153,7 @@ enum {
> * SHADOW_STACK_OFFSET: The size in long words of the shadow stack
> * SHADOW_STACK_MAX_OFFSET: The max offset of the stack for a new frame to be added
> */
> -#define SHADOW_STACK_SIZE (PAGE_SIZE)
> +#define SHADOW_STACK_SIZE (4096)
> #define SHADOW_STACK_OFFSET (SHADOW_STACK_SIZE / sizeof(long))
> /* Leave on a buffer at the end */
> #define SHADOW_STACK_MAX_OFFSET \
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] fgraph: Separate size of ret_stack from PAGE_SIZE
2024-10-19 19:29 [PATCH] fgraph: Separate size of ret_stack from PAGE_SIZE Steven Rostedt
2024-10-21 8:01 ` Ryan Roberts
@ 2024-10-21 14:58 ` Masami Hiramatsu
1 sibling, 0 replies; 3+ messages in thread
From: Masami Hiramatsu @ 2024-10-21 14:58 UTC (permalink / raw)
To: Steven Rostedt
Cc: LKML, Linux trace kernel, Masami Hiramatsu, Mark Rutland,
Mathieu Desnoyers, Ryan Roberts
On Sat, 19 Oct 2024 15:29:51 -0400
Steven Rostedt <rostedt@goodmis.org> wrote:
> From: Steven Rostedt <rostedt@goodmis.org>
>
> The ret_stack (shadow stack used by function graph infrastructure) is
> currently defined as PAGE_SIZE. But some architectures which have 64K
> PAGE_SIZE, this is way overkill. Also there's an effort to allow the
> PAGE_SIZE to be defined at boot up.
>
> Hard code it for now to 4096. In the future, this size may change and even
> be dependent on specific architectures.
>
> Link: https://lore.kernel.org/all/e5067bb8-0fcd-4739-9bca-0e872037d5a1@arm.com/
>
Looks good to me.
Acked-by: Masami Hiramatsu (Google) <mhiramat@kernel.org>
Thanks!
> Suggested-by: Ryan Roberts <ryan.roberts@arm.com>
> Signed-off-by: Steven Rostedt (Google) <rostedt@goodmis.org>
> ---
> kernel/trace/fgraph.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/kernel/trace/fgraph.c b/kernel/trace/fgraph.c
> index ee829d65f301..51e81b299a0d 100644
> --- a/kernel/trace/fgraph.c
> +++ b/kernel/trace/fgraph.c
> @@ -153,7 +153,7 @@ enum {
> * SHADOW_STACK_OFFSET: The size in long words of the shadow stack
> * SHADOW_STACK_MAX_OFFSET: The max offset of the stack for a new frame to be added
> */
> -#define SHADOW_STACK_SIZE (PAGE_SIZE)
> +#define SHADOW_STACK_SIZE (4096)
> #define SHADOW_STACK_OFFSET (SHADOW_STACK_SIZE / sizeof(long))
> /* Leave on a buffer at the end */
> #define SHADOW_STACK_MAX_OFFSET \
> --
> 2.45.2
>
--
Masami Hiramatsu (Google) <mhiramat@kernel.org>
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2024-10-21 14:58 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-10-19 19:29 [PATCH] fgraph: Separate size of ret_stack from PAGE_SIZE Steven Rostedt
2024-10-21 8:01 ` Ryan Roberts
2024-10-21 14:58 ` Masami Hiramatsu
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox