Skip to content

Commit b22d81f

Browse files
committed
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>
1 parent 4864010 commit b22d81f

1 file changed

Lines changed: 1 addition & 4 deletions

File tree

lib/alloc_tag.c

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -783,7 +783,7 @@ static int proc_mem_profiling_handler(const struct ctl_table *table, int write,
783783
}
784784

785785

786-
static struct ctl_table memory_allocation_profiling_sysctls[] = {
786+
static const struct ctl_table memory_allocation_profiling_sysctls[] = {
787787
{
788788
.procname = "mem_profiling",
789789
.data = &mem_alloc_profiling_key,
@@ -798,9 +798,6 @@ static struct ctl_table memory_allocation_profiling_sysctls[] = {
798798

799799
static void __init sysctl_init(void)
800800
{
801-
if (!mem_profiling_support)
802-
memory_allocation_profiling_sysctls[0].mode = 0444;
803-
804801
register_sysctl_init("vm", memory_allocation_profiling_sysctls);
805802
}
806803
#else /* CONFIG_SYSCTL */

0 commit comments

Comments
 (0)