summaryrefslogtreecommitdiff
path: root/lib/alloc_tag.c
diff options
context:
space:
mode:
authorJoel Granados <joel.granados@kernel.org>2025-12-15 16:47:37 +0100
committerAndrew Morton <akpm@linux-foundation.org>2026-01-20 19:24:31 -0800
commit2a912d440c6024148a25850c7c4066b152ec8750 (patch)
tree43af9b07e89203a908aeb996f9cfd261734029a6 /lib/alloc_tag.c
parent817383b34db1e7d2a74d2d2b51cb0eed1586253b (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). Link: https://lkml.kernel.org/r/20251215-jag-alloc_tag_const-v1-1-35ea56a1ce13@kernel.org Signed-off-by: Joel Granados <joel.granados@kernel.org> Acked-by: Suren Baghdasaryan <surenb@google.com> Cc: Kent Overstreet <kent.overstreet@linux.dev> Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Diffstat (limited to 'lib/alloc_tag.c')
-rw-r--r--lib/alloc_tag.c5
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 */