sysctl.c 60.7 KB
Newer Older
Linus Torvalds's avatar
Linus Torvalds committed
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26
/*
 * sysctl.c: General linux system control interface
 *
 * Begun 24 March 1995, Stephen Tweedie
 * Added /proc support, Dec 1995
 * Added bdflush entry and intvec min/max checking, 2/23/96, Tom Dyas.
 * Added hooks for /proc/sys/net (minor, minor patch), 96/4/1, Mike Shaver.
 * Added kernel/java-{interpreter,appletviewer}, 96/5/10, Mike Shaver.
 * Dynamic registration fixes, Stephen Tweedie.
 * Added kswapd-interval, ctrl-alt-del, printk stuff, 1/8/97, Chris Horn.
 * Made sysctl support optional via CONFIG_SYSCTL, 1/10/97, Chris
 *  Horn.
 * Added proc_doulongvec_ms_jiffies_minmax, 09/08/99, Carlos H. Bauer.
 * Added proc_doulongvec_minmax, 09/08/99, Carlos H. Bauer.
 * Changed linked lists to use list.h instead of lists.h, 02/24/00, Bill
 *  Wendling.
 * The list_for_each() macro wasn't appropriate for the sysctl loop.
 *  Removed it and replaced it with older style, 03/23/00, Bill Wendling
 */

#include <linux/module.h>
#include <linux/mm.h>
#include <linux/swap.h>
#include <linux/slab.h>
#include <linux/sysctl.h>
#include <linux/proc_fs.h>
27
#include <linux/security.h>
Linus Torvalds's avatar
Linus Torvalds committed
28
#include <linux/ctype.h>
29
#include <linux/kmemcheck.h>
30
#include <linux/fs.h>
Linus Torvalds's avatar
Linus Torvalds committed
31 32
#include <linux/init.h>
#include <linux/kernel.h>
33
#include <linux/kobject.h>
34
#include <linux/net.h>
Linus Torvalds's avatar
Linus Torvalds committed
35 36 37 38 39
#include <linux/sysrq.h>
#include <linux/highuid.h>
#include <linux/writeback.h>
#include <linux/hugetlb.h>
#include <linux/initrd.h>
40
#include <linux/key.h>
Linus Torvalds's avatar
Linus Torvalds committed
41 42 43 44
#include <linux/times.h>
#include <linux/limits.h>
#include <linux/dcache.h>
#include <linux/syscalls.h>
Adrian Bunk's avatar
Adrian Bunk committed
45
#include <linux/vmstat.h>
46 47
#include <linux/nfs_fs.h>
#include <linux/acpi.h>
48
#include <linux/reboot.h>
49
#include <linux/ftrace.h>
50
#include <linux/slow-work.h>
51
#include <linux/perf_event.h>
Linus Torvalds's avatar
Linus Torvalds committed
52 53 54 55

#include <asm/uaccess.h>
#include <asm/processor.h>

56 57
#ifdef CONFIG_X86
#include <asm/nmi.h>
58
#include <asm/stacktrace.h>
59
#include <asm/io.h>
60 61
#endif

62

Linus Torvalds's avatar
Linus Torvalds committed
63 64 65 66
#if defined(CONFIG_SYSCTL)

/* External variables not in a header file. */
extern int C_A_D;
Ingo Molnar's avatar
Ingo Molnar committed
67
extern int print_fatal_signals;
Linus Torvalds's avatar
Linus Torvalds committed
68 69
extern int sysctl_overcommit_memory;
extern int sysctl_overcommit_ratio;
70
extern int sysctl_panic_on_oom;
71
extern int sysctl_oom_kill_allocating_task;
72
extern int sysctl_oom_dump_tasks;
Linus Torvalds's avatar
Linus Torvalds committed
73 74
extern int max_threads;
extern int core_uses_pid;
Alan Cox's avatar
Alan Cox committed
75
extern int suid_dumpable;
Linus Torvalds's avatar
Linus Torvalds committed
76
extern char core_pattern[];
77
extern unsigned int core_pipe_limit;
Linus Torvalds's avatar
Linus Torvalds committed
78 79 80
extern int pid_max;
extern int min_free_kbytes;
extern int pid_max_min, pid_max_max;
Andrew Morton's avatar
Andrew Morton committed
81
extern int sysctl_drop_caches;
82
extern int percpu_pagelist_fraction;
83
extern int compat_log;
Arjan van de Ven's avatar
Arjan van de Ven committed
84
extern int latencytop_enabled;
85
extern int sysctl_nr_open_min, sysctl_nr_open_max;
86 87 88
#ifndef CONFIG_MMU
extern int sysctl_nr_trim_pages;
#endif
89 90 91
#ifdef CONFIG_RCU_TORTURE_TEST
extern int rcutorture_runnable;
#endif /* #ifdef CONFIG_RCU_TORTURE_TEST */
92
#ifdef CONFIG_BLOCK
93
extern int blk_iopoll_enabled;
94
#endif
Linus Torvalds's avatar
Linus Torvalds committed
95

96
/* Constants used for minimum and  maximum */
97
#ifdef CONFIG_DETECT_SOFTLOCKUP
98
static int sixty = 60;
99
static int neg_one = -1;
100 101 102
#endif

static int zero;
103 104
static int __maybe_unused one = 1;
static int __maybe_unused two = 2;
105
static unsigned long one_ul = 1;
106
static int one_hundred = 100;
107 108 109
#ifdef CONFIG_PRINTK
static int ten_thousand = 10000;
#endif
110

111 112 113
/* this is needed for the proc_doulongvec_minmax of vm_dirty_bytes */
static unsigned long dirty_bytes_min = 2 * PAGE_SIZE;

Linus Torvalds's avatar
Linus Torvalds committed
114 115 116
/* this is needed for the proc_dointvec_minmax for [fs_]overflow UID and GID */
static int maxolduid = 65535;
static int minolduid;
117
static int min_percpu_pagelist_fract = 8;
Linus Torvalds's avatar
Linus Torvalds committed
118 119 120

static int ngroups_max = NGROUPS_MAX;

121
#ifdef CONFIG_MODULES
Linus Torvalds's avatar
Linus Torvalds committed
122
extern char modprobe_path[];
123
extern int modules_disabled;
Linus Torvalds's avatar
Linus Torvalds committed
124 125 126 127 128
#endif
#ifdef CONFIG_CHR_DEV_SG
extern int sg_big_buff;
#endif

129
#ifdef CONFIG_SPARC
130
#include <asm/system.h>
Linus Torvalds's avatar
Linus Torvalds committed
131 132
#endif

133 134 135 136
#ifdef CONFIG_SPARC64
extern int sysctl_tsb_ratio;
#endif

