sysctl.c 76.1 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>
Linus Torvalds's avatar
Linus Torvalds committed
30
#include <linux/smp_lock.h>
31
#include <linux/fs.h>
Linus Torvalds's avatar
Linus Torvalds committed
32 33
#include <linux/init.h>
#include <linux/kernel.h>
34
#include <linux/kobject.h>
35
#include <linux/net.h>
Linus Torvalds's avatar
Linus Torvalds committed
36 37 38
#include <linux/sysrq.h>
#include <linux/highuid.h>
#include <linux/writeback.h>
39
#include <linux/ratelimit.h>
Linus Torvalds's avatar
Linus Torvalds committed
40 41
#include <linux/hugetlb.h>
#include <linux/initrd.h>
42
#include <linux/key.h>
Linus Torvalds's avatar
Linus Torvalds committed
43 44 45 46
#include <linux/times.h>
#include <linux/limits.h>
#include <linux/dcache.h>
#include <linux/syscalls.h>
Adrian Bunk's avatar
Adrian Bunk committed
47
#include <linux/vmstat.h>
48 49
#include <linux/nfs_fs.h>
#include <linux/acpi.h>
50
#include <linux/reboot.h>
51
#include <linux/ftrace.h>
52
#include <linux/slow-work.h>
53
#include <linux/perf_event.h>
Linus Torvalds's avatar
Linus Torvalds committed
54 55 56 57

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

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

64 65
static int deprecated_sysctl_warning(struct __sysctl_args *args);

Linus Torvalds's avatar
Linus Torvalds committed
66 67 68 69
#if defined(CONFIG_SYSCTL)

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

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

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

114 115 116
/* 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
117 118 119
/* this is needed for the proc_dointvec_minmax for [fs_]overflow UID and GID */
static int maxolduid = 65535;
static int minolduid;
120
static int min_percpu_pagelist_fract = 8;
Linus Torvalds's avatar
Linus Torvalds committed
121 122 123

static int ngroups_max = NGROUPS_MAX;

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

132
#ifdef CONFIG_SPARC
133
#include <asm/system.h>
Linus Torvalds's avatar
Linus Torvalds committed
134 135
#endif

136 137 138 139
#ifdef CONFIG_SPARC64
extern int sysctl_tsb_ratio;
#endif

Linus Torvalds's avatar
Linus Torvalds committed
140 141 142 143 144
#ifdef __hppa__
extern int pwrsw_enabled;
extern int unaligned_enabled;
#endif

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

#ifdef CONFIG_BSD_PROCESS_ACCT
extern int acct_parm[];
#endif

157 158
#ifdef CONFIG_IA64
extern int no_unaligned_warning;
159
extern int unaligned_dump_stack;
160 161
#endif

162 163
extern struct ratelimit_state printk_ratelimit_state;

Ingo Molnar's avatar
Ingo Molnar committed
164 165 166 167
#ifdef CONFIG_RT_MUTEXES
extern int max_lock_depth;
#endif

168
#ifdef CONFIG_PROC_SYSCTL
169
static int proc_do_cad_pid(struct ctl_table *table, int write,
170
		  void __user *buffer, size_t *lenp, loff_t *ppos);
171
static int proc_taint(struct ctl_table *table, int write,
172
			       void __user *buffer, size_t *lenp, loff_t *ppos);
173
#endif
174

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

189 190 191 192 193 194
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[];
195
#ifdef CONFIG_INOTIFY_USER
196
extern struct ctl_table inotify_table[];
Robert Love's avatar
Robert Love committed
197
#endif
198 199 200
#ifdef CONFIG_EPOLL
extern struct ctl_table epoll_table[];
#endif
Linus Torvalds's avatar
Linus Torvalds committed
201 202 203 204 205

#ifdef HAVE_ARCH_PICK_MMAP_LAYOUT
int sysctl_legacy_va_layout;
#endif

Peter Zijlstra's avatar
Peter Zijlstra committed
206 207
extern int prove_locking;
extern int lock_stat;
208

Linus Torvalds's avatar
Linus Torvalds committed
209 210
/* The default sysctl tables: */

211
static struct ctl_table root_table[] = {
Linus Torvalds's avatar
Linus Torvalds committed
212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241
	{
		.ctl_name	= CTL_KERN,
		.procname	= "kernel",
		.mode		= 0555,
		.child		= kern_table,
	},
	{
		.ctl_name	= CTL_VM,
		.procname	= "vm",
		.mode		= 0555,
		.child		= vm_table,
	},
	{
		.ctl_name	= CTL_FS,
		.procname	= "fs",
		.mode		= 0555,
		.child		= fs_table,
	},
	{
		.ctl_name	= CTL_DEBUG,
		.procname	= "debug",
		.mode		= 0555,
		.child		= debug_table,
	},
	{
		.ctl_name	= CTL_DEV,
		.procname	= "dev",
		.mode		= 0555,
		.child		= dev_table,
	},
242 243 244 245
/*
 * NOTE: do not add new entries to this table unless you have read
 * Documentation/sysctl/ctl_unnumbered.txt
 */
Linus Torvalds's avatar
Linus Torvalds committed
246 247 248
	{ .ctl_name = 0 }
};

Ingo Molnar's avatar
Ingo Molnar committed
249
#ifdef CONFIG_SCHED_DEBUG
250 251 252 253
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 */
254 255
static int min_sched_tunable_scaling = SCHED_TUNABLESCALING_NONE;
static int max_sched_tunable_scaling = SCHED_TUNABLESCALING_END-1;
Ingo Molnar's avatar
Ingo Molnar committed
256 257
#endif

