diff options
Diffstat (limited to 'kernel')
-rw-r--r-- | kernel/cgroup.c | 43 | ||||
-rw-r--r-- | kernel/exit.c | 4 | ||||
-rw-r--r-- | kernel/printk.c | 17 | ||||
-rw-r--r-- | kernel/sched_fair.c | 6 | ||||
-rw-r--r-- | kernel/uid16.c | 22 |
5 files changed, 68 insertions, 24 deletions
diff --git a/kernel/cgroup.c b/kernel/cgroup.c index 53d86b4b0ce0..2727f9238359 100644 --- a/kernel/cgroup.c +++ b/kernel/cgroup.c | |||
@@ -782,7 +782,14 @@ static int parse_cgroupfs_options(char *data, | |||
782 | if (!*token) | 782 | if (!*token) |
783 | return -EINVAL; | 783 | return -EINVAL; |
784 | if (!strcmp(token, "all")) { | 784 | if (!strcmp(token, "all")) { |
785 | opts->subsys_bits = (1 << CGROUP_SUBSYS_COUNT) - 1; | 785 | /* Add all non-disabled subsystems */ |
786 | int i; | ||
787 | opts->subsys_bits = 0; | ||
788 | for (i = 0; i < CGROUP_SUBSYS_COUNT; i++) { | ||
789 | struct cgroup_subsys *ss = subsys[i]; | ||
790 | if (!ss->disabled) | ||
791 | opts->subsys_bits |= 1ul << i; | ||
792 | } | ||
786 | } else if (!strcmp(token, "noprefix")) { | 793 | } else if (!strcmp(token, "noprefix")) { |
787 | set_bit(ROOT_NOPREFIX, &opts->flags); | 794 | set_bit(ROOT_NOPREFIX, &opts->flags); |
788 | } else if (!strncmp(token, "release_agent=", 14)) { | 795 | } else if (!strncmp(token, "release_agent=", 14)) { |
@@ -800,7 +807,8 @@ static int parse_cgroupfs_options(char *data, | |||
800 | for (i = 0; i < CGROUP_SUBSYS_COUNT; i++) { | 807 | for (i = 0; i < CGROUP_SUBSYS_COUNT; i++) { |
801 | ss = subsys[i]; | 808 | ss = subsys[i]; |
802 | if (!strcmp(token, ss->name)) { | 809 | if (!strcmp(token, ss->name)) { |
803 | set_bit(i, &opts->subsys_bits); | 810 | if (!ss->disabled) |
811 | set_bit(i, &opts->subsys_bits); | ||
804 | break; | 812 | break; |
805 | } | 813 | } |
806 | } | 814 | } |
@@ -2561,6 +2569,7 @@ static int proc_cgroup_show(struct seq_file *m, void *v) | |||
2561 | /* Skip this hierarchy if it has no active subsystems */ | 2569 | /* Skip this hierarchy if it has no active subsystems */ |
2562 | if (!root->actual_subsys_bits) | 2570 | if (!root->actual_subsys_bits) |
2563 | continue; | 2571 | continue; |
2572 | seq_printf(m, "%lu:", root->subsys_bits); | ||
2564 | for_each_subsys(root, ss) | 2573 | for_each_subsys(root, ss) |
2565 | seq_printf(m, "%s%s", count++ ? "," : "", ss->name); | 2574 | seq_printf(m, "%s%s", count++ ? "," : "", ss->name); |
2566 | seq_putc(m, ':'); | 2575 | seq_putc(m, ':'); |
@@ -2600,13 +2609,13 @@ static int proc_cgroupstats_show(struct seq_file *m, void *v) | |||
2600 | { | 2609 | { |
2601 | int i; | 2610 | int i; |
2602 | 2611 | ||
2603 | seq_puts(m, "#subsys_name\thierarchy\tnum_cgroups\n"); | 2612 | seq_puts(m, "#subsys_name\thierarchy\tnum_cgroups\tenabled\n"); |
2604 | mutex_lock(&cgroup_mutex); | 2613 | mutex_lock(&cgroup_mutex); |
2605 | for (i = 0; i < CGROUP_SUBSYS_COUNT; i++) { | 2614 | for (i = 0; i < CGROUP_SUBSYS_COUNT; i++) { |
2606 | struct cgroup_subsys *ss = subsys[i]; | 2615 | struct cgroup_subsys *ss = subsys[i]; |
2607 | seq_printf(m, "%s\t%lu\t%d\n", | 2616 | seq_printf(m, "%s\t%lu\t%d\t%d\n", |
2608 | ss->name, ss->root->subsys_bits, | 2617 | ss->name, ss->root->subsys_bits, |
2609 | ss->root->number_of_cgroups); | 2618 | ss->root->number_of_cgroups, !ss->disabled); |
2610 | } | 2619 | } |
2611 | mutex_unlock(&cgroup_mutex); | 2620 | mutex_unlock(&cgroup_mutex); |
2612 | return 0; | 2621 | return 0; |
@@ -3010,3 +3019,27 @@ static void cgroup_release_agent(struct work_struct *work) | |||
3010 | spin_unlock(&release_list_lock); | 3019 | spin_unlock(&release_list_lock); |
3011 | mutex_unlock(&cgroup_mutex); | 3020 | mutex_unlock(&cgroup_mutex); |
3012 | } | 3021 | } |
3022 | |||
3023 | static int __init cgroup_disable(char *str) | ||
3024 | { | ||
3025 | int i; | ||
3026 | char *token; | ||
3027 | |||
3028 | while ((token = strsep(&str, ",")) != NULL) { | ||
3029 | if (!*token) | ||
3030 | continue; | ||
3031 | |||
3032 | for (i = 0; i < CGROUP_SUBSYS_COUNT; i++) { | ||
3033 | struct cgroup_subsys *ss = subsys[i]; | ||
3034 | |||
3035 | if (!strcmp(token, ss->name)) { | ||
3036 | ss->disabled = 1; | ||
3037 | printk(KERN_INFO "Disabling %s control group" | ||
3038 | " subsystem\n", ss->name); | ||
3039 | break; | ||
3040 | } | ||
3041 | } | ||
3042 | } | ||
3043 | return 1; | ||
3044 | } | ||
3045 | __setup("cgroup_disable=", cgroup_disable); | ||
diff --git a/kernel/exit.c b/kernel/exit.c index 53872bf993fa..073005b1cfb2 100644 --- a/kernel/exit.c +++ b/kernel/exit.c | |||
@@ -1608,7 +1608,7 @@ asmlinkage long sys_waitid(int which, pid_t upid, | |||
1608 | put_pid(pid); | 1608 | put_pid(pid); |
1609 | 1609 | ||
1610 | /* avoid REGPARM breakage on x86: */ | 1610 | /* avoid REGPARM breakage on x86: */ |
1611 | prevent_tail_call(ret); | 1611 | asmlinkage_protect(5, ret, which, upid, infop, options, ru); |
1612 | return ret; | 1612 | return ret; |
1613 | } | 1613 | } |
1614 | 1614 | ||
@@ -1640,7 +1640,7 @@ asmlinkage long sys_wait4(pid_t upid, int __user *stat_addr, | |||
1640 | put_pid(pid); | 1640 | put_pid(pid); |
1641 | 1641 | ||
1642 | /* avoid REGPARM breakage on x86: */ | 1642 | /* avoid REGPARM breakage on x86: */ |
1643 | prevent_tail_call(ret); | 1643 | asmlinkage_protect(4, ret, upid, stat_addr, options, ru); |
1644 | return ret; | 1644 | return ret; |
1645 | } | 1645 | } |
1646 | 1646 | ||
diff --git a/kernel/printk.c b/kernel/printk.c index c46a20a19a15..bdd4ea8c3f2b 100644 --- a/kernel/printk.c +++ b/kernel/printk.c | |||
@@ -643,8 +643,21 @@ static int acquire_console_semaphore_for_printk(unsigned int cpu) | |||
643 | { | 643 | { |
644 | int retval = 0; | 644 | int retval = 0; |
645 | 645 | ||
646 | if (can_use_console(cpu)) | 646 | if (!try_acquire_console_sem()) { |
647 | retval = !try_acquire_console_sem(); | 647 | retval = 1; |
648 | |||
649 | /* | ||
650 | * If we can't use the console, we need to release | ||
651 | * the console semaphore by hand to avoid flushing | ||
652 | * the buffer. We need to hold the console semaphore | ||
653 | * in order to do this test safely. | ||
654 | */ | ||
655 | if (!can_use_console(cpu)) { | ||
656 | console_locked = 0; | ||
657 | up(&console_sem); | ||
658 | retval = 0; | ||
659 | } | ||
660 | } | ||
648 | printk_cpu = UINT_MAX; | 661 | printk_cpu = UINT_MAX; |
649 | spin_unlock(&logbuf_lock); | 662 | spin_unlock(&logbuf_lock); |
650 | return retval; | 663 | return retval; |
diff --git a/kernel/sched_fair.c b/kernel/sched_fair.c index 86a93376282c..0080968d3e4a 100644 --- a/kernel/sched_fair.c +++ b/kernel/sched_fair.c | |||
@@ -510,10 +510,8 @@ place_entity(struct cfs_rq *cfs_rq, struct sched_entity *se, int initial) | |||
510 | 510 | ||
511 | if (!initial) { | 511 | if (!initial) { |
512 | /* sleeps upto a single latency don't count. */ | 512 | /* sleeps upto a single latency don't count. */ |
513 | if (sched_feat(NEW_FAIR_SLEEPERS)) { | 513 | if (sched_feat(NEW_FAIR_SLEEPERS)) |
514 | vruntime -= calc_delta_fair(sysctl_sched_latency, | 514 | vruntime -= sysctl_sched_latency; |
515 | &cfs_rq->load); | ||
516 | } | ||
517 | 515 | ||
518 | /* ensure we never gain time by being placed backwards. */ | 516 | /* ensure we never gain time by being placed backwards. */ |
519 | vruntime = max_vruntime(se->vruntime, vruntime); | 517 | vruntime = max_vruntime(se->vruntime, vruntime); |
diff --git a/kernel/uid16.c b/kernel/uid16.c index dd308ba4e03b..3e41c1673e2f 100644 --- a/kernel/uid16.c +++ b/kernel/uid16.c | |||
@@ -21,7 +21,7 @@ asmlinkage long sys_chown16(const char __user * filename, old_uid_t user, old_gi | |||
21 | { | 21 | { |
22 | long ret = sys_chown(filename, low2highuid(user), low2highgid(group)); | 22 | long ret = sys_chown(filename, low2highuid(user), low2highgid(group)); |
23 | /* avoid REGPARM breakage on x86: */ | 23 | /* avoid REGPARM breakage on x86: */ |
24 | prevent_tail_call(ret); | 24 | asmlinkage_protect(3, ret, filename, user, group); |
25 | return ret; | 25 | return ret; |
26 | } | 26 | } |
27 | 27 | ||
@@ -29,7 +29,7 @@ asmlinkage long sys_lchown16(const char __user * filename, old_uid_t user, old_g | |||
29 | { | 29 | { |
30 | long ret = sys_lchown(filename, low2highuid(user), low2highgid(group)); | 30 | long ret = sys_lchown(filename, low2highuid(user), low2highgid(group)); |
31 | /* avoid REGPARM breakage on x86: */ | 31 | /* avoid REGPARM breakage on x86: */ |
32 | prevent_tail_call(ret); | 32 | asmlinkage_protect(3, ret, filename, user, group); |
33 | return ret; | 33 | return ret; |
34 | } | 34 | } |
35 | 35 | ||
@@ -37,7 +37,7 @@ asmlinkage long sys_fchown16(unsigned int fd, old_uid_t user, old_gid_t group) | |||
37 | { | 37 | { |
38 | long ret = sys_fchown(fd, low2highuid(user), low2highgid(group)); | 38 | long ret = sys_fchown(fd, low2highuid(user), low2highgid(group)); |
39 | /* avoid REGPARM breakage on x86: */ | 39 | /* avoid REGPARM breakage on x86: */ |
40 | prevent_tail_call(ret); | 40 | asmlinkage_protect(3, ret, fd, user, group); |
41 | return ret; | 41 | return ret; |
42 | } | 42 | } |
43 | 43 | ||
@@ -45,7 +45,7 @@ asmlinkage long sys_setregid16(old_gid_t rgid, old_gid_t egid) | |||
45 | { | 45 | { |
46 | long ret = sys_setregid(low2highgid(rgid), low2highgid(egid)); | 46 | long ret = sys_setregid(low2highgid(rgid), low2highgid(egid)); |
47 | /* avoid REGPARM breakage on x86: */ | 47 | /* avoid REGPARM breakage on x86: */ |
48 | prevent_tail_call(ret); | 48 | asmlinkage_protect(2, ret, rgid, egid); |
49 | return ret; | 49 | return ret; |
50 | } | 50 | } |
51 | 51 | ||
@@ -53,7 +53,7 @@ asmlinkage long sys_setgid16(old_gid_t gid) | |||
53 | { | 53 | { |
54 | long ret = sys_setgid(low2highgid(gid)); | 54 | long ret = sys_setgid(low2highgid(gid)); |
55 | /* avoid REGPARM breakage on x86: */ | 55 | /* avoid REGPARM breakage on x86: */ |
56 | prevent_tail_call(ret); | 56 | asmlinkage_protect(1, ret, gid); |
57 | return ret; | 57 | return ret; |
58 | } | 58 | } |
59 | 59 | ||
@@ -61,7 +61,7 @@ asmlinkage long sys_setreuid16(old_uid_t ruid, old_uid_t euid) | |||
61 | { | 61 | { |
62 | long ret = sys_setreuid(low2highuid(ruid), low2highuid(euid)); | 62 | long ret = sys_setreuid(low2highuid(ruid), low2highuid(euid)); |
63 | /* avoid REGPARM breakage on x86: */ | 63 | /* avoid REGPARM breakage on x86: */ |
64 | prevent_tail_call(ret); | 64 | asmlinkage_protect(2, ret, ruid, euid); |
65 | return ret; | 65 | return ret; |
66 | } | 66 | } |
67 | 67 | ||
@@ -69,7 +69,7 @@ asmlinkage long sys_setuid16(old_uid_t uid) | |||
69 | { | 69 | { |
70 | long ret = sys_setuid(low2highuid(uid)); | 70 | long ret = sys_setuid(low2highuid(uid)); |
71 | /* avoid REGPARM breakage on x86: */ | 71 | /* avoid REGPARM breakage on x86: */ |
72 | prevent_tail_call(ret); | 72 | asmlinkage_protect(1, ret, uid); |
73 | return ret; | 73 | return ret; |
74 | } | 74 | } |
75 | 75 | ||
@@ -78,7 +78,7 @@ asmlinkage long sys_setresuid16(old_uid_t ruid, old_uid_t euid, old_uid_t suid) | |||
78 | long ret = sys_setresuid(low2highuid(ruid), low2highuid(euid), | 78 | long ret = sys_setresuid(low2highuid(ruid), low2highuid(euid), |
79 | low2highuid(suid)); | 79 | low2highuid(suid)); |
80 | /* avoid REGPARM breakage on x86: */ | 80 | /* avoid REGPARM breakage on x86: */ |
81 | prevent_tail_call(ret); | 81 | asmlinkage_protect(3, ret, ruid, euid, suid); |
82 | return ret; | 82 | return ret; |
83 | } | 83 | } |
84 | 84 | ||
@@ -98,7 +98,7 @@ asmlinkage long sys_setresgid16(old_gid_t rgid, old_gid_t egid, old_gid_t sgid) | |||
98 | long ret = sys_setresgid(low2highgid(rgid), low2highgid(egid), | 98 | long ret = sys_setresgid(low2highgid(rgid), low2highgid(egid), |
99 | low2highgid(sgid)); | 99 | low2highgid(sgid)); |
100 | /* avoid REGPARM breakage on x86: */ | 100 | /* avoid REGPARM breakage on x86: */ |
101 | prevent_tail_call(ret); | 101 | asmlinkage_protect(3, ret, rgid, egid, sgid); |
102 | return ret; | 102 | return ret; |
103 | } | 103 | } |
104 | 104 | ||
@@ -117,7 +117,7 @@ asmlinkage long sys_setfsuid16(old_uid_t uid) | |||
117 | { | 117 | { |
118 | long ret = sys_setfsuid(low2highuid(uid)); | 118 | long ret = sys_setfsuid(low2highuid(uid)); |
119 | /* avoid REGPARM breakage on x86: */ | 119 | /* avoid REGPARM breakage on x86: */ |
120 | prevent_tail_call(ret); | 120 | asmlinkage_protect(1, ret, uid); |
121 | return ret; | 121 | return ret; |
122 | } | 122 | } |
123 | 123 | ||
@@ -125,7 +125,7 @@ asmlinkage long sys_setfsgid16(old_gid_t gid) | |||
125 | { | 125 | { |
126 | long ret = sys_setfsgid(low2highgid(gid)); | 126 | long ret = sys_setfsgid(low2highgid(gid)); |
127 | /* avoid REGPARM breakage on x86: */ | 127 | /* avoid REGPARM breakage on x86: */ |
128 | prevent_tail_call(ret); | 128 | asmlinkage_protect(1, ret, gid); |
129 | return ret; | 129 | return ret; |
130 | } | 130 | } |
131 | 131 | ||