Linus Torvalds's avatar
Linus Torvalds committed
137 138 139 140 141
#ifdef __hppa__
extern int pwrsw_enabled;
extern int unaligned_enabled;
#endif

142
#ifdef CONFIG_S390
Linus Torvalds's avatar
Linus Torvalds committed
143 144 145 146
#ifdef CONFIG_MATHEMU
extern int sysctl_ieee_emulation_warnings;
#endif
extern int sysctl_userprocess_debug;
147
extern int spin_retry;
Linus Torvalds's avatar
Linus Torvalds committed
148 149 150 151 152 153
#endif

#ifdef CONFIG_BSD_PROCESS_ACCT
extern int acct_parm[];
#endif

154 155
#ifdef CONFIG_IA64
extern int no_unaligned_warning;
156
extern int unaligned_dump_stack;
157 158
#endif

Ingo Molnar's avatar
Ingo Molnar committed
159 160 161 162
#ifdef CONFIG_RT_MUTEXES
extern int max_lock_depth;
#endif

163
#ifdef CONFIG_PROC_SYSCTL
164
static int proc_do_cad_pid(struct ctl_table *table, int write,
165
		  void __user *buffer, size_t *lenp, loff_t *ppos);
166
static int proc_taint(struct ctl_table *table, int write,
167
			       void __user *buffer, size_t *lenp, loff_t *ppos);
168
#endif
169

170
static struct ctl_table root_table[];
171 172
static struct ctl_table_root sysctl_table_root;
static struct ctl_table_header root_table_header = {
173
	.count = 1,
174
	.ctl_table = root_table,
175
	.ctl_entry = LIST_HEAD_INIT(sysctl_table_root.default_set.list),
176
	.root = &sysctl_table_root,
177
	.set = &sysctl_table_root.default_set,
178 179 180
};
static struct ctl_table_root sysctl_table_root = {
	.root_list = LIST_HEAD_INIT(sysctl_table_root.root_list),
181
	.default_set.list = LIST_HEAD_INIT(root_table_header.ctl_entry),
182
};
Linus Torvalds's avatar
Linus Torvalds committed
183

184 185 186 187 188 189
static struct ctl_table kern_table[];
static struct ctl_table vm_table[];
static struct ctl_table fs_table[];
static struct ctl_table debug_table[];
static struct ctl_table dev_table[];
extern struct ctl_table random_table[];
190
#ifdef CONFIG_INOTIFY_USER
191
extern struct ctl_table inotify_table[];
Robert Love's avatar
Robert Love committed
192
#endif
193 194 195
#ifdef CONFIG_EPOLL
extern struct ctl_table epoll_table[];
#endif
Linus Torvalds's avatar
Linus Torvalds committed
196 197 198 199 200

#ifdef HAVE_ARCH_PICK_MMAP_LAYOUT
int sysctl_legacy_va_layout;
#endif

Peter Zijlstra's avatar
Peter Zijlstra committed
201 202
extern int prove_locking;
extern int lock_stat;
203

Linus Torvalds's avatar
Linus Torvalds committed
204 205
/* The default sysctl tables: */

206
static struct ctl_table root_table[] = {
Linus Torvalds's avatar
Linus Torvalds committed
207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231
	{
		.procname	= "kernel",
		.mode		= 0555,
		.child		= kern_table,
	},
	{
		.procname	= "vm",
		.mode		= 0555,
		.child		= vm_table,
	},
	{
		.procname	= "fs",
		.mode		= 0555,
		.child		= fs_table,
	},
	{
		.procname	= "debug",
		.mode		= 0555,
		.child		= debug_table,
	},
	{
		.procname	= "dev",
		.mode		= 0555,
		.child		= dev_table,
	},
232 233 234 235
/*
 * NOTE: do not add new entries to this table unless you have read
 * Documentation/sysctl/ctl_unnumbered.txt
 */
236
	{ }
Linus Torvalds's avatar
Linus Torvalds committed
237 238
};

Ingo Molnar's avatar
Ingo Molnar committed
239
#ifdef CONFIG_SCHED_DEBUG
240 241 242 243
static int min_sched_granularity_ns = 100000;		/* 100 usecs */
static int max_sched_granularity_ns = NSEC_PER_SEC;	/* 1 second */
static int min_wakeup_granularity_ns;			/* 0 usecs */
static int max_wakeup_granularity_ns = NSEC_PER_SEC;	/* 1 second */
Ingo Molnar's avatar
Ingo Molnar committed
244 245
#endif

