aboutsummaryrefslogtreecommitdiffstats
path: root/kernel
diff options
context:
space:
mode:
Diffstat (limited to 'kernel')
-rw-r--r--kernel/cpu.c4
-rw-r--r--kernel/exit.c2
-rw-r--r--kernel/irq/manage.c11
-rw-r--r--kernel/power/Kconfig41
-rw-r--r--kernel/signal.c19
-rw-r--r--kernel/sys.c3
-rw-r--r--kernel/user_namespace.c1
7 files changed, 49 insertions, 32 deletions
diff --git a/kernel/cpu.c b/kernel/cpu.c
index 181ae7086029..38033db8d8ec 100644
--- a/kernel/cpu.c
+++ b/kernel/cpu.c
@@ -273,7 +273,7 @@ int __cpuinit cpu_up(unsigned int cpu)
273 return err; 273 return err;
274} 274}
275 275
276#ifdef CONFIG_SUSPEND_SMP 276#ifdef CONFIG_PM_SLEEP_SMP
277static cpumask_t frozen_cpus; 277static cpumask_t frozen_cpus;
278 278
279int disable_nonboot_cpus(void) 279int disable_nonboot_cpus(void)
@@ -334,4 +334,4 @@ void enable_nonboot_cpus(void)
334out: 334out:
335 mutex_unlock(&cpu_add_remove_lock); 335 mutex_unlock(&cpu_add_remove_lock);
336} 336}
337#endif 337#endif /* CONFIG_PM_SLEEP_SMP */
diff --git a/kernel/exit.c b/kernel/exit.c
index 9578c1ae19ca..06b24b3aa370 100644
--- a/kernel/exit.c
+++ b/kernel/exit.c
@@ -975,6 +975,7 @@ fastcall NORET_TYPE void do_exit(long code)
975 if (unlikely(tsk->audit_context)) 975 if (unlikely(tsk->audit_context))
976 audit_free(tsk); 976 audit_free(tsk);
977 977
978 tsk->exit_code = code;
978 taskstats_exit(tsk, group_dead); 979 taskstats_exit(tsk, group_dead);
979 980
980 exit_mm(tsk); 981 exit_mm(tsk);
@@ -996,7 +997,6 @@ fastcall NORET_TYPE void do_exit(long code)
996 if (tsk->binfmt) 997 if (tsk->binfmt)
997 module_put(tsk->binfmt->module); 998 module_put(tsk->binfmt->module);
998 999
999 tsk->exit_code = code;
1000 proc_exit_connector(tsk); 1000 proc_exit_connector(tsk);
1001 exit_task_namespaces(tsk); 1001 exit_task_namespaces(tsk);
1002 exit_notify(tsk); 1002 exit_notify(tsk);
diff --git a/kernel/irq/manage.c b/kernel/irq/manage.c
index 853aefbd184b..7230d914eaa2 100644
--- a/kernel/irq/manage.c
+++ b/kernel/irq/manage.c
@@ -547,14 +547,11 @@ int request_irq(unsigned int irq, irq_handler_t handler,
547 * We do this before actually registering it, to make sure that 547 * We do this before actually registering it, to make sure that
548 * a 'real' IRQ doesn't run in parallel with our fake 548 * a 'real' IRQ doesn't run in parallel with our fake
549 */ 549 */
550 if (irqflags & IRQF_DISABLED) { 550 unsigned long flags;
551 unsigned long flags;
552 551
553 local_irq_save(flags); 552 local_irq_save(flags);
554 handler(irq, dev_id); 553 handler(irq, dev_id);
555 local_irq_restore(flags); 554 local_irq_restore(flags);
556 } else
557 handler(irq, dev_id);
558 } 555 }
559#endif 556#endif
560 557
diff --git a/kernel/power/Kconfig b/kernel/power/Kconfig
index 412859f8d94a..c8580a1e6873 100644
--- a/kernel/power/Kconfig
+++ b/kernel/power/Kconfig
@@ -72,15 +72,10 @@ config PM_TRACE
72 CAUTION: this option will cause your machine's real-time clock to be 72 CAUTION: this option will cause your machine's real-time clock to be
73 set to an invalid time after a resume. 73 set to an invalid time after a resume.
74 74
75config SUSPEND_SMP_POSSIBLE 75config PM_SLEEP_SMP
76 bool
77 depends on (X86 && !X86_VOYAGER) || (PPC64 && (PPC_PSERIES || PPC_PMAC))
78 depends on SMP
79 default y
80
81config SUSPEND_SMP
82 bool 76 bool
83 depends on SUSPEND_SMP_POSSIBLE && PM_SLEEP 77 depends on SUSPEND_SMP_POSSIBLE || HIBERNATION_SMP_POSSIBLE
78 depends on PM_SLEEP
84 select HOTPLUG_CPU 79 select HOTPLUG_CPU
85 default y 80 default y
86 81
@@ -89,20 +84,46 @@ config PM_SLEEP
89 depends on SUSPEND || HIBERNATION 84 depends on SUSPEND || HIBERNATION
90 default y 85 default y
91 86
87config SUSPEND_UP_POSSIBLE
88 bool
89 depends on (X86 && !X86_VOYAGER) || PPC || ARM || BLACKFIN || MIPS \
90 || SUPERH || FRV
91 depends on !SMP
92 default y
93
94config SUSPEND_SMP_POSSIBLE
95 bool
96 depends on (X86 && !X86_VOYAGER) \
97 || (PPC && (PPC_PSERIES || PPC_PMAC)) || ARM
98 depends on SMP
99 default y
100
92config SUSPEND 101config SUSPEND
93 bool "Suspend to RAM and standby" 102 bool "Suspend to RAM and standby"
94 depends on PM 103 depends on PM
95 depends on !SMP || SUSPEND_SMP_POSSIBLE 104 depends on SUSPEND_UP_POSSIBLE || SUSPEND_SMP_POSSIBLE
96 default y 105 default y
97 ---help--- 106 ---help---
98 Allow the system to enter sleep states in which main memory is 107 Allow the system to enter sleep states in which main memory is
99 powered and thus its contents are preserved, such as the 108 powered and thus its contents are preserved, such as the
100 suspend-to-RAM state (i.e. the ACPI S3 state). 109 suspend-to-RAM state (i.e. the ACPI S3 state).
101 110
111config HIBERNATION_UP_POSSIBLE
112 bool
113 depends on X86 || PPC64_SWSUSP || FRV || PPC32
114 depends on !SMP
115 default y
116
117config HIBERNATION_SMP_POSSIBLE
118 bool
119 depends on (X86 && !X86_VOYAGER) || PPC64_SWSUSP
120 depends on SMP
121 default y
122
102config HIBERNATION 123config HIBERNATION
103 bool "Hibernation (aka 'suspend to disk')" 124 bool "Hibernation (aka 'suspend to disk')"
104 depends on PM && SWAP 125 depends on PM && SWAP
105 depends on ((X86 || PPC64_SWSUSP || FRV || PPC32) && !SMP) || SUSPEND_SMP_POSSIBLE 126 depends on HIBERNATION_UP_POSSIBLE || HIBERNATION_SMP_POSSIBLE
106 ---help--- 127 ---help---
107 Enable the suspend to disk (STD) functionality, which is usually 128 Enable the suspend to disk (STD) functionality, which is usually
108 called "hibernation" in user interfaces. STD checkpoints the 129 called "hibernation" in user interfaces. STD checkpoints the
diff --git a/kernel/signal.c b/kernel/signal.c
index ad63109e413c..3169bed0b4d0 100644
--- a/kernel/signal.c
+++ b/kernel/signal.c
@@ -1300,20 +1300,19 @@ struct sigqueue *sigqueue_alloc(void)
1300void sigqueue_free(struct sigqueue *q) 1300void sigqueue_free(struct sigqueue *q)
1301{ 1301{
1302 unsigned long flags; 1302 unsigned long flags;
1303 spinlock_t *lock = &current->sighand->siglock;
1304
1303 BUG_ON(!(q->flags & SIGQUEUE_PREALLOC)); 1305 BUG_ON(!(q->flags & SIGQUEUE_PREALLOC));
1304 /* 1306 /*
1305 * If the signal is still pending remove it from the 1307 * If the signal is still pending remove it from the
1306 * pending queue. 1308 * pending queue. We must hold ->siglock while testing
1309 * q->list to serialize with collect_signal().
1307 */ 1310 */
1308 if (unlikely(!list_empty(&q->list))) { 1311 spin_lock_irqsave(lock, flags);
1309 spinlock_t *lock = &current->sighand->siglock; 1312 if (!list_empty(&q->list))
1310 read_lock(&tasklist_lock); 1313 list_del_init(&q->list);
1311 spin_lock_irqsave(lock, flags); 1314 spin_unlock_irqrestore(lock, flags);
1312 if (!list_empty(&q->list)) 1315
1313 list_del_init(&q->list);
1314 spin_unlock_irqrestore(lock, flags);
1315 read_unlock(&tasklist_lock);
1316 }
1317 q->flags &= ~SIGQUEUE_PREALLOC; 1316 q->flags &= ~SIGQUEUE_PREALLOC;
1318 __sigqueue_free(q); 1317 __sigqueue_free(q);
1319} 1318}
diff --git a/kernel/sys.c b/kernel/sys.c
index 449b81b98b3d..1b33b05d346b 100644
--- a/kernel/sys.c
+++ b/kernel/sys.c
@@ -1442,7 +1442,6 @@ asmlinkage long sys_times(struct tms __user * tbuf)
1442 * Auch. Had to add the 'did_exec' flag to conform completely to POSIX. 1442 * Auch. Had to add the 'did_exec' flag to conform completely to POSIX.
1443 * LBT 04.03.94 1443 * LBT 04.03.94
1444 */ 1444 */
1445
1446asmlinkage long sys_setpgid(pid_t pid, pid_t pgid) 1445asmlinkage long sys_setpgid(pid_t pid, pid_t pgid)
1447{ 1446{
1448 struct task_struct *p; 1447 struct task_struct *p;
@@ -1470,7 +1469,7 @@ asmlinkage long sys_setpgid(pid_t pid, pid_t pgid)
1470 if (!thread_group_leader(p)) 1469 if (!thread_group_leader(p))
1471 goto out; 1470 goto out;
1472 1471
1473 if (p->real_parent == group_leader) { 1472 if (p->real_parent->tgid == group_leader->tgid) {
1474 err = -EPERM; 1473 err = -EPERM;
1475 if (task_session(p) != task_session(group_leader)) 1474 if (task_session(p) != task_session(group_leader))
1476 goto out; 1475 goto out;
diff --git a/kernel/user_namespace.c b/kernel/user_namespace.c
index d055d987850c..85af9422ea6e 100644
--- a/kernel/user_namespace.c
+++ b/kernel/user_namespace.c
@@ -81,6 +81,7 @@ void free_user_ns(struct kref *kref)
81 struct user_namespace *ns; 81 struct user_namespace *ns;
82 82
83 ns = container_of(kref, struct user_namespace, kref); 83 ns = container_of(kref, struct user_namespace, kref);
84 free_uid(ns->root_user);
84 kfree(ns); 85 kfree(ns);
85} 86}
86 87