258
static struct ctl_table kern_table[] = {
259 260 261 262 263 264 265 266
	{
		.ctl_name	= CTL_UNNUMBERED,
		.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
267 268 269
#ifdef CONFIG_SCHED_DEBUG
	{
		.ctl_name	= CTL_UNNUMBERED,
270 271
		.procname	= "sched_min_granularity_ns",
		.data		= &sysctl_sched_min_granularity,
Ingo Molnar's avatar
Ingo Molnar committed
272 273
		.maxlen		= sizeof(unsigned int),
		.mode		= 0644,
274 275 276 277
		.proc_handler	= &sched_nr_latency_handler,
		.strategy	= &sysctl_intvec,
		.extra1		= &min_sched_granularity_ns,
		.extra2		= &max_sched_granularity_ns,
Ingo Molnar's avatar
Ingo Molnar committed
278
	},
279 280 281 282 283 284
	{
		.ctl_name	= CTL_UNNUMBERED,
		.procname	= "sched_latency_ns",
		.data		= &sysctl_sched_latency,
		.maxlen		= sizeof(unsigned int),
		.mode		= 0644,
285
		.proc_handler	= &sched_nr_latency_handler,
286 287 288 289
		.strategy	= &sysctl_intvec,
		.extra1		= &min_sched_granularity_ns,
		.extra2		= &max_sched_granularity_ns,
	},
Ingo Molnar's avatar
Ingo Molnar committed
290 291 292 293 294 295 296 297 298 299 300
	{
		.ctl_name	= CTL_UNNUMBERED,
		.procname	= "sched_wakeup_granularity_ns",
		.data		= &sysctl_sched_wakeup_granularity,
		.maxlen		= sizeof(unsigned int),
		.mode		= 0644,
		.proc_handler	= &proc_dointvec_minmax,
		.strategy	= &sysctl_intvec,
		.extra1		= &min_wakeup_granularity_ns,
		.extra2		= &max_wakeup_granularity_ns,
	},
301 302 303 304 305 306 307 308
	{
		.ctl_name	= CTL_UNNUMBERED,
		.procname	= "sched_shares_ratelimit",
		.data		= &sysctl_sched_shares_ratelimit,
		.maxlen		= sizeof(unsigned int),
		.mode		= 0644,
		.proc_handler	= &proc_dointvec,
	},
309 310 311 312 313 314 315 316 317 318 319 320
	{
		.ctl_name	= CTL_UNNUMBERED,
		.procname	= "sched_tunable_scaling",
		.data		= &sysctl_sched_tunable_scaling,
		.maxlen		= sizeof(enum sched_tunable_scaling),
		.mode		= 0644,
		.proc_handler	= &proc_dointvec_minmax,
		.strategy	= &sysctl_intvec,
		.extra1		= &min_sched_tunable_scaling,
		.extra2		= &max_sched_tunable_scaling,
	},

321 322 323 324 325 326 327 328 329 330
	{
		.ctl_name	= CTL_UNNUMBERED,
		.procname	= "sched_shares_thresh",
		.data		= &sysctl_sched_shares_thresh,
		.maxlen		= sizeof(unsigned int),
		.mode		= 0644,
		.proc_handler	= &proc_dointvec_minmax,
		.strategy	= &sysctl_intvec,
		.extra1		= &zero,
	},
331 332 333 334 335 336 337 338
	{
		.ctl_name	= CTL_UNNUMBERED,
		.procname	= "sched_migration_cost",
		.data		= &sysctl_sched_migration_cost,
		.maxlen		= sizeof(unsigned int),
		.mode		= 0644,
		.proc_handler	= &proc_dointvec,
	},
339 340 341 342 343
	{
		.ctl_name	= CTL_UNNUMBERED,
		.procname	= "sched_nr_migrate",
		.data		= &sysctl_sched_nr_migrate,
		.maxlen		= sizeof(unsigned int),
Peter Zijlstra's avatar
Peter Zijlstra committed
344 345 346
		.mode		= 0644,
		.proc_handler	= &proc_dointvec,
	},
347 348 349 350 351 352 353 354
	{
		.ctl_name	= CTL_UNNUMBERED,
		.procname	= "sched_time_avg",
		.data		= &sysctl_sched_time_avg,
		.maxlen		= sizeof(unsigned int),
		.mode		= 0644,
		.proc_handler	= &proc_dointvec,
	},
355 356 357 358 359 360
	{
		.ctl_name	= CTL_UNNUMBERED,
		.procname	= "timer_migration",
		.data		= &sysctl_timer_migration,
		.maxlen		= sizeof(unsigned int),
		.mode		= 0644,
361 362 363 364
		.proc_handler	= &proc_dointvec_minmax,
		.strategy	= &sysctl_intvec,
		.extra1		= &zero,
		.extra2		= &one,
Peter Zijlstra's avatar
Peter Zijlstra committed
365
	},
366
#endif
Peter Zijlstra's avatar
Peter Zijlstra committed
367 368 369 370 371 372
	{
		.ctl_name	= CTL_UNNUMBERED,
		.procname	= "sched_rt_period_us",
		.data		= &sysctl_sched_rt_period,
		.maxlen		= sizeof(unsigned int),
		.mode		= 0644,
373
		.proc_handler	= &sched_rt_handler,
Peter Zijlstra's avatar
Peter Zijlstra committed
374 375 376 377 378 379 380
	},
	{
		.ctl_name	= CTL_UNNUMBERED,
		.procname	= "sched_rt_runtime_us",
		.data		= &sysctl_sched_rt_runtime,
		.maxlen		= sizeof(int),
		.mode		= 0644,
381
		.proc_handler	= &sched_rt_handler,
Peter Zijlstra's avatar
Peter Zijlstra committed
382
	},
383 384 385 386 387 388 389 390
	{
		.ctl_name	= CTL_UNNUMBERED,
		.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
391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409
#ifdef CONFIG_PROVE_LOCKING
	{
		.ctl_name	= CTL_UNNUMBERED,
		.procname	= "prove_locking",
		.data		= &prove_locking,
		.maxlen		= sizeof(int),
		.mode		= 0644,
		.proc_handler	= &proc_dointvec,
	},
#endif
#ifdef CONFIG_LOCK_STAT
	{
		.ctl_name	= CTL_UNNUMBERED,
		.procname	= "lock_stat",
		.data		= &lock_stat,
		.maxlen		= sizeof(int),
		.mode		= 0644,
		.proc_handler	= &proc_dointvec,
	},
Ingo Molnar's avatar
Ingo Molnar committed
410
#endif
Linus Torvalds's avatar
Linus Torvalds committed
411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430
	{
		.ctl_name	= KERN_PANIC,
		.procname	= "panic",
		.data		= &panic_timeout,
		.maxlen		= sizeof(int),
		.mode		= 0644,
		.proc_handler	= &proc_dointvec,
	},
	{
		.ctl_name	= KERN_CORE_USES_PID,
		.procname	= "core_uses_pid",
		.data		= &core_uses_pid,
		.maxlen		= sizeof(int),
		.mode		= 0644,
		.proc_handler	= &proc_dointvec,
	},
	{
		.ctl_name	= KERN_CORE_PATTERN,
		.procname	= "core_pattern",
		.data		= core_pattern,
431
		.maxlen		= CORENAME_MAX_SIZE,
Linus Torvalds's avatar
Linus Torvalds committed
432 433 434 435
		.mode		= 0644,
		.proc_handler	= &proc_dostring,
		.strategy	= &sysctl_string,
	},
436 437 438 439 440 441 442 443
	{
		.ctl_name	= CTL_UNNUMBERED,
		.procname	= "core_pipe_limit",
		.data		= &core_pipe_limit,
		.maxlen		= sizeof(unsigned int),
		.mode		= 0644,
		.proc_handler	= &proc_dointvec,
	},
444
#ifdef CONFIG_PROC_SYSCTL
Linus Torvalds's avatar
Linus Torvalds committed
445 446
	{
		.procname	= "tainted",
Andi Kleen's avatar
Andi Kleen committed
447
		.maxlen 	= sizeof(long),
448
		.mode		= 0644,
Andi Kleen's avatar
Andi Kleen committed
449
		.proc_handler	= &proc_taint,
Linus Torvalds's avatar
Linus Torvalds committed
450
	},
451
#endif
Arjan van de Ven's avatar
Arjan van de Ven committed
452 453 454 455 456 457 458 459 460
#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
461 462 463 464 465 466 467 468 469 470
#ifdef CONFIG_BLK_DEV_INITRD
	{
		.ctl_name	= KERN_REALROOTDEV,
		.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
471 472 473 474 475 476 477 478
	{
		.ctl_name	= CTL_UNNUMBERED,
		.procname	= "print-fatal-signals",
		.data		= &print_fatal_signals,
		.maxlen		= sizeof(int),
		.mode		= 0644,
		.proc_handler	= &proc_dointvec,
	},
479
#ifdef CONFIG_SPARC
Linus Torvalds's avatar
Linus Torvalds committed
480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505
	{
		.ctl_name	= KERN_SPARC_REBOOT,
		.procname	= "reboot-cmd",
		.data		= reboot_command,
		.maxlen		= 256,
		.mode		= 0644,
		.proc_handler	= &proc_dostring,
		.strategy	= &sysctl_string,
	},
	{
		.ctl_name	= KERN_SPARC_STOP_A,
		.procname	= "stop-a",
		.data		= &stop_a_enabled,
		.maxlen		= sizeof (int),
		.mode		= 0644,
		.proc_handler	= &proc_dointvec,
	},
	{
		.ctl_name	= KERN_SPARC_SCONS_PWROFF,
		.procname	= "scons-poweroff",
		.data		= &scons_pwroff,
		.maxlen		= sizeof (int),
		.mode		= 0644,
		.proc_handler	= &proc_dointvec,
	},
#endif
506 507 508 509 510 511 512 513 514 515
#ifdef CONFIG_SPARC64
	{
		.ctl_name	= CTL_UNNUMBERED,
		.procname	= "tsb-ratio",
		.data		= &sysctl_tsb_ratio,
		.maxlen		= sizeof (int),
		.mode		= 0644,
		.proc_handler	= &proc_dointvec,
	},
#endif
Linus Torvalds's avatar
Linus Torvalds committed
516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541
#ifdef __hppa__
	{
		.ctl_name	= KERN_HPPA_PWRSW,
		.procname	= "soft-power",
		.data		= &pwrsw_enabled,
		.maxlen		= sizeof (int),
	 	.mode		= 0644,
		.proc_handler	= &proc_dointvec,
	},
	{
		.ctl_name	= KERN_HPPA_UNALIGNED,
		.procname	= "unaligned-trap",
		.data		= &unaligned_enabled,
		.maxlen		= sizeof (int),
		.mode		= 0644,
		.proc_handler	= &proc_dointvec,
	},
#endif
	{
		.ctl_name	= KERN_CTLALTDEL,
		.procname	= "ctrl-alt-del",
		.data		= &C_A_D,
		.maxlen		= sizeof(int),
		.mode		= 0644,
		.proc_handler	= &proc_dointvec,
	},
542
#ifdef CONFIG_FUNCTION_TRACER
543 544 545 546 547 548 549 550 551
	{
		.ctl_name	= CTL_UNNUMBERED,
		.procname	= "ftrace_enabled",
		.data		= &ftrace_enabled,
		.maxlen		= sizeof(int),
		.mode		= 0644,
		.proc_handler	= &ftrace_enable_sysctl,
	},
#endif
552 553 554 555 556 557 558 559 560 561
#ifdef CONFIG_STACK_TRACER
	{
		.ctl_name	= CTL_UNNUMBERED,
		.procname	= "stack_tracer_enabled",
		.data		= &stack_tracer_enabled,
		.maxlen		= sizeof(int),
		.mode		= 0644,
		.proc_handler	= &stack_trace_sysctl,
	},
#endif
562 563 564
#ifdef CONFIG_TRACING
	{
		.ctl_name	= CTL_UNNUMBERED,
Peter Zijlstra's avatar
Peter Zijlstra committed
565
		.procname	= "ftrace_dump_on_oops",
566 567 568 569 570 571
		.data		= &ftrace_dump_on_oops,
		.maxlen		= sizeof(int),
		.mode		= 0644,
		.proc_handler	= &proc_dointvec,
	},
#endif
572
#ifdef CONFIG_MODULES
Linus Torvalds's avatar
Linus Torvalds committed
573 574 575 576 577 578 579 580 581
	{
		.ctl_name	= KERN_MODPROBE,
		.procname	= "modprobe",
		.data		= &modprobe_path,
		.maxlen		= KMOD_PATH_LEN,
		.mode		= 0644,
		.proc_handler	= &proc_dostring,
		.strategy	= &sysctl_string,
	},
582 583 584 585 586 587 588 589 590 591 592
	{
		.ctl_name	= CTL_UNNUMBERED,
		.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
593
#endif
Andrew Morton's avatar
Andrew Morton committed
594
#if defined(CONFIG_HOTPLUG) && defined(CONFIG_NET)
Linus Torvalds's avatar
Linus Torvalds committed
595 596 597
	{
		.ctl_name	= KERN_HOTPLUG,
		.procname	= "hotplug",
598 599
		.data		= &uevent_helper,
		.maxlen		= UEVENT_HELPER_PATH_LEN,
Linus Torvalds's avatar
Linus Torvalds committed
600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628
		.mode		= 0644,
		.proc_handler	= &proc_dostring,
		.strategy	= &sysctl_string,
	},
#endif
#ifdef CONFIG_CHR_DEV_SG
	{
		.ctl_name	= KERN_SG_BIG_BUFF,
		.procname	= "sg-big-buff",
		.data		= &sg_big_buff,
		.maxlen		= sizeof (int),
		.mode		= 0444,
		.proc_handler	= &proc_dointvec,
	},
#endif
#ifdef CONFIG_BSD_PROCESS_ACCT
	{
		.ctl_name	= KERN_ACCT,
		.procname	= "acct",
		.data		= &acct_parm,
		.maxlen		= 3*sizeof(int),
		.mode		= 0644,
		.proc_handler	= &proc_dointvec,
	},
#endif
#ifdef CONFIG_MAGIC_SYSRQ
	{
		.ctl_name	= KERN_SYSRQ,
		.procname	= "sysrq",
629
		.data		= &__sysrq_enabled,
Linus Torvalds's avatar
Linus Torvalds committed
630 631 632 633 634
		.maxlen		= sizeof (int),
		.mode		= 0644,
		.proc_handler	= &proc_dointvec,
	},
#endif
635
#ifdef CONFIG_PROC_SYSCTL
Linus Torvalds's avatar
Linus Torvalds committed
636 637
	{
		.procname	= "cad_pid",
638
		.data		= NULL,
Linus Torvalds's avatar
Linus Torvalds committed
639 640
		.maxlen		= sizeof (int),
		.mode		= 0600,
641
		.proc_handler	= &proc_do_cad_pid,
Linus Torvalds's avatar
Linus Torvalds committed
642
	},
643
#endif
Linus Torvalds's avatar
Linus Torvalds committed
644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679
	{
		.ctl_name	= KERN_MAX_THREADS,
		.procname	= "threads-max",
		.data		= &max_threads,
		.maxlen		= sizeof(int),
		.mode		= 0644,
		.proc_handler	= &proc_dointvec,
	},
	{
		.ctl_name	= KERN_RANDOM,
		.procname	= "random",
		.mode		= 0555,
		.child		= random_table,
	},
	{
		.ctl_name	= KERN_OVERFLOWUID,
		.procname	= "overflowuid",
		.data		= &overflowuid,
		.maxlen		= sizeof(int),
		.mode		= 0644,
		.proc_handler	= &proc_dointvec_minmax,
		.strategy	= &sysctl_intvec,
		.extra1		= &minolduid,
		.extra2		= &maxolduid,
	},
	{
		.ctl_name	= KERN_OVERFLOWGID,
		.procname	= "overflowgid",
		.data		= &overflowgid,
		.maxlen		= sizeof(int),
		.mode		= 0644,
		.proc_handler	= &proc_dointvec_minmax,
		.strategy	= &sysctl_intvec,
		.extra1		= &minolduid,
		.extra2		= &maxolduid,
	},
680
#ifdef CONFIG_S390
Linus Torvalds's avatar
Linus Torvalds committed
681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718
#ifdef CONFIG_MATHEMU
	{
		.ctl_name	= KERN_IEEE_EMULATION_WARNINGS,
		.procname	= "ieee_emulation_warnings",
		.data		= &sysctl_ieee_emulation_warnings,
		.maxlen		= sizeof(int),
		.mode		= 0644,
		.proc_handler	= &proc_dointvec,
	},
#endif
	{
		.ctl_name	= KERN_S390_USER_DEBUG_LOGGING,
		.procname	= "userprocess_debug",
		.data		= &sysctl_userprocess_debug,
		.maxlen		= sizeof(int),
		.mode		= 0644,
		.proc_handler	= &proc_dointvec,
	},
#endif
	{
		.ctl_name	= KERN_PIDMAX,
		.procname	= "pid_max",
		.data		= &pid_max,
		.maxlen		= sizeof (int),
		.mode		= 0644,
		.proc_handler	= &proc_dointvec_minmax,
		.strategy	= sysctl_intvec,
		.extra1		= &pid_max_min,
		.extra2		= &pid_max_max,
	},
	{
		.ctl_name	= KERN_PANIC_ON_OOPS,
		.procname	= "panic_on_oops",
		.data		= &panic_on_oops,
		.maxlen		= sizeof(int),
		.mode		= 0644,
		.proc_handler	= &proc_dointvec,
	},
719 720 721 722 723 724 725 726 727
#if defined CONFIG_PRINTK
	{
		.ctl_name	= KERN_PRINTK,
		.procname	= "printk",
		.data		= &console_loglevel,
		.maxlen		= 4*sizeof(int),
		.mode		= 0644,
		.proc_handler	= &proc_dointvec,
	},
Linus Torvalds's avatar
Linus Torvalds committed
728 729 730
	{
		.ctl_name	= KERN_PRINTK_RATELIMIT,
		.procname	= "printk_ratelimit",
Dave Young's avatar
Dave Young committed
731
		.data		= &printk_ratelimit_state.interval,
Linus Torvalds's avatar
Linus Torvalds committed
732 733 734 735 736 737 738 739
		.maxlen		= sizeof(int),
		.mode		= 0644,
		.proc_handler	= &proc_dointvec_jiffies,
		.strategy	= &sysctl_jiffies,
	},
	{
		.ctl_name	= KERN_PRINTK_RATELIMIT_BURST,
		.procname	= "printk_ratelimit_burst",
Dave Young's avatar
Dave Young committed
740
		.data		= &printk_ratelimit_state.burst,
Linus Torvalds's avatar
Linus Torvalds committed
741 742 743 744
		.maxlen		= sizeof(int),
		.mode		= 0644,
		.proc_handler	= &proc_dointvec,
	},
745 746 747 748 749 750 751 752 753 754 755
	{
		.ctl_name	= CTL_UNNUMBERED,
		.procname	= "printk_delay",
		.data		= &printk_delay_msec,
		.maxlen		= sizeof(int),
		.mode		= 0644,
		.proc_handler	= &proc_dointvec_minmax,
		.strategy	= &sysctl_intvec,
		.extra1		= &zero,
		.extra2		= &ten_thousand,
	},
756
#endif
Linus Torvalds's avatar
Linus Torvalds committed
757 758 759 760 761 762 763 764 765 766 767 768 769 770 771
	{
		.ctl_name	= KERN_NGROUPS_MAX,
		.procname	= "ngroups_max",
		.data		= &ngroups_max,
		.maxlen		= sizeof (int),
		.mode		= 0444,
		.proc_handler	= &proc_dointvec,
	},
#if defined(CONFIG_X86_LOCAL_APIC) && defined(CONFIG_X86)
	{
		.ctl_name       = KERN_UNKNOWN_NMI_PANIC,
		.procname       = "unknown_nmi_panic",
		.data           = &unknown_nmi_panic,
		.maxlen         = sizeof (int),
		.mode           = 0644,
772
		.proc_handler   = &proc_dointvec,
Linus Torvalds's avatar
Linus Torvalds committed
773
	},
774 775 776 777 778 779
	{
		.procname       = "nmi_watchdog",
		.data           = &nmi_watchdog_enabled,
		.maxlen         = sizeof (int),
		.mode           = 0644,
		.proc_handler   = &proc_nmi_enabled,
Linus Torvalds's avatar
Linus Torvalds committed
780 781 782
	},
#endif
#if defined(CONFIG_X86)
783 784 785 786 787 788 789 790
	{
		.ctl_name	= KERN_PANIC_ON_NMI,
		.procname	= "panic_on_unrecovered_nmi",
		.data		= &panic_on_unrecovered_nmi,
		.maxlen		= sizeof(int),
		.mode		= 0644,
		.proc_handler	= &proc_dointvec,
	},
791 792 793 794 795 796 797 798
	{
		.ctl_name	= CTL_UNNUMBERED,
		.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
799 800 801 802 803 804 805 806
	{
		.ctl_name	= KERN_BOOTLOADER_TYPE,
		.procname	= "bootloader_type",
		.data		= &bootloader_type,
		.maxlen		= sizeof (int),
		.mode		= 0444,
		.proc_handler	= &proc_dointvec,
	},
807 808 809 810 811 812 813 814
	{
		.ctl_name	= CTL_UNNUMBERED,
		.procname	= "bootloader_version",
		.data		= &bootloader_version,
		.maxlen		= sizeof (int),
		.mode		= 0444,
		.proc_handler	= &proc_dointvec,
	},
815 816 817 818 819 820 821 822
	{
		.ctl_name	= CTL_UNNUMBERED,
		.procname	= "kstack_depth_to_print",
		.data		= &kstack_depth_to_print,
		.maxlen		= sizeof(int),
		.mode		= 0644,
		.proc_handler	= &proc_dointvec,
	},
823 824 825 826 827 828 829 830
	{
		.ctl_name	= CTL_UNNUMBERED,
		.procname	= "io_delay_type",
		.data		= &io_delay_type,
		.maxlen		= sizeof(int),
		.mode		= 0644,
		.proc_handler	= &proc_dointvec,
	},
Linus Torvalds's avatar
Linus Torvalds committed
831
#endif
832
#if defined(CONFIG_MMU)
Linus Torvalds's avatar
Linus Torvalds committed
833 834 835 836 837 838 839 840
	{
		.ctl_name	= KERN_RANDOMIZE,
		.procname	= "randomize_va_space",
		.data		= &randomize_va_space,
		.maxlen		= sizeof(int),
		.mode		= 0644,
		.proc_handler	= &proc_dointvec,
	},
841
#endif
842
#if defined(CONFIG_S390) && defined(CONFIG_SMP)
843 844 845 846 847 848 849 850
	{
		.ctl_name	= KERN_SPIN_RETRY,
		.procname	= "spin_retry",
		.data		= &spin_retry,
		.maxlen		= sizeof (int),
		.mode		= 0644,
		.proc_handler	= &proc_dointvec,
	},
851
#endif
Len Brown's avatar
Len Brown committed
852
#if	defined(CONFIG_ACPI_SLEEP) && defined(CONFIG_X86)
853 854
	{
		.procname	= "acpi_video_flags",
855
		.data		= &acpi_realmode_flags,
856 857
		.maxlen		= sizeof (unsigned long),
		.mode		= 0644,
858
		.proc_handler	= &proc_doulongvec_minmax,
859
	},
860 861 862 863 864 865 866 867 868 869
#endif
#ifdef CONFIG_IA64
	{
		.ctl_name	= KERN_IA64_UNALIGNED,
		.procname	= "ignore-unaligned-usertrap",
		.data		= &no_unaligned_warning,
		.maxlen		= sizeof (int),
	 	.mode		= 0644,
		.proc_handler	= &proc_dointvec,
	},
870 871 872 873 874 875 876 877
	{
		.ctl_name	= CTL_UNNUMBERED,
		.procname	= "unaligned-dump-stack",
		.data		= &unaligned_dump_stack,
		.maxlen		= sizeof (int),
		.mode		= 0644,
		.proc_handler	= &proc_dointvec,
	},
878
#endif
879
#ifdef CONFIG_DETECT_SOFTLOCKUP
880 881 882 883 884 885
	{
		.ctl_name	= CTL_UNNUMBERED,
		.procname	= "softlockup_panic",
		.data		= &softlockup_panic,
		.maxlen		= sizeof(int),
		.mode		= 0644,
886
		.proc_handler	= &proc_dointvec_minmax,
887 888 889 890
		.strategy	= &sysctl_intvec,
		.extra1		= &zero,
		.extra2		= &one,
	},
891 892 893 894
	{
		.ctl_name	= CTL_UNNUMBERED,
		.procname	= "softlockup_thresh",
		.data		= &softlockup_thresh,
895
		.maxlen		= sizeof(int),
896
		.mode		= 0644,
897
		.proc_handler	= &proc_dosoftlockup_thresh,
898
		.strategy	= &sysctl_intvec,
899
		.extra1		= &neg_one,
900 901
		.extra2		= &sixty,
	},
902 903 904 905 906 907 908 909 910 911 912 913 914
#endif
#ifdef CONFIG_DETECT_HUNG_TASK
	{
		.ctl_name	= CTL_UNNUMBERED,
		.procname	= "hung_task_panic",
		.data		= &sysctl_hung_task_panic,
		.maxlen		= sizeof(int),
		.mode		= 0644,
		.proc_handler	= &proc_dointvec_minmax,
		.strategy	= &sysctl_intvec,
		.extra1		= &zero,
		.extra2		= &one,
	},
915 916 917 918
	{
		.ctl_name	= CTL_UNNUMBERED,
		.procname	= "hung_task_check_count",
		.data		= &sysctl_hung_task_check_count,
Ingo Molnar's avatar
Ingo Molnar committed
919
		.maxlen		= sizeof(unsigned long),
920
		.mode		= 0644,
Ingo Molnar's avatar
Ingo Molnar committed
921
		.proc_handler	= &proc_doulongvec_minmax,
922 923 924 925 926 927
		.strategy	= &sysctl_intvec,
	},
	{
		.ctl_name	= CTL_UNNUMBERED,
		.procname	= "hung_task_timeout_secs",
		.data		= &sysctl_hung_task_timeout_secs,
Ingo Molnar's avatar
Ingo Molnar committed
928
		.maxlen		= sizeof(unsigned long),
929
		.mode		= 0644,
930
		.proc_handler	= &proc_dohung_task_timeout_secs,
931 932 933 934 935 936
		.strategy	= &sysctl_intvec,
	},
	{
		.ctl_name	= CTL_UNNUMBERED,
		.procname	= "hung_task_warnings",
		.data		= &sysctl_hung_task_warnings,
Ingo Molnar's avatar
Ingo Molnar committed
937
		.maxlen		= sizeof(unsigned long),
938
		.mode		= 0644,
Ingo Molnar's avatar
Ingo Molnar committed
939
		.proc_handler	= &proc_doulongvec_minmax,
940 941
		.strategy	= &sysctl_intvec,
	},
942
#endif
943 944 945 946 947 948 949 950 951
#ifdef CONFIG_COMPAT
	{
		.ctl_name	= KERN_COMPAT_LOG,
		.procname	= "compat-log",
		.data		= &compat_log,
		.maxlen		= sizeof (int),
	 	.mode		= 0644,
		.proc_handler	= &proc_dointvec,
	},
952
#endif
Ingo Molnar's avatar
Ingo Molnar committed
953 954 955 956 957 958 959 960 961
#ifdef CONFIG_RT_MUTEXES
	{
		.ctl_name	= KERN_MAX_LOCK_DEPTH,
		.procname	= "max_lock_depth",
		.data		= &max_lock_depth,
		.maxlen		= sizeof(int),
		.mode		= 0644,
		.proc_handler	= &proc_dointvec,
	},
Kees Cook's avatar
Kees Cook committed
962
#endif
963 964 965 966 967 968 969 970 971
	{
		.ctl_name	= CTL_UNNUMBERED,
		.procname	= "poweroff_cmd",
		.data		= &poweroff_cmd,
		.maxlen		= POWEROFF_CMD_PATH_LEN,
		.mode		= 0644,
		.proc_handler	= &proc_dostring,
		.strategy	= &sysctl_string,
	},
972 973 974 975 976 977 978 979
#ifdef CONFIG_KEYS
	{
		.ctl_name	= CTL_UNNUMBERED,
		.procname	= "keys",
		.mode		= 0555,
		.child		= key_sysctls,
	},
#endif
980 981 982 983 984 985 986 987 988 989
#ifdef CONFIG_RCU_TORTURE_TEST
	{
		.ctl_name       = CTL_UNNUMBERED,
		.procname       = "rcutorture_runnable",
		.data           = &rcutorture_runnable,
		.maxlen         = sizeof(int),
		.mode           = 0644,
		.proc_handler   = &proc_dointvec,
	},
#endif
990 991 992 993 994 995 996 997
#ifdef CONFIG_SLOW_WORK
	{
		.ctl_name	= CTL_UNNUMBERED,
		.procname	= "slow-work",
		.mode		= 0555,
		.child		= slow_work_sysctls,
	},
#endif
998
#ifdef CONFIG_PERF_EVENTS
999 1000
	{
		.ctl_name	= CTL_UNNUMBERED,
1001 1002 1003
		.procname	= "perf_event_paranoid",
		.data		= &sysctl_perf_event_paranoid,
		.maxlen		= sizeof(sysctl_perf_event_paranoid),
1004 1005 1006
		.mode		= 0644,
		.proc_handler	= &proc_dointvec,
	},
1007 1008
	{
		.ctl_name	= CTL_UNNUMBERED,
1009 1010 1011
		.procname	= "perf_event_mlock_kb",
		.data		= &sysctl_perf_event_mlock,
		.maxlen		= sizeof(sysctl_perf_event_mlock),
1012 1013 1014
		.mode		= 0644,
		.proc_handler	= &proc_dointvec,
	},
1015 1016
	{
		.ctl_name	= CTL_UNNUMBERED,
1017 1018 1019
		.procname	= "perf_event_max_sample_rate",
		.data		= &sysctl_perf_event_sample_rate,
		.maxlen		= sizeof(sysctl_perf_event_sample_rate),
1020 1021 1022
		.mode		= 0644,
		.proc_handler	= &proc_dointvec,
	},
1023
#endif
1024 1025 1026 1027 1028 1029 1030 1031 1032 1033
#ifdef CONFIG_KMEMCHECK
	{
		.ctl_name	= CTL_UNNUMBERED,
		.procname	= "kmemcheck",
		.data		= &kmemcheck_enabled,
		.maxlen		= sizeof(int),
		.mode		= 0644,
		.proc_handler	= &proc_dointvec,
	},
#endif
1034
#ifdef CONFIG_BLOCK
1035 1036 1037 1038 1039 1040 1041 1042
	{
		.ctl_name	= CTL_UNNUMBERED,
		.procname	= "blk_iopoll",
		.data		= &blk_iopoll_enabled,
		.maxlen		= sizeof(int),
		.mode		= 0644,
		.proc_handler	= &proc_dointvec,
	},
1043
#endif
1044 1045 1046 1047
/*
 * NOTE: do not add new entries to this table unless you have read
 * Documentation/sysctl/ctl_unnumbered.txt
 */
Linus Torvalds's avatar
Linus Torvalds committed
1048 1049 1050
	{ .ctl_name = 0 }
};

1051
static struct ctl_table vm_table[] = {
Linus Torvalds's avatar
Linus Torvalds committed
1052 1053 1054 1055 1056 1057 1058 1059
	{
		.ctl_name	= VM_OVERCOMMIT_MEMORY,
		.procname	= "overcommit_memory",
		.data		= &sysctl_overcommit_memory,
		.maxlen		= sizeof(sysctl_overcommit_memory),
		.mode		= 0644,
		.proc_handler	= &proc_dointvec,
	},
1060 1061 1062 1063 1064 1065 1066 1067
	{
		.ctl_name	= VM_PANIC_ON_OOM,
		.procname	= "panic_on_oom",
		.data		= &sysctl_panic_on_oom,
		.maxlen		= sizeof(sysctl_panic_on_oom),
		.mode		= 0644,
		.proc_handler	= &proc_dointvec,
	},
1068 1069 1070 1071 1072 1073 1074 1075
	{
		.ctl_name	= CTL_UNNUMBERED,
		.procname	= "oom_kill_allocating_task",
		.data		= &sysctl_oom_kill_allocating_task,
		.maxlen		= sizeof(sysctl_oom_kill_allocating_task),
		.mode		= 0644,
		.proc_handler	= &proc_dointvec,
	},
1076 1077 1078 1079 1080 1081 1082 1083
	{
		.ctl_name	= CTL_UNNUMBERED,
		.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
1084 1085 1086 1087 1088 1089 1090 1091 1092 1093 1094 1095 1096 1097 1098 1099 1100 1101 1102 1103 1104 1105
	{
		.ctl_name	= VM_OVERCOMMIT_RATIO,
		.procname	= "overcommit_ratio",
		.data		= &sysctl_overcommit_ratio,
		.maxlen		= sizeof(sysctl_overcommit_ratio),
		.mode		= 0644,
		.proc_handler	= &proc_dointvec,
	},
	{
		.ctl_name	= VM_PAGE_CLUSTER,
		.procname	= "page-cluster", 
		.data		= &page_cluster,
		.maxlen		= sizeof(int),
		.mode		= 0644,
		.proc_handler	= &proc_dointvec,
	},
	{
		.ctl_name	= VM_DIRTY_BACKGROUND,
		.procname	= "dirty_background_ratio",
		.data		= &dirty_background_ratio,
		.maxlen		= sizeof(dirty_background_ratio),
		.mode		= 0644,
1106
		.proc_handler	= &dirty_background_ratio_handler,
Linus Torvalds's avatar
Linus Torvalds committed
1107 1108 1109 1110
		.strategy	= &sysctl_intvec,
		.extra1		= &zero,
		.extra2		= &one_hundred,
	},
1111 1112 1113 1114 1115 1116 1117 1118
	{
		.ctl_name	= CTL_UNNUMBERED,
		.procname	= "dirty_background_bytes",
		.data		= &dirty_background_bytes,
		.maxlen		= sizeof(dirty_background_bytes),
		.mode		= 0644,
		.proc_handler	= &dirty_background_bytes_handler,
		.strategy	= &sysctl_intvec,
1119
		.extra1		= &one_ul,
1120
	},
Linus Torvalds's avatar
Linus Torvalds committed
1121 1122 1123 1124 1125 1126
	{
		.ctl_name	= VM_DIRTY_RATIO,
		.procname	= "dirty_ratio",
		.data		= &vm_dirty_ratio,
		.maxlen		= sizeof(vm_dirty_ratio),
		.mode		= 0644,
1127
		.proc_handler	= &dirty_ratio_handler,
Linus Torvalds's avatar
Linus Torvalds committed
1128 1129 1130 1131
		.strategy	= &sysctl_intvec,
		.extra1		= &zero,
		.extra2		= &one_hundred,
	},
1132 1133 1134 1135 1136 1137 1138 1139
	{
		.ctl_name	= CTL_UNNUMBERED,
		.procname	= "dirty_bytes",
		.data		= &vm_dirty_bytes,
		.maxlen		= sizeof(vm_dirty_bytes),
		.mode		= 0644,
		.proc_handler	= &dirty_bytes_handler,
		.strategy	= &sysctl_intvec,
1140
		.extra1		= &dirty_bytes_min,
1141
	},
Linus Torvalds's avatar
Linus Torvalds committed
1142 1143
	{
		.procname	= "dirty_writeback_centisecs",
1144 1145
		.data		= &dirty_writeback_interval,
		.maxlen		= sizeof(dirty_writeback_interval),
Linus Torvalds's avatar
Linus Torvalds committed
1146 1147 1148 1149 1150
		.mode		= 0644,
		.proc_handler	= &dirty_writeback_centisecs_handler,
	},
	{
		.procname	= "dirty_expire_centisecs",
1151 1152
		.data		= &dirty_expire_interval,
		.maxlen		= sizeof(dirty_expire_interval),
Linus Torvalds's avatar
Linus Torvalds committed
1153
		.mode		= 0644,
1154
		.proc_handler	= &proc_dointvec,
Linus Torvalds's avatar
Linus Torvalds committed
1155 1156 1157 1158 1159 1160 1161 1162 1163 1164 1165 1166 1167 1168 1169 1170 1171 1172 1173 1174 1175 1176 1177
	},
	{
		.ctl_name	= VM_NR_PDFLUSH_THREADS,
		.procname	= "nr_pdflush_threads",
		.data		= &nr_pdflush_threads,
		.maxlen		= sizeof nr_pdflush_threads,
		.mode		= 0444 /* read-only*/,
		.proc_handler	= &proc_dointvec,
	},
	{
		.ctl_name	= VM_SWAPPINESS,
		.procname	= "swappiness",
		.data		= &vm_swappiness,
		.maxlen		= sizeof(vm_swappiness),
		.mode		= 0644,
		.proc_handler	= &proc_dointvec_minmax,
		.strategy	= &sysctl_intvec,
		.extra1		= &zero,
		.extra2		= &one_hundred,
	},
#ifdef CONFIG_HUGETLB_PAGE
	 {
		.procname	= "nr_hugepages",
1178
		.data		= NULL,
Linus Torvalds's avatar
Linus Torvalds committed
1179 1180 1181 1182 1183 1184 1185 1186 1187 1188 1189 1190 1191 1192
		.maxlen		= sizeof(unsigned long),
		.mode		= 0644,
		.proc_handler	= &hugetlb_sysctl_handler,
		.extra1		= (void *)&hugetlb_zero,
		.extra2		= (void *)&hugetlb_infinity,
	 },
	 {
		.ctl_name	= VM_HUGETLB_GROUP,
		.procname	= "hugetlb_shm_group",
		.data		= &sysctl_hugetlb_shm_group,
		.maxlen		= sizeof(gid_t),
		.mode		= 0644,
		.proc_handler	= &proc_dointvec,
	 },
1193 1194 1195 1196 1197 1198 1199 1200
	 {
		.ctl_name	= CTL_UNNUMBERED,
		.procname	= "hugepages_treat_as_movable",
		.data		= &hugepages_treat_as_movable,
		.maxlen		= sizeof(int),
		.mode		= 0644,
		.proc_handler	= &hugetlb_treat_movable_handler,
	},
1201 1202 1203
	{
		.ctl_name	= CTL_UNNUMBERED,
		.procname	= "nr_overcommit_hugepages",
1204 1205
		.data		= NULL,
		.maxlen		= sizeof(unsigned long),
1206
		.mode		= 0644,
1207
		.proc_handler	= &hugetlb_overcommit_handler,
1208 1209
		.extra1		= (void *)&hugetlb_zero,
		.extra2		= (void *)&hugetlb_infinity,
1210
	},
Linus Torvalds's avatar
Linus Torvalds committed
1211 1212 1213 1214 1215 1216 1217 1218 1219 1220
#endif
	{
		.ctl_name	= VM_LOWMEM_RESERVE_RATIO,
		.procname	= "lowmem_reserve_ratio",
		.data		= &sysctl_lowmem_reserve_ratio,
		.maxlen		= sizeof(sysctl_lowmem_reserve_ratio),
		.mode		= 0644,
		.proc_handler	= &lowmem_reserve_ratio_sysctl_handler,
		.strategy	= &sysctl_intvec,
	},
Andrew Morton's avatar
Andrew Morton committed
1221