246
static struct ctl_table kern_table[] = {
247 248 249 250 251 252 253
	{
		.procname	= "sched_child_runs_first",
		.data		= &sysctl_sched_child_runs_first,
		.maxlen		= sizeof(unsigned int),
		.mode		= 0644,
		.proc_handler	= &proc_dointvec,
	},
Ingo Molnar's avatar
Ingo Molnar committed
254 255
#ifdef CONFIG_SCHED_DEBUG
	{
256 257
		.procname	= "sched_min_granularity_ns",
		.data		= &sysctl_sched_min_granularity,
Ingo Molnar's avatar
Ingo Molnar committed
258 259
		.maxlen		= sizeof(unsigned int),
		.mode		= 0644,
260 261 262
		.proc_handler	= &sched_nr_latency_handler,
		.extra1		= &min_sched_granularity_ns,
		.extra2		= &max_sched_granularity_ns,
Ingo Molnar's avatar
Ingo Molnar committed
263
	},
264 265 266 267 268
	{
		.procname	= "sched_latency_ns",
		.data		= &sysctl_sched_latency,
		.maxlen		= sizeof(unsigned int),
		.mode		= 0644,
269
		.proc_handler	= &sched_nr_latency_handler,
270 271 272
		.extra1		= &min_sched_granularity_ns,
		.extra2		= &max_sched_granularity_ns,
	},
Ingo Molnar's avatar
Ingo Molnar committed
273 274 275 276 277 278 279 280 281
	{
		.procname	= "sched_wakeup_granularity_ns",
		.data		= &sysctl_sched_wakeup_granularity,
		.maxlen		= sizeof(unsigned int),
		.mode		= 0644,
		.proc_handler	= &proc_dointvec_minmax,
		.extra1		= &min_wakeup_granularity_ns,
		.extra2		= &max_wakeup_granularity_ns,
	},
282 283 284 285 286 287 288
	{
		.procname	= "sched_shares_ratelimit",
		.data		= &sysctl_sched_shares_ratelimit,
		.maxlen		= sizeof(unsigned int),
		.mode		= 0644,
		.proc_handler	= &proc_dointvec,
	},
289 290 291 292 293 294 295 296
	{
		.procname	= "sched_shares_thresh",
		.data		= &sysctl_sched_shares_thresh,
		.maxlen		= sizeof(unsigned int),
		.mode		= 0644,
		.proc_handler	= &proc_dointvec_minmax,
		.extra1		= &zero,
	},
297 298 299 300 301 302 303
	{
		.procname	= "sched_features",
		.data		= &sysctl_sched_features,
		.maxlen		= sizeof(unsigned int),
		.mode		= 0644,
		.proc_handler	= &proc_dointvec,
	},
304 305 306 307 308 309 310
	{
		.procname	= "sched_migration_cost",
		.data		= &sysctl_sched_migration_cost,
		.maxlen		= sizeof(unsigned int),
		.mode		= 0644,
		.proc_handler	= &proc_dointvec,
	},
311 312 313 314
	{
		.procname	= "sched_nr_migrate",
		.data		= &sysctl_sched_nr_migrate,
		.maxlen		= sizeof(unsigned int),
Peter Zijlstra's avatar
Peter Zijlstra committed
315 316 317
		.mode		= 0644,
		.proc_handler	= &proc_dointvec,
	},
318 319 320 321 322 323 324
	{
		.procname	= "sched_time_avg",
		.data		= &sysctl_sched_time_avg,
		.maxlen		= sizeof(unsigned int),
		.mode		= 0644,
		.proc_handler	= &proc_dointvec,
	},
325 326 327 328 329
	{
		.procname	= "timer_migration",
		.data		= &sysctl_timer_migration,
		.maxlen		= sizeof(unsigned int),
		.mode		= 0644,
330 331 332
		.proc_handler	= &proc_dointvec_minmax,
		.extra1		= &zero,
		.extra2		= &one,
Peter Zijlstra's avatar
Peter Zijlstra committed
333
	},
334
#endif
Peter Zijlstra's avatar
Peter Zijlstra committed
335 336 337 338 339
	{
		.procname	= "sched_rt_period_us",
		.data		= &sysctl_sched_rt_period,
		.maxlen		= sizeof(unsigned int),
		.mode		= 0644,
340
		.proc_handler	= &sched_rt_handler,
Peter Zijlstra's avatar
Peter Zijlstra committed
341 342 343 344 345 346
	},
	{
		.procname	= "sched_rt_runtime_us",
		.data		= &sysctl_sched_rt_runtime,
		.maxlen		= sizeof(int),
		.mode		= 0644,
347
		.proc_handler	= &sched_rt_handler,
Peter Zijlstra's avatar
Peter Zijlstra committed
348
	},
349 350 351 352 353 354 355
	{
		.procname	= "sched_compat_yield",
		.data		= &sysctl_sched_compat_yield,
		.maxlen		= sizeof(unsigned int),
		.mode		= 0644,
		.proc_handler	= &proc_dointvec,
	},
Peter Zijlstra's avatar
Peter Zijlstra committed
356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372
#ifdef CONFIG_PROVE_LOCKING
	{
		.procname	= "prove_locking",
		.data		= &prove_locking,
		.maxlen		= sizeof(int),
		.mode		= 0644,
		.proc_handler	= &proc_dointvec,
	},
#endif
#ifdef CONFIG_LOCK_STAT
	{
		.procname	= "lock_stat",
		.data		= &lock_stat,
		.maxlen		= sizeof(int),
		.mode		= 0644,
		.proc_handler	= &proc_dointvec,
	},
Ingo Molnar's avatar
Ingo Molnar committed
373
#endif
Linus Torvalds's avatar
Linus Torvalds committed
374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390
	{
		.procname	= "panic",
		.data		= &panic_timeout,
		.maxlen		= sizeof(int),
		.mode		= 0644,
		.proc_handler	= &proc_dointvec,
	},
	{
		.procname	= "core_uses_pid",
		.data		= &core_uses_pid,
		.maxlen		= sizeof(int),
		.mode		= 0644,
		.proc_handler	= &proc_dointvec,
	},
	{
		.procname	= "core_pattern",
		.data		= core_pattern,
391
		.maxlen		= CORENAME_MAX_SIZE,
Linus Torvalds's avatar
Linus Torvalds committed
392 393 394
		.mode		= 0644,
		.proc_handler	= &proc_dostring,
	},
395 396 397 398 399 400 401
	{
		.procname	= "core_pipe_limit",
		.data		= &core_pipe_limit,
		.maxlen		= sizeof(unsigned int),
		.mode		= 0644,
		.proc_handler	= &proc_dointvec,
	},
402
#ifdef CONFIG_PROC_SYSCTL
Linus Torvalds's avatar
Linus Torvalds committed
403 404
	{
		.procname	= "tainted",
Andi Kleen's avatar
Andi Kleen committed
405
		.maxlen 	= sizeof(long),
406
		.mode		= 0644,
Andi Kleen's avatar
Andi Kleen committed
407
		.proc_handler	= &proc_taint,
Linus Torvalds's avatar
Linus Torvalds committed
408
	},
409
#endif
Arjan van de Ven's avatar
Arjan van de Ven committed
410 411 412 413 414 415 416 417 418
#ifdef CONFIG_LATENCYTOP
	{
		.procname	= "latencytop",
		.data		= &latencytop_enabled,
		.maxlen		= sizeof(int),
		.mode		= 0644,
		.proc_handler	= &proc_dointvec,
	},
#endif
Linus Torvalds's avatar
Linus Torvalds committed
419 420 421 422 423 424 425 426 427
#ifdef CONFIG_BLK_DEV_INITRD
	{
		.procname	= "real-root-dev",
		.data		= &real_root_dev,
		.maxlen		= sizeof(int),
		.mode		= 0644,
		.proc_handler	= &proc_dointvec,
	},
#endif
Ingo Molnar's avatar
Ingo Molnar committed
428 429 430 431 432 433 434
	{
		.procname	= "print-fatal-signals",
		.data		= &print_fatal_signals,
		.maxlen		= sizeof(int),
		.mode		= 0644,
		.proc_handler	= &proc_dointvec,
	},
435
#ifdef CONFIG_SPARC
Linus Torvalds's avatar
Linus Torvalds committed
436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457
	{
		.procname	= "reboot-cmd",
		.data		= reboot_command,
		.maxlen		= 256,
		.mode		= 0644,
		.proc_handler	= &proc_dostring,
	},
	{
		.procname	= "stop-a",
		.data		= &stop_a_enabled,
		.maxlen		= sizeof (int),
		.mode		= 0644,
		.proc_handler	= &proc_dointvec,
	},
	{
		.procname	= "scons-poweroff",
		.data		= &scons_pwroff,
		.maxlen		= sizeof (int),
		.mode		= 0644,
		.proc_handler	= &proc_dointvec,
	},
#endif
458 459 460 461 462 463 464 465 466
#ifdef CONFIG_SPARC64
	{
		.procname	= "tsb-ratio",
		.data		= &sysctl_tsb_ratio,
		.maxlen		= sizeof (int),
		.mode		= 0644,
		.proc_handler	= &proc_dointvec,
	},
#endif
Linus Torvalds's avatar
Linus Torvalds committed
467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489
#ifdef __hppa__
	{
		.procname	= "soft-power",
		.data		= &pwrsw_enabled,
		.maxlen		= sizeof (int),
	 	.mode		= 0644,
		.proc_handler	= &proc_dointvec,
	},
	{
		.procname	= "unaligned-trap",
		.data		= &unaligned_enabled,
		.maxlen		= sizeof (int),
		.mode		= 0644,
		.proc_handler	= &proc_dointvec,
	},
#endif
	{
		.procname	= "ctrl-alt-del",
		.data		= &C_A_D,
		.maxlen		= sizeof(int),
		.mode		= 0644,
		.proc_handler	= &proc_dointvec,
	},
490
#ifdef CONFIG_FUNCTION_TRACER
491 492 493 494 495 496 497 498
	{
		.procname	= "ftrace_enabled",
		.data		= &ftrace_enabled,
		.maxlen		= sizeof(int),
		.mode		= 0644,
		.proc_handler	= &ftrace_enable_sysctl,
	},
#endif
499 500 501 502 503 504 505 506 507
#ifdef CONFIG_STACK_TRACER
	{
		.procname	= "stack_tracer_enabled",
		.data		= &stack_tracer_enabled,
		.maxlen		= sizeof(int),
		.mode		= 0644,
		.proc_handler	= &stack_trace_sysctl,
	},
#endif
508 509
#ifdef CONFIG_TRACING
	{
Peter Zijlstra's avatar
Peter Zijlstra committed
510
		.procname	= "ftrace_dump_on_oops",
511 512 513 514 515 516
		.data		= &ftrace_dump_on_oops,
		.maxlen		= sizeof(int),
		.mode		= 0644,
		.proc_handler	= &proc_dointvec,
	},
#endif
517
#ifdef CONFIG_MODULES
Linus Torvalds's avatar
Linus Torvalds committed
518 519 520 521 522 523 524
	{
		.procname	= "modprobe",
		.data		= &modprobe_path,
		.maxlen		= KMOD_PATH_LEN,
		.mode		= 0644,
		.proc_handler	= &proc_dostring,
	},
525 526 527 528 529 530 531 532 533 534
	{
		.procname	= "modules_disabled",
		.data		= &modules_disabled,
		.maxlen		= sizeof(int),
		.mode		= 0644,
		/* only handle a transition from default "0" to "1" */
		.proc_handler	= &proc_dointvec_minmax,
		.extra1		= &one,
		.extra2		= &one,
	},
Linus Torvalds's avatar
Linus Torvalds committed
535
#endif
Andrew Morton's avatar
Andrew Morton committed
536
#if defined(CONFIG_HOTPLUG) && defined(CONFIG_NET)
Linus Torvalds's avatar
Linus Torvalds committed
537 538
	{
		.procname	= "hotplug",
539 540
		.data		= &uevent_helper,
		.maxlen		= UEVENT_HELPER_PATH_LEN,
Linus Torvalds's avatar
Linus Torvalds committed
541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565
		.mode		= 0644,
		.proc_handler	= &proc_dostring,
	},
#endif
#ifdef CONFIG_CHR_DEV_SG
	{
		.procname	= "sg-big-buff",
		.data		= &sg_big_buff,
		.maxlen		= sizeof (int),
		.mode		= 0444,
		.proc_handler	= &proc_dointvec,
	},
#endif
#ifdef CONFIG_BSD_PROCESS_ACCT
	{
		.procname	= "acct",
		.data		= &acct_parm,
		.maxlen		= 3*sizeof(int),
		.mode		= 0644,
		.proc_handler	= &proc_dointvec,
	},
#endif
#ifdef CONFIG_MAGIC_SYSRQ
	{
		.procname	= "sysrq",
566
		.data		= &__sysrq_enabled,
Linus Torvalds's avatar
Linus Torvalds committed
567 568 569 570 571
		.maxlen		= sizeof (int),
		.mode		= 0644,
		.proc_handler	= &proc_dointvec,
	},
#endif
572
#ifdef CONFIG_PROC_SYSCTL
Linus Torvalds's avatar
Linus Torvalds committed
573 574
	{
		.procname	= "cad_pid",
575
		.data		= NULL,
Linus Torvalds's avatar
Linus Torvalds committed
576 577
		.maxlen		= sizeof (int),
		.mode		= 0600,
578
		.proc_handler	= &proc_do_cad_pid,
Linus Torvalds's avatar
Linus Torvalds committed
579
	},
580
#endif
Linus Torvalds's avatar
Linus Torvalds committed
581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610
	{
		.procname	= "threads-max",
		.data		= &max_threads,
		.maxlen		= sizeof(int),
		.mode		= 0644,
		.proc_handler	= &proc_dointvec,
	},
	{
		.procname	= "random",
		.mode		= 0555,
		.child		= random_table,
	},
	{
		.procname	= "overflowuid",
		.data		= &overflowuid,
		.maxlen		= sizeof(int),
		.mode		= 0644,
		.proc_handler	= &proc_dointvec_minmax,
		.extra1		= &minolduid,
		.extra2		= &maxolduid,
	},
	{
		.procname	= "overflowgid",
		.data		= &overflowgid,
		.maxlen		= sizeof(int),
		.mode		= 0644,
		.proc_handler	= &proc_dointvec_minmax,
		.extra1		= &minolduid,
		.extra2		= &maxolduid,
	},
611
#ifdef CONFIG_S390
Linus Torvalds's avatar
Linus Torvalds committed
612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644
#ifdef CONFIG_MATHEMU
	{
		.procname	= "ieee_emulation_warnings",
		.data		= &sysctl_ieee_emulation_warnings,
		.maxlen		= sizeof(int),
		.mode		= 0644,
		.proc_handler	= &proc_dointvec,
	},
#endif
	{
		.procname	= "userprocess_debug",
		.data		= &sysctl_userprocess_debug,
		.maxlen		= sizeof(int),
		.mode		= 0644,
		.proc_handler	= &proc_dointvec,
	},
#endif
	{
		.procname	= "pid_max",
		.data		= &pid_max,
		.maxlen		= sizeof (int),
		.mode		= 0644,
		.proc_handler	= &proc_dointvec_minmax,
		.extra1		= &pid_max_min,
		.extra2		= &pid_max_max,
	},
	{
		.procname	= "panic_on_oops",
		.data		= &panic_on_oops,
		.maxlen		= sizeof(int),
		.mode		= 0644,
		.proc_handler	= &proc_dointvec,
	},
645 646 647 648 649 650 651 652
#if defined CONFIG_PRINTK
	{
		.procname	= "printk",
		.data		= &console_loglevel,
		.maxlen		= 4*sizeof(int),
		.mode		= 0644,
		.proc_handler	= &proc_dointvec,
	},
Linus Torvalds's avatar
Linus Torvalds committed
653 654
	{
		.procname	= "printk_ratelimit",
Dave Young's avatar
Dave Young committed
655
		.data		= &printk_ratelimit_state.interval,
Linus Torvalds's avatar
Linus Torvalds committed
656 657 658 659 660 661
		.maxlen		= sizeof(int),
		.mode		= 0644,
		.proc_handler	= &proc_dointvec_jiffies,
	},
	{
		.procname	= "printk_ratelimit_burst",
Dave Young's avatar
Dave Young committed
662
		.data		= &printk_ratelimit_state.burst,
Linus Torvalds's avatar
Linus Torvalds committed
663 664 665 666
		.maxlen		= sizeof(int),
		.mode		= 0644,
		.proc_handler	= &proc_dointvec,
	},
667 668 669 670 671 672 673 674 675
	{
		.procname	= "printk_delay",
		.data		= &printk_delay_msec,
		.maxlen		= sizeof(int),
		.mode		= 0644,
		.proc_handler	= &proc_dointvec_minmax,
		.extra1		= &zero,
		.extra2		= &ten_thousand,
	},
676
#endif
Linus Torvalds's avatar
Linus Torvalds committed
677 678 679 680 681 682 683 684 685 686 687 688 689
	{
		.procname	= "ngroups_max",
		.data		= &ngroups_max,
		.maxlen		= sizeof (int),
		.mode		= 0444,
		.proc_handler	= &proc_dointvec,
	},
#if defined(CONFIG_X86_LOCAL_APIC) && defined(CONFIG_X86)
	{
		.procname       = "unknown_nmi_panic",
		.data           = &unknown_nmi_panic,
		.maxlen         = sizeof (int),
		.mode           = 0644,
690
		.proc_handler   = &proc_dointvec,
Linus Torvalds's avatar
Linus Torvalds committed
691
	},
692 693 694 695 696 697
	{
		.procname       = "nmi_watchdog",
		.data           = &nmi_watchdog_enabled,
		.maxlen         = sizeof (int),
		.mode           = 0644,
		.proc_handler   = &proc_nmi_enabled,
Linus Torvalds's avatar
Linus Torvalds committed
698 699 700
	},
#endif
#if defined(CONFIG_X86)
701 702 703 704 705 706 707
	{
		.procname	= "panic_on_unrecovered_nmi",
		.data		= &panic_on_unrecovered_nmi,
		.maxlen		= sizeof(int),
		.mode		= 0644,
		.proc_handler	= &proc_dointvec,
	},
708 709 710 711 712 713 714
	{
		.procname	= "panic_on_io_nmi",
		.data		= &panic_on_io_nmi,
		.maxlen		= sizeof(int),
		.mode		= 0644,
		.proc_handler	= &proc_dointvec,
	},
Linus Torvalds's avatar
Linus Torvalds committed
715 716 717 718 719 720 721
	{
		.procname	= "bootloader_type",
		.data		= &bootloader_type,
		.maxlen		= sizeof (int),
		.mode		= 0444,
		.proc_handler	= &proc_dointvec,
	},
722 723 724 725 726 727 728
	{
		.procname	= "bootloader_version",
		.data		= &bootloader_version,
		.maxlen		= sizeof (int),
		.mode		= 0444,
		.proc_handler	= &proc_dointvec,
	},
729 730 731 732 733 734 735
	{
		.procname	= "kstack_depth_to_print",
		.data		= &kstack_depth_to_print,
		.maxlen		= sizeof(int),
		.mode		= 0644,
		.proc_handler	= &proc_dointvec,
	},
736 737 738 739 740 741 742
	{
		.procname	= "io_delay_type",
		.data		= &io_delay_type,
		.maxlen		= sizeof(int),
		.mode		= 0644,
		.proc_handler	= &proc_dointvec,
	},
Linus Torvalds's avatar
Linus Torvalds committed
743
#endif
744
#if defined(CONFIG_MMU)
Linus Torvalds's avatar
Linus Torvalds committed
745 746 747 748 749 750 751
	{
		.procname	= "randomize_va_space",
		.data		= &randomize_va_space,
		.maxlen		= sizeof(int),
		.mode		= 0644,
		.proc_handler	= &proc_dointvec,
	},
752
#endif
753
#if defined(CONFIG_S390) && defined(CONFIG_SMP)
754 755 756 757 758 759 760
	{
		.procname	= "spin_retry",
		.data		= &spin_retry,
		.maxlen		= sizeof (int),
		.mode		= 0644,
		.proc_handler	= &proc_dointvec,
	},
761
#endif
Len Brown's avatar
Len Brown committed
762
#if	defined(CONFIG_ACPI_SLEEP) && defined(CONFIG_X86)
763 764
	{
		.procname	= "acpi_video_flags",
765
		.data		= &acpi_realmode_flags,
766 767
		.maxlen		= sizeof (unsigned long),
		.mode		= 0644,
768
		.proc_handler	= &proc_doulongvec_minmax,
769
	},
770 771 772 773 774 775 776 777 778
#endif
#ifdef CONFIG_IA64
	{
		.procname	= "ignore-unaligned-usertrap",
		.data		= &no_unaligned_warning,
		.maxlen		= sizeof (int),
	 	.mode		= 0644,
		.proc_handler	= &proc_dointvec,
	},
779 780 781 782 783 784 785
	{
		.procname	= "unaligned-dump-stack",
		.data		= &unaligned_dump_stack,
		.maxlen		= sizeof (int),
		.mode		= 0644,
		.proc_handler	= &proc_dointvec,
	},
786
#endif
787
#ifdef CONFIG_DETECT_SOFTLOCKUP
788 789 790 791 792
	{
		.procname	= "softlockup_panic",
		.data		= &softlockup_panic,
		.maxlen		= sizeof(int),
		.mode		= 0644,
793
		.proc_handler	= &proc_dointvec_minmax,
794 795 796
		.extra1		= &zero,
		.extra2		= &one,
	},
797 798 799
	{
		.procname	= "softlockup_thresh",
		.data		= &softlockup_thresh,
800
		.maxlen		= sizeof(int),
801
		.mode		= 0644,
802
		.proc_handler	= &proc_dosoftlockup_thresh,
803
		.extra1		= &neg_one,
804 805
		.extra2		= &sixty,
	},
806 807 808 809 810 811 812 813 814 815 816
#endif
#ifdef CONFIG_DETECT_HUNG_TASK
	{
		.procname	= "hung_task_panic",
		.data		= &sysctl_hung_task_panic,
		.maxlen		= sizeof(int),
		.mode		= 0644,
		.proc_handler	= &proc_dointvec_minmax,
		.extra1		= &zero,
		.extra2		= &one,
	},
817 818 819
	{
		.procname	= "hung_task_check_count",
		.data		= &sysctl_hung_task_check_count,
Ingo Molnar's avatar
Ingo Molnar committed
820
		.maxlen		= sizeof(unsigned long),
821
		.mode		= 0644,
Ingo Molnar's avatar
Ingo Molnar committed
822
		.proc_handler	= &proc_doulongvec_minmax,
823 824 825 826
	},
	{
		.procname	= "hung_task_timeout_secs",
		.data		= &sysctl_hung_task_timeout_secs,
Ingo Molnar's avatar
Ingo Molnar committed
827
		.maxlen		= sizeof(unsigned long),
828
		.mode		= 0644,
829
		.proc_handler	= &proc_dohung_task_timeout_secs,
830 831 832 833
	},
	{
		.procname	= "hung_task_warnings",
		.data		= &sysctl_hung_task_warnings,
Ingo Molnar's avatar
Ingo Molnar committed
834
		.maxlen		= sizeof(unsigned long),
835
		.mode		= 0644,
Ingo Molnar's avatar
Ingo Molnar committed
836
		.proc_handler	= &proc_doulongvec_minmax,
837
	},
838
#endif
839 840 841 842 843 844 845 846
#ifdef CONFIG_COMPAT
	{
		.procname	= "compat-log",
		.data		= &compat_log,
		.maxlen		= sizeof (int),
	 	.mode		= 0644,
		.proc_handler	= &proc_dointvec,
	},
847
#endif
Ingo Molnar's avatar
Ingo Molnar committed
848 849 850 851 852 853 854 855
#ifdef CONFIG_RT_MUTEXES
	{
		.procname	= "max_lock_depth",
		.data		= &max_lock_depth,
		.maxlen		= sizeof(int),
		.mode		= 0644,
		.proc_handler	= &proc_dointvec,
	},
Kees Cook's avatar
Kees Cook committed
856
#endif
857 858 859 860 861 862 863
	{
		.procname	= "poweroff_cmd",
		.data		= &poweroff_cmd,
		.maxlen		= POWEROFF_CMD_PATH_LEN,
		.mode		= 0644,
		.proc_handler	= &proc_dostring,
	},
864 865 866 867 868 869 870
#ifdef CONFIG_KEYS
	{
		.procname	= "keys",
		.mode		= 0555,
		.child		= key_sysctls,
	},
#endif
871 872 873 874 875 876 877 878 879
#ifdef CONFIG_RCU_TORTURE_TEST
	{
		.procname       = "rcutorture_runnable",
		.data           = &rcutorture_runnable,
		.maxlen         = sizeof(int),
		.mode           = 0644,
		.proc_handler   = &proc_dointvec,
	},
#endif
880 881 882 883 884 885 886
#ifdef CONFIG_SLOW_WORK
	{
		.procname	= "slow-work",
		.mode		= 0555,
		.child		= slow_work_sysctls,
	},
#endif
887
#ifdef CONFIG_PERF_EVENTS
888
	{
889 890 891
		.procname	= "perf_event_paranoid",
		.data		= &sysctl_perf_event_paranoid,
		.maxlen		= sizeof(sysctl_perf_event_paranoid),
892 893 894
		.mode		= 0644,
		.proc_handler	= &proc_dointvec,
	},
895
	{
896 897 898
		.procname	= "perf_event_mlock_kb",
		.data		= &sysctl_perf_event_mlock,
		.maxlen		= sizeof(sysctl_perf_event_mlock),
899 900 901
		.mode		= 0644,
		.proc_handler	= &proc_dointvec,
	},
902
	{
903 904 905
		.procname	= "perf_event_max_sample_rate",
		.data		= &sysctl_perf_event_sample_rate,
		.maxlen		= sizeof(sysctl_perf_event_sample_rate),
906 907 908
		.mode		= 0644,
		.proc_handler	= &proc_dointvec,
	},
909
#endif
910 911 912 913 914 915 916 917 918
#ifdef CONFIG_KMEMCHECK
	{
		.procname	= "kmemcheck",
		.data		= &kmemcheck_enabled,
		.maxlen		= sizeof(int),
		.mode		= 0644,
		.proc_handler	= &proc_dointvec,
	},
#endif
919
#ifdef CONFIG_BLOCK
920 921 922 923 924 925 926
	{
		.procname	= "blk_iopoll",
		.data		= &blk_iopoll_enabled,
		.maxlen		= sizeof(int),
		.mode		= 0644,
		.proc_handler	= &proc_dointvec,
	},
927
#endif
928 929 930 931
/*
 * NOTE: do not add new entries to this table unless you have read
 * Documentation/sysctl/ctl_unnumbered.txt
 */
932
	{ }
Linus Torvalds's avatar
Linus Torvalds committed
933 934
};

