diff options
Diffstat (limited to 'kernel/sysctl.c')
-rw-r--r-- | kernel/sysctl.c | 29 |
1 files changed, 14 insertions, 15 deletions
diff --git a/kernel/sysctl.c b/kernel/sysctl.c index bc86bb32e126..51054fea5d99 100644 --- a/kernel/sysctl.c +++ b/kernel/sysctl.c | |||
@@ -170,7 +170,8 @@ static int proc_taint(struct ctl_table *table, int write, | |||
170 | #endif | 170 | #endif |
171 | 171 | ||
172 | #ifdef CONFIG_MAGIC_SYSRQ | 172 | #ifdef CONFIG_MAGIC_SYSRQ |
173 | static int __sysrq_enabled; /* Note: sysrq code ises it's own private copy */ | 173 | /* Note: sysrq code uses it's own private copy */ |
174 | static int __sysrq_enabled = SYSRQ_DEFAULT_ENABLE; | ||
174 | 175 | ||
175 | static int sysrq_sysctl_handler(ctl_table *table, int write, | 176 | static int sysrq_sysctl_handler(ctl_table *table, int write, |
176 | void __user *buffer, size_t *lenp, | 177 | void __user *buffer, size_t *lenp, |
@@ -193,9 +194,9 @@ static int sysrq_sysctl_handler(ctl_table *table, int write, | |||
193 | static struct ctl_table root_table[]; | 194 | static struct ctl_table root_table[]; |
194 | static struct ctl_table_root sysctl_table_root; | 195 | static struct ctl_table_root sysctl_table_root; |
195 | static struct ctl_table_header root_table_header = { | 196 | static struct ctl_table_header root_table_header = { |
196 | .count = 1, | 197 | {{.count = 1, |
197 | .ctl_table = root_table, | 198 | .ctl_table = root_table, |
198 | .ctl_entry = LIST_HEAD_INIT(sysctl_table_root.default_set.list), | 199 | .ctl_entry = LIST_HEAD_INIT(sysctl_table_root.default_set.list),}}, |
199 | .root = &sysctl_table_root, | 200 | .root = &sysctl_table_root, |
200 | .set = &sysctl_table_root.default_set, | 201 | .set = &sysctl_table_root.default_set, |
201 | }; | 202 | }; |
@@ -360,20 +361,13 @@ static struct ctl_table kern_table[] = { | |||
360 | .mode = 0644, | 361 | .mode = 0644, |
361 | .proc_handler = sched_rt_handler, | 362 | .proc_handler = sched_rt_handler, |
362 | }, | 363 | }, |
363 | { | ||
364 | .procname = "sched_compat_yield", | ||
365 | .data = &sysctl_sched_compat_yield, | ||
366 | .maxlen = sizeof(unsigned int), | ||
367 | .mode = 0644, | ||
368 | .proc_handler = proc_dointvec, | ||
369 | }, | ||
370 | #ifdef CONFIG_SCHED_AUTOGROUP | 364 | #ifdef CONFIG_SCHED_AUTOGROUP |
371 | { | 365 | { |
372 | .procname = "sched_autogroup_enabled", | 366 | .procname = "sched_autogroup_enabled", |
373 | .data = &sysctl_sched_autogroup_enabled, | 367 | .data = &sysctl_sched_autogroup_enabled, |
374 | .maxlen = sizeof(unsigned int), | 368 | .maxlen = sizeof(unsigned int), |
375 | .mode = 0644, | 369 | .mode = 0644, |
376 | .proc_handler = proc_dointvec, | 370 | .proc_handler = proc_dointvec_minmax, |
377 | .extra1 = &zero, | 371 | .extra1 = &zero, |
378 | .extra2 = &one, | 372 | .extra2 = &one, |
379 | }, | 373 | }, |
@@ -947,7 +941,7 @@ static struct ctl_table kern_table[] = { | |||
947 | .data = &sysctl_perf_event_sample_rate, | 941 | .data = &sysctl_perf_event_sample_rate, |
948 | .maxlen = sizeof(sysctl_perf_event_sample_rate), | 942 | .maxlen = sizeof(sysctl_perf_event_sample_rate), |
949 | .mode = 0644, | 943 | .mode = 0644, |
950 | .proc_handler = proc_dointvec, | 944 | .proc_handler = perf_proc_update_handler, |
951 | }, | 945 | }, |
952 | #endif | 946 | #endif |
953 | #ifdef CONFIG_KMEMCHECK | 947 | #ifdef CONFIG_KMEMCHECK |
@@ -1566,11 +1560,16 @@ void sysctl_head_get(struct ctl_table_header *head) | |||
1566 | spin_unlock(&sysctl_lock); | 1560 | spin_unlock(&sysctl_lock); |
1567 | } | 1561 | } |
1568 | 1562 | ||
1563 | static void free_head(struct rcu_head *rcu) | ||
1564 | { | ||
1565 | kfree(container_of(rcu, struct ctl_table_header, rcu)); | ||
1566 | } | ||
1567 | |||
1569 | void sysctl_head_put(struct ctl_table_header *head) | 1568 | void sysctl_head_put(struct ctl_table_header *head) |
1570 | { | 1569 | { |
1571 | spin_lock(&sysctl_lock); | 1570 | spin_lock(&sysctl_lock); |
1572 | if (!--head->count) | 1571 | if (!--head->count) |
1573 | kfree(head); | 1572 | call_rcu(&head->rcu, free_head); |
1574 | spin_unlock(&sysctl_lock); | 1573 | spin_unlock(&sysctl_lock); |
1575 | } | 1574 | } |
1576 | 1575 | ||
@@ -1947,10 +1946,10 @@ void unregister_sysctl_table(struct ctl_table_header * header) | |||
1947 | start_unregistering(header); | 1946 | start_unregistering(header); |
1948 | if (!--header->parent->count) { | 1947 | if (!--header->parent->count) { |
1949 | WARN_ON(1); | 1948 | WARN_ON(1); |
1950 | kfree(header->parent); | 1949 | call_rcu(&header->parent->rcu, free_head); |
1951 | } | 1950 | } |
1952 | if (!--header->count) | 1951 | if (!--header->count) |
1953 | kfree(header); | 1952 | call_rcu(&header->rcu, free_head); |
1954 | spin_unlock(&sysctl_lock); | 1953 | spin_unlock(&sysctl_lock); |
1955 | } | 1954 | } |
1956 | 1955 | ||