Commit 4b290aae authored by Linus Torvalds's avatar Linus Torvalds
Browse files
Pull sysctl updates from Joel Granados:

 - Move sysctls out of the kern_table array

   This is the final move of ctl_tables into their respective
   subsystems. Only 5 (out of the original 50) will remain in
   kernel/sysctl.c file; these handle either sysctl or common arch
   variables.

   By decentralizing sysctl registrations, subsystem maintainers regain
   control over their sysctl interfaces, improving maintainability and
   reducing the likelihood of merge conflicts.

 - docs: Remove false positives from check-sysctl-docs

   Stopped falsely identifying sysctls as undocumented or unimplemented
   in the check-sysctl-docs script. This script can now be used to
   automatically identify if documentation is missing.

* tag 'sysctl-6.17-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/sysctl/sysctl: (23 commits)
  docs: Downgrade arm64 & riscv from titles to comment
  docs: Replace spaces with tabs in check-sysctl-docs
  docs: Remove colon from ctltable title in vm.rst
  docs: Add awk section for ucount sysctl entries
  docs: Use skiplist when checking sysctl admin-guide
  docs: nixify check-sysctl-docs
  sysctl: rename kern_table -> sysctl_subsys_table
  kernel/sys.c: Move overflow{uid,gid} sysctl into kernel/sys.c
  uevent: mv uevent_helper into kobject_uevent.c
  sysctl: Removed unused variable
  sysctl: Nixify sysctl.sh
  sysctl: Remove superfluous includes from kernel/sysctl.c
  sysctl: Remove (very) old file changelog
  sysctl: Move sysctl_panic_on_stackoverflow to kernel/panic.c
  sysctl: move cad_pid into kernel/pid.c
  sysctl: Move tainted ctl_table into kernel/panic.c
  Input: sysrq: mv sysrq into drivers/tty/sysrq.c
  fork: mv threads-max into kernel/fork.c
  parisc/power: Move soft-power into power.c
  mm: move randomize_va_space into memory.c
  ...
parents a26321ee ffc137c5
Loading
Loading
Loading
Loading
+14 −18
Original line number Diff line number Diff line
@@ -1014,9 +1014,7 @@ perf_user_access (arm64 and riscv only)

Controls user space access for reading perf event counters.

arm64
=====

* for arm64
  The default value is 0 (access disabled).

  When set to 1, user space can read performance monitor counter registers
@@ -1024,9 +1022,7 @@ directly.

  See Documentation/arch/arm64/perf.rst for more information.

riscv
=====

* for riscv
  When set to 0, user space access is disabled.

  The default value is 1, user space can read performance monitor counter
+4 −4
Original line number Diff line number Diff line
@@ -465,8 +465,8 @@ The minimum value is 1 (1/1 -> 100%). The value less than 1 completely
disables protection of the pages.


max_map_count:
==============
max_map_count
=============

This file contains the maximum number of memory map areas a process
may have. Memory map areas are used as a side-effect of calling
@@ -495,8 +495,8 @@ memory allocations.
The default value depends on CONFIG_MEM_ALLOC_PROFILING_ENABLED_BY_DEFAULT.


memory_failure_early_kill:
==========================
memory_failure_early_kill
=========================

Control how to kill processes when uncorrected memory error (typically
a 2bit error in a memory module) is detected in the background by hardware
+19 −1
Original line number Diff line number Diff line
@@ -83,7 +83,25 @@ static struct task_struct *power_task;
#define SYSCTL_FILENAME	"sys/kernel/power"

/* soft power switch enabled/disabled */
int pwrsw_enabled __read_mostly = 1;
static int pwrsw_enabled __read_mostly = 1;

static const struct ctl_table power_sysctl_table[] = {
	{
		.procname	= "soft-power",
		.data		= &pwrsw_enabled,
		.maxlen		= sizeof(int),
		.mode		= 0644,
		.proc_handler	= proc_dointvec,
	},
};

static int __init init_power_sysctl(void)
{
	register_sysctl_init("kernel", power_sysctl_table);
	return 0;
}

arch_initcall(init_power_sysctl);

/* main kernel thread worker. It polls the button state */
static int kpowerswd(void *param)
+41 −0
Original line number Diff line number Diff line
@@ -1120,6 +1120,47 @@ int sysrq_toggle_support(int enable_mask)
}
EXPORT_SYMBOL_GPL(sysrq_toggle_support);

static int sysrq_sysctl_handler(const struct ctl_table *table, int write,
				void *buffer, size_t *lenp, loff_t *ppos)
{
	int tmp, ret;
	struct ctl_table t = *table;

	tmp = sysrq_mask();
	t.data = &tmp;

	/*
	 * Behaves like do_proc_dointvec as t does not have min nor max.
	 */
	ret = proc_dointvec_minmax(&t, write, buffer, lenp, ppos);

	if (ret || !write)
		return ret;

	if (write)
		sysrq_toggle_support(tmp);

	return 0;
}

static const struct ctl_table sysrq_sysctl_table[] = {
	{
		.procname	= "sysrq",
		.data		= NULL,
		.maxlen		= sizeof(int),
		.mode		= 0644,
		.proc_handler	= sysrq_sysctl_handler,
	},
};

static int __init init_sysrq_sysctl(void)
{
	register_sysctl_init("kernel", sysrq_sysctl_table);
	return 0;
}

subsys_initcall(init_sysrq_sysctl);

static int __sysrq_swap_key_ops(u8 key, const struct sysrq_key_op *insert_op_p,
				const struct sysrq_key_op *remove_op_p)
{
+0 −3
Original line number Diff line number Diff line
@@ -14,10 +14,7 @@
#include <linux/workqueue.h>
#include <linux/sysctl.h>

#define KMOD_PATH_LEN 256

#ifdef CONFIG_MODULES
extern char modprobe_path[]; /* for sysctl */
/* modprobe exit status on success, -ve on error.  Return value
 * usually useless though. */
extern __printf(2, 3)
Loading