935
static struct ctl_table vm_table[] = {
Linus Torvalds's avatar
Linus Torvalds committed
936 937 938 939 940 941 942
	{
		.procname	= "overcommit_memory",
		.data		= &sysctl_overcommit_memory,
		.maxlen		= sizeof(sysctl_overcommit_memory),
		.mode		= 0644,
		.proc_handler	= &proc_dointvec,
	},
943 944 945 946 947 948 949
	{
		.procname	= "panic_on_oom",
		.data		= &sysctl_panic_on_oom,
		.maxlen		= sizeof(sysctl_panic_on_oom),
		.mode		= 0644,
		.proc_handler	= &proc_dointvec,
	},
950 951 952 953 954 955 956
	{
		.procname	= "oom_kill_allocating_task",
		.data		= &sysctl_oom_kill_allocating_task,
		.maxlen		= sizeof(sysctl_oom_kill_allocating_task),
		.mode		= 0644,
		.proc_handler	= &proc_dointvec,
	},
957 958 959 960 961 962 963
	{
		.procname	= "oom_dump_tasks",
		.data		= &sysctl_oom_dump_tasks,
		.maxlen		= sizeof(sysctl_oom_dump_tasks),
		.mode		= 0644,
		.proc_handler	= &proc_dointvec,
	},
Linus Torvalds's avatar
Linus Torvalds committed
964 965 966 967 968 969 970 971 972 973 974 975 976 977 978 979 980 981 982
	{
		.procname	= "overcommit_ratio",
		.data		= &sysctl_overcommit_ratio,
		.maxlen		= sizeof(sysctl_overcommit_ratio),
		.mode		= 0644,
		.proc_handler	= &proc_dointvec,
	},
	{
		.procname	= "page-cluster", 
		.data		= &page_cluster,
		.maxlen		= sizeof(int),
		.mode		= 0644,
		.proc_handler	= &proc_dointvec,
	},
	{
		.procname	= "dirty_background_ratio",
		.data		= &dirty_background_ratio,
		.maxlen		= sizeof(dirty_background_ratio),
		.mode		= 0644,
983
		.proc_handler	= &dirty_background_ratio_handler,
Linus Torvalds's avatar
Linus Torvalds committed
984 985 986
		.extra1		= &zero,
		.extra2		= &one_hundred,
	},
987 988 989 990 991 992
	{
		.procname	= "dirty_background_bytes",
		.data		= &dirty_background_bytes,
		.maxlen		= sizeof(dirty_background_bytes),
		.mode		= 0644,
		.proc_handler	= &dirty_background_bytes_handler,
993
		.extra1		= &one_ul,
994
	},
Linus Torvalds's avatar
Linus Torvalds committed
995 996 997 998 999
	{
		.procname	= "dirty_ratio",
		.data		= &vm_dirty_ratio,
		.maxlen		= sizeof(vm_dirty_ratio),
		.mode		= 0644,
1000
		.proc_handler	= &dirty_ratio_handler,
Linus Torvalds's avatar
Linus Torvalds committed
1001 1002 1003
		.extra1		= &zero,
		.extra2		= &one_hundred,
	},
1004 1005 1006 1007 1008 1009
	{
		.procname	= "dirty_bytes",
		.data		= &vm_dirty_bytes,
		.maxlen		= sizeof(vm_dirty_bytes),
		.mode		= 0644,
		.proc_handler	= &dirty_bytes_handler,
1010
		.extra1		= &dirty_bytes_min,
1011
	},
Linus Torvalds's avatar
Linus Torvalds committed
1012 1013
	{
		.procname	= "dirty_writeback_centisecs",
1014 1015
		.data		= &dirty_writeback_interval,
		.maxlen		= sizeof(dirty_writeback_interval),
Linus Torvalds's avatar
Linus Torvalds committed
1016 1017 1018 1019 1020
		.mode		= 0644,
		.proc_handler	= &dirty_writeback_centisecs_handler,
	},
	{
		.procname	= "dirty_expire_centisecs",
1021 1022
		.data		= &dirty_expire_interval,
		.maxlen		= sizeof(dirty_expire_interval),
Linus Torvalds's avatar
Linus Torvalds committed
1023
		.mode		= 0644,
1024
		.proc_handler	= &proc_dointvec,
Linus Torvalds's avatar
Linus Torvalds committed
1025 1026 1027 1028 1029 1030 1031 1032 1033 1034 1035 1036 1037 1038 1039 1040 1041 1042 1043 1044
	},
	{
		.procname	= "nr_pdflush_threads",
		.data		= &nr_pdflush_threads,
		.maxlen		= sizeof nr_pdflush_threads,
		.mode		= 0444 /* read-only*/,
		.proc_handler	= &proc_dointvec,
	},
	{
		.procname	= "swappiness",
		.data		= &vm_swappiness,
		.maxlen		= sizeof(vm_swappiness),
		.mode		= 0644,
		.proc_handler	= &proc_dointvec_minmax,
		.extra1		= &zero,
		.extra2		= &one_hundred,
	},
#ifdef CONFIG_HUGETLB_PAGE
	 {
		.procname	= "nr_hugepages",
1045
		.data		= NULL,
Linus Torvalds's avatar
Linus Torvalds committed
1046 1047 1048 1049 1050 1051 1052 1053 1054 1055 1056 1057 1058
		.maxlen		= sizeof(unsigned long),
		.mode		= 0644,
		.proc_handler	= &hugetlb_sysctl_handler,
		.extra1		= (void *)&hugetlb_zero,
		.extra2		= (void *)&hugetlb_infinity,
	 },
	 {
		.procname	= "hugetlb_shm_group",
		.data		= &sysctl_hugetlb_shm_group,
		.maxlen		= sizeof(gid_t),
		.mode		= 0644,
		.proc_handler	= &proc_dointvec,
	 },
1059 1060 1061 1062 1063 1064 1065
	 {
		.procname	= "hugepages_treat_as_movable",
		.data		= &hugepages_treat_as_movable,
		.maxlen		= sizeof(int),
		.mode		= 0644,
		.proc_handler	= &hugetlb_treat_movable_handler,
	},
1066 1067
	{
		.procname	= "nr_overcommit_hugepages",
1068 1069
		.data		= NULL,
		.maxlen		= sizeof(unsigned long),
1070
		.mode		= 0644,
1071
		.proc_handler	= &hugetlb_overcommit_handler,
1072 1073
		.extra1		= (void *)&hugetlb_zero,
		.extra2		= (void *)&hugetlb_infinity,
1074
	},
Linus Torvalds's avatar
Linus Torvalds committed
1075 1076 1077 1078 1079 1080 1081 1082
#endif
	{
		.procname	= "lowmem_reserve_ratio",
		.data		= &sysctl_lowmem_reserve_ratio,
		.maxlen		= sizeof(sysctl_lowmem_reserve_ratio),
		.mode		= 0644,
		.proc_handler	= &lowmem_reserve_ratio_sysctl_handler,
	},
Andrew Morton's avatar
Andrew Morton committed
1083 1084 1085 1086 1087 1088 1089
	{
		.procname	= "drop_caches",
		.data		= &sysctl_drop_caches,
		.maxlen		= sizeof(int),
		.mode		= 0644,
		.proc_handler	= drop_caches_sysctl_handler,
	},
Linus Torvalds's avatar
Linus Torvalds committed
1090 1091 1092 1093 1094 1095 1096 1097
	{
		.procname	= "min_free_kbytes",
		.data		= &min_free_kbytes,
		.maxlen		= sizeof(min_free_kbytes),
		.mode		= 0644,
		.proc_handler	= &min_free_kbytes_sysctl_handler,
		.extra1		= &zero,
	},
1098 1099 1100 1101 1102 1103 1104 1105
	{
		.procname	= "percpu_pagelist_fraction",
		.data		= &percpu_pagelist_fraction,
		.maxlen		= sizeof(percpu_pagelist_fraction),
		.mode		= 0644,
		.proc_handler	= &percpu_pagelist_fraction_sysctl_handler,
		.extra1		= &min_percpu_pagelist_fract,
	},
Linus Torvalds's avatar
Linus Torvalds committed
1106 1107 1108 1109 1110 1111 1112 1113
#ifdef CONFIG_MMU
	{
		.procname	= "max_map_count",
		.data		= &sysctl_max_map_count,
		.maxlen		= sizeof(sysctl_max_map_count),
		.mode		= 0644,
		.proc_handler	= &proc_dointvec
	},
1114 1115 1116 1117 1118 1119 1120 1121 1122
#else
	{
		.procname	= "nr_trim_pages",
		.data		= &sysctl_nr_trim_pages,
		.maxlen		= sizeof(sysctl_nr_trim_pages),
		.mode		= 0644,
		.proc_handler	= &proc_dointvec_minmax,
		.extra1		= &zero,
	},
Linus Torvalds's avatar
Linus Torvalds committed
1123 1124 1125 1126 1127 1128
#endif
	{
		.procname	= "laptop_mode",
		.data		= &laptop_mode,
		.maxlen		= sizeof(laptop_mode),
		.mode		= 0644,
1129
		.proc_handler	= &proc_dointvec_jiffies,
Linus Torvalds's avatar
Linus Torvalds committed
1130 1131 1132 1133 1134 1135 1136 1137 1138 1139 1140 1141 1142 1143 1144 1145 1146 1147 1148 1149 1150 1151 1152 1153 1154 1155 1156
	},
	{
		.procname	= "block_dump",
		.data		= &block_dump,
		.maxlen		= sizeof(block_dump),
		.mode		= 0644,
		.proc_handler	= &proc_dointvec,
		.extra1		= &zero,
	},
	{
		.procname	= "vfs_cache_pressure",
		.data		= &sysctl_vfs_cache_pressure,
		.maxlen		= sizeof(sysctl_vfs_cache_pressure),
		.mode		= 0644,
		.proc_handler	= &proc_dointvec,
		.extra1		= &zero,
	},
#ifdef HAVE_ARCH_PICK_MMAP_LAYOUT
	{
		.procname	= "legacy_va_layout",
		.data		= &sysctl_legacy_va_layout,
		.maxlen		= sizeof(sysctl_legacy_va_layout),
		.mode		= 0644,
		.proc_handler	= &proc_dointvec,
		.extra1		= &zero,
	},
#endif
1157 1158 1159 1160 1161 1162 1163
#ifdef CONFIG_NUMA
	{
		.procname	= "zone_reclaim_mode",
		.data		= &zone_reclaim_mode,
		.maxlen		= sizeof(zone_reclaim_mode),
		.mode		= 0644,
		.proc_handler	= &proc_dointvec,
1164
		.extra1		= &zero,
1165
	},
1166 1167 1168 1169 1170 1171 1172 1173 1174
	{
		.procname	= "min_unmapped_ratio",
		.data		= &sysctl_min_unmapped_ratio,
		.maxlen		= sizeof(sysctl_min_unmapped_ratio),
		.mode		= 0644,
		.proc_handler	= &sysctl_min_unmapped_ratio_sysctl_handler,
		.extra1		= &zero,
		.extra2		= &one_hundred,
	},
1175 1176 1177 1178 1179 1180 1181 1182 1183
	{
		.procname	= "min_slab_ratio",
		.data		= &sysctl_min_slab_ratio,
		.maxlen		= sizeof(sysctl_min_slab_ratio),
		.mode		= 0644,
		.proc_handler	= &sysctl_min_slab_ratio_sysctl_handler,
		.extra1		= &zero,
		.extra2		= &one_hundred,
	},
1184
#endif
1185 1186 1187 1188 1189 1190 1191 1192 1193
#ifdef CONFIG_SMP
	{
		.procname	= "stat_interval",
		.data		= &sysctl_stat_interval,
		.maxlen		= sizeof(sysctl_stat_interval),
		.mode		= 0644,
		.proc_handler	= &proc_dointvec_jiffies,
	},
#endif
1194 1195
	{
		.procname	= "mmap_min_addr",
1196 1197
		.data		= &dac_mmap_min_addr,
		.maxlen		= sizeof(unsigned long),
1198
		.mode		= 0644,
1199
		.proc_handler	= &mmap_min_addr_handler,
1200
	},
1201 1202 1203 1204 1205 1206 1207 1208 1209
#ifdef CONFIG_NUMA
	{
		.procname	= "numa_zonelist_order",
		.data		= &numa_zonelist_order,
		.maxlen		= NUMA_ZONELIST_ORDER_LEN,
		.mode		= 0644,
		.proc_handler	= &numa_zonelist_order_handler,
	},
#endif
1210
#if (defined(CONFIG_X86_32) && !defined(CONFIG_UML))|| \
1211
   (defined(CONFIG_SUPERH) && defined(CONFIG_VSYSCALL))
1212 1213 1214 1215 1216 1217 1218 1219
	{
		.procname	= "vdso_enabled",
		.data		= &vdso_enabled,
		.maxlen		= sizeof(vdso_enabled),
		.mode		= 0644,
		.proc_handler	= &proc_dointvec,
		.extra1		= &zero,
	},
Linus Torvalds's avatar
Linus Torvalds committed
1220
#endif
1221 1222 1223 1224 1225 1226 1227 1228 1229 1230 1231
#ifdef CONFIG_HIGHMEM
	{
		.procname	= "highmem_is_dirtyable",
		.data		= &vm_highmem_is_dirtyable,
		.maxlen		= sizeof(vm_highmem_is_dirtyable),
		.mode		= 0644,
		.proc_handler	= &proc_dointvec_minmax,
		.extra1		= &zero,
		.extra2		= &one,
	},
#endif
1232 1233 1234 1235 1236 1237 1238
	{
		.procname	= "scan_unevictable_pages",
		.data		= &scan_unevictable_pages,
		.maxlen		= sizeof(scan_unevictable_pages),
		.mode		= 0644,
		.proc_handler	= &scan_unevictable_handler,
	},
1239 1240 1241 1242 1243 1244 1245 1246 1247 1248 1249 1250 1251 1252 1253 1254 1255 1256 1257 1258 1259
#ifdef CONFIG_MEMORY_FAILURE
	{
		.procname	= "memory_failure_early_kill",
		.data		= &sysctl_memory_failure_early_kill,
		.maxlen		= sizeof(sysctl_memory_failure_early_kill),
		.mode		= 0644,
		.proc_handler	= &proc_dointvec_minmax,
		.extra1		= &zero,
		.extra2		= &one,
	},
	{
		.procname	= "memory_failure_recovery",
		.data		= &sysctl_memory_failure_recovery,
		.maxlen		= sizeof(sysctl_memory_failure_recovery),
		.mode		= 0644,
		.proc_handler	= &proc_dointvec_minmax,
		.extra1		= &zero,
		.extra2		= &one,
	},
#endif

1260 1261 1262 1263
/*
 * NOTE: do not add new entries to this table unless you have read
 * Documentation/sysctl/ctl_unnumbered.txt
 */