diff options
| author | Joel Granados <joel.granados@kernel.org> | 2025-12-09 12:48:27 +0100 |
|---|---|---|
| committer | Joel Granados <joel.granados@kernel.org> | 2026-01-05 13:40:33 +0100 |
| commit | b22d81fb683f22304f017b1b1674e6937bdd6d49 (patch) | |
| tree | 1d5a243e889db40f22a55b543be350e08504aaf0 | |
| parent | 486401052432f1ba1628e1eed59b3e6bfb07b5c1 (diff) | |
alloc_tag: move memory_allocation_profiling_sysctls into .rodata
Remove the change in file mode permissions done before initializing the
sysctl. It is not necessary as the writing of the kernel variable will
be blocked by the proc_mem_profiling_handler when writing is disallowed
(also controlled by mem_profiling_support).
Acked-by: Suren Baghdasaryan <surenb@google.com>
Signed-off-by: Joel Granados <joel.granados@kernel.org>
| -rw-r--r-- | lib/alloc_tag.c | 5 |
1 files changed, 1 insertions, 4 deletions
diff --git a/lib/alloc_tag.c b/lib/alloc_tag.c index 27fee57a5c91..846a5b5b44a4 100644 --- a/lib/alloc_tag.c +++ b/lib/alloc_tag.c @@ -783,7 +783,7 @@ static int proc_mem_profiling_handler(const struct ctl_table *table, int write, } -static struct ctl_table memory_allocation_profiling_sysctls[] = { +static const struct ctl_table memory_allocation_profiling_sysctls[] = { { .procname = "mem_profiling", .data = &mem_alloc_profiling_key, @@ -798,9 +798,6 @@ static struct ctl_table memory_allocation_profiling_sysctls[] = { static void __init sysctl_init(void) { - if (!mem_profiling_support) - memory_allocation_profiling_sysctls[0].mode = 0444; - register_sysctl_init("vm", memory_allocation_profiling_sysctls); } #else /* CONFIG_SYSCTL */ |
