git://ftp.safe.ca
/
safe
/
jmp
/
linux-2.6
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Make irq_*_affinity depend on CONFIG_GENERIC_HARDIRQS too.
[safe/jmp/linux-2.6]
/
kernel
/
exit.c
diff --git
a/kernel/exit.c
b/kernel/exit.c
index
c9e5a1c
..
f80dec3
100644
(file)
--- a/
kernel/exit.c
+++ b/
kernel/exit.c
@@
-642,35
+642,31
@@
retry:
/*
* We found no owner yet mm_users > 1: this implies that we are
* most likely racing with swapoff (try_to_unuse()) or /proc or
/*
* We found no owner yet mm_users > 1: this implies that we are
* most likely racing with swapoff (try_to_unuse()) or /proc or
- * ptrace or page migration (get_task_mm()). Mark owner as NULL,
- * so that subsystems can understand the callback and take action.
+ * ptrace or page migration (get_task_mm()). Mark owner as NULL.
*/
*/
- down_write(&mm->mmap_sem);
- cgroup_mm_owner_callbacks(mm->owner, NULL);
mm->owner = NULL;
mm->owner = NULL;
- up_write(&mm->mmap_sem);
return;
assign_new_owner:
BUG_ON(c == p);
get_task_struct(c);
return;
assign_new_owner:
BUG_ON(c == p);
get_task_struct(c);
- read_unlock(&tasklist_lock);
- down_write(&mm->mmap_sem);
/*
* The task_lock protects c->mm from changing.
* We always want mm->owner->mm == mm
*/
task_lock(c);
/*
* The task_lock protects c->mm from changing.
* We always want mm->owner->mm == mm
*/
task_lock(c);
+ /*
+ * Delay read_unlock() till we have the task_lock()
+ * to ensure that c does not slip away underneath us
+ */
+ read_unlock(&tasklist_lock);
if (c->mm != mm) {
task_unlock(c);
if (c->mm != mm) {
task_unlock(c);
- up_write(&mm->mmap_sem);
put_task_struct(c);
goto retry;
}
put_task_struct(c);
goto retry;
}
- cgroup_mm_owner_callbacks(mm->owner, c);
mm->owner = c;
task_unlock(c);
mm->owner = c;
task_unlock(c);
- up_write(&mm->mmap_sem);
put_task_struct(c);
}
#endif /* CONFIG_MM_OWNER */
put_task_struct(c);
}
#endif /* CONFIG_MM_OWNER */
@@
-1055,10
+1051,7
@@
NORET_TYPE void do_exit(long code)
preempt_count());
acct_update_integrals(tsk);
preempt_count());
acct_update_integrals(tsk);
- if (tsk->mm) {
- update_hiwater_rss(tsk->mm);
- update_hiwater_vm(tsk->mm);
- }
+
group_dead = atomic_dec_and_test(&tsk->signal->live);
if (group_dead) {
hrtimer_cancel(&tsk->signal->real_timer);
group_dead = atomic_dec_and_test(&tsk->signal->live);
if (group_dead) {
hrtimer_cancel(&tsk->signal->real_timer);
@@
-1148,7
+1141,7
@@
NORET_TYPE void complete_and_exit(struct completion *comp, long code)
EXPORT_SYMBOL(complete_and_exit);
EXPORT_SYMBOL(complete_and_exit);
-
asmlinkage long sys_exit(int
error_code)
+
SYSCALL_DEFINE1(exit, int,
error_code)
{
do_exit((error_code&0xff)<<8);
}
{
do_exit((error_code&0xff)<<8);
}
@@
-1189,9
+1182,11
@@
do_group_exit(int exit_code)
* wait4()-ing process will get the correct exit code - even if this
* thread is not the thread group leader.
*/
* wait4()-ing process will get the correct exit code - even if this
* thread is not the thread group leader.
*/
-
asmlinkage void sys_exit_group(int
error_code)
+
SYSCALL_DEFINE1(exit_group, int,
error_code)
{
do_group_exit((error_code & 0xff) << 8);
{
do_group_exit((error_code & 0xff) << 8);
+ /* NOTREACHED */
+ return 0;
}
static struct pid *task_pid_type(struct task_struct *task, enum pid_type type)
}
static struct pid *task_pid_type(struct task_struct *task, enum pid_type type)
@@
-1759,9
+1754,8
@@
end:
return retval;
}
return retval;
}
-asmlinkage long sys_waitid(int which, pid_t upid,
- struct siginfo __user *infop, int options,
- struct rusage __user *ru)
+SYSCALL_DEFINE5(waitid, int, which, pid_t, upid, struct siginfo __user *,
+ infop, int, options, struct rusage __user *, ru)
{
struct pid *pid = NULL;
enum pid_type type;
{
struct pid *pid = NULL;
enum pid_type type;
@@
-1800,8
+1794,8
@@
asmlinkage long sys_waitid(int which, pid_t upid,
return ret;
}
return ret;
}
-
asmlinkage long sys_wait4(pid_t upid, int __user *
stat_addr,
-
int options, struct rusage __user *
ru)
+
SYSCALL_DEFINE4(wait4, pid_t, upid, int __user *,
stat_addr,
+
int, options, struct rusage __user *,
ru)
{
struct pid *pid = NULL;
enum pid_type type;
{
struct pid *pid = NULL;
enum pid_type type;
@@
-1838,7
+1832,7
@@
asmlinkage long sys_wait4(pid_t upid, int __user *stat_addr,
* sys_waitpid() remains for compatibility. waitpid() should be
* implemented by calling sys_wait4() from libc.a.
*/
* sys_waitpid() remains for compatibility. waitpid() should be
* implemented by calling sys_wait4() from libc.a.
*/
-
asmlinkage long sys_waitpid(pid_t pid, int __user *stat_addr, int
options)
+
SYSCALL_DEFINE3(waitpid, pid_t, pid, int __user *, stat_addr, int,
options)
{
return sys_wait4(pid, stat_addr, options, NULL);
}
{
return sys_wait4(pid, stat_addr, options, NULL);
}