# \[PATCH RFC 1/5\] dump\_stack: Make arch description buffer \_\_ro\_after\_init

- From: Nathan Lynch via B4 Relay \<devnull+nathanl.linux.ibm.com@kernel.org\>
- Date: 2024-01-18 15:25:42 
- List: linuxppc-dev
- Page: https://ratatoskr.run/linuxppc-dev/2024/01/2463722
- Thread: https://ratatoskr.run/linuxppc-dev/2024/01/2463725/t.md

```text
From: Nathan Lynch <redacted>

The static hardware description buffer is populated by arch code
during boot and should not change afterwards, so mark it
__ro_after_init.

Signed-off-by: Nathan Lynch <redacted>
---
 lib/dump_stack.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/lib/dump_stack.c b/lib/dump_stack.c
index 83471e81501a..1057f102f6f2 100644
--- a/lib/dump_stack.c
+++ b/lib/dump_stack.c
@@ -6,6 +6,7 @@
 
 #include <linux/kernel.h>
 #include <linux/buildid.h>
+#include <linux/cache.h>
 #include <linux/export.h>
 #include <linux/sched.h>
 #include <linux/sched/debug.h>
@@ -15,7 +16,7 @@
 #include <linux/utsname.h>
 #include <linux/stop_machine.h>
 
-static char dump_stack_arch_desc_str[128];
+static char dump_stack_arch_desc_str[128] __ro_after_init;
 
 /**
  * dump_stack_set_arch_desc - set arch-specific str to show with task dumps

-- 
2.43.0

```
