Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

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>

authored by

Joel Granados and committed by
Andrew Morton
2a912d44 817383b3

+1 -4
+1 -4
lib/alloc_tag.c
··· 783 783 } 784 784 785 785 786 - static struct ctl_table memory_allocation_profiling_sysctls[] = { 786 + static const struct ctl_table memory_allocation_profiling_sysctls[] = { 787 787 { 788 788 .procname = "mem_profiling", 789 789 .data = &mem_alloc_profiling_key, ··· 798 798 799 799 static void __init sysctl_init(void) 800 800 { 801 - if (!mem_profiling_support) 802 - memory_allocation_profiling_sysctls[0].mode = 0444; 803 - 804 801 register_sysctl_init("vm", memory_allocation_profiling_sysctls); 805 802 } 806 803 #else /* CONFIG_SYSCTL */