projects
/
powerpc.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
[PATCH] cfq_cic_link: fix usage of wrong cfq_io_context
[powerpc.git]
/
kernel
/
exit.c
diff --git
a/kernel/exit.c
b/kernel/exit.c
index
304ef63
..
dba194a
100644
(file)
--- a/
kernel/exit.c
+++ b/
kernel/exit.c
@@
-4,7
+4,6
@@
* Copyright (C) 1991, 1992 Linus Torvalds
*/
* Copyright (C) 1991, 1992 Linus Torvalds
*/
-#include <linux/config.h>
#include <linux/mm.h>
#include <linux/slab.h>
#include <linux/interrupt.h>
#include <linux/mm.h>
#include <linux/slab.h>
#include <linux/interrupt.h>
@@
-26,6
+25,8
@@
#include <linux/mount.h>
#include <linux/proc_fs.h>
#include <linux/mempolicy.h>
#include <linux/mount.h>
#include <linux/proc_fs.h>
#include <linux/mempolicy.h>
+#include <linux/taskstats_kern.h>
+#include <linux/delayacct.h>
#include <linux/cpuset.h>
#include <linux/syscalls.h>
#include <linux/signal.h>
#include <linux/cpuset.h>
#include <linux/syscalls.h>
#include <linux/signal.h>
@@
-135,8
+136,8
@@
static void delayed_put_task_struct(struct rcu_head *rhp)
void release_task(struct task_struct * p)
{
void release_task(struct task_struct * p)
{
+ struct task_struct *leader;
int zap_leader;
int zap_leader;
- task_t *leader;
repeat:
atomic_dec(&p->user->processes);
write_lock_irq(&tasklist_lock);
repeat:
atomic_dec(&p->user->processes);
write_lock_irq(&tasklist_lock);
@@
-210,7
+211,7
@@
out:
*
* "I ask you, have you ever known what it is to be an orphan?"
*/
*
* "I ask you, have you ever known what it is to be an orphan?"
*/
-static int will_become_orphaned_pgrp(int pgrp,
task_
t *ignored_task)
+static int will_become_orphaned_pgrp(int pgrp,
struct task_struc
t *ignored_task)
{
struct task_struct *p;
int ret = 1;
{
struct task_struct *p;
int ret = 1;
@@
-583,7
+584,8
@@
static void exit_mm(struct task_struct * tsk)
mmput(mm);
}
mmput(mm);
}
-static inline void choose_new_parent(task_t *p, task_t *reaper)
+static inline void
+choose_new_parent(struct task_struct *p, struct task_struct *reaper)
{
/*
* Make sure we're not reparenting to ourselves and that
{
/*
* Make sure we're not reparenting to ourselves and that
@@
-593,7
+595,8
@@
static inline void choose_new_parent(task_t *p, task_t *reaper)
p->real_parent = reaper;
}
p->real_parent = reaper;
}
-static void reparent_thread(task_t *p, task_t *father, int traced)
+static void
+reparent_thread(struct task_struct *p, struct task_struct *father, int traced)
{
/* We don't want people slaying init. */
if (p->exit_signal != -1)
{
/* We don't want people slaying init. */
if (p->exit_signal != -1)
@@
-657,8
+660,8
@@
static void reparent_thread(task_t *p, task_t *father, int traced)
* group, and if no such member exists, give it to
* the global child reaper process (ie "init")
*/
* group, and if no such member exists, give it to
* the global child reaper process (ie "init")
*/
-static void
forget_original_parent(struct task_struct * father,
-
struct list_head *to_release)
+static void
+
forget_original_parent(struct task_struct *father,
struct list_head *to_release)
{
struct task_struct *p, *reaper = father;
struct list_head *_p, *_n;
{
struct task_struct *p, *reaper = father;
struct list_head *_p, *_n;
@@
-681,7
+684,7
@@
static void forget_original_parent(struct task_struct * father,
*/
list_for_each_safe(_p, _n, &father->children) {
int ptrace;
*/
list_for_each_safe(_p, _n, &father->children) {
int ptrace;
- p = list_entry(_p,
struct task_struct,
sibling);
+ p = list_entry(_p,
struct task_struct,
sibling);
ptrace = p->ptrace;
ptrace = p->ptrace;
@@
-710,7
+713,7
@@
static void forget_original_parent(struct task_struct * father,
list_add(&p->ptrace_list, to_release);
}
list_for_each_safe(_p, _n, &father->ptrace_children) {
list_add(&p->ptrace_list, to_release);
}
list_for_each_safe(_p, _n, &father->ptrace_children) {
- p = list_entry(_p,
struct task_struct,
ptrace_list);
+ p = list_entry(_p,
struct task_struct,
ptrace_list);
choose_new_parent(p, reaper);
reparent_thread(p, father, 1);
}
choose_new_parent(p, reaper);
reparent_thread(p, father, 1);
}
@@
-830,7
+833,7
@@
static void exit_notify(struct task_struct *tsk)
list_for_each_safe(_p, _n, &ptrace_dead) {
list_del_init(_p);
list_for_each_safe(_p, _n, &ptrace_dead) {
list_del_init(_p);
- t = list_entry(_p,
struct task_struct,
ptrace_list);
+ t = list_entry(_p,
struct task_struct,
ptrace_list);
release_task(t);
}
release_task(t);
}
@@
-842,7
+845,9
@@
static void exit_notify(struct task_struct *tsk)
fastcall NORET_TYPE void do_exit(long code)
{
struct task_struct *tsk = current;
fastcall NORET_TYPE void do_exit(long code)
{
struct task_struct *tsk = current;
+ struct taskstats *tidstats;
int group_dead;
int group_dead;
+ unsigned int mycpu;
profile_task_exit(tsk);
profile_task_exit(tsk);
@@
-880,6
+885,8
@@
fastcall NORET_TYPE void do_exit(long code)
current->comm, current->pid,
preempt_count());
current->comm, current->pid,
preempt_count());
+ taskstats_exit_alloc(&tidstats, &mycpu);
+
acct_update_integrals(tsk);
if (tsk->mm) {
update_hiwater_rss(tsk->mm);
acct_update_integrals(tsk);
if (tsk->mm) {
update_hiwater_rss(tsk->mm);
@@
-899,6
+906,10
@@
fastcall NORET_TYPE void do_exit(long code)
#endif
if (unlikely(tsk->audit_context))
audit_free(tsk);
#endif
if (unlikely(tsk->audit_context))
audit_free(tsk);
+ taskstats_exit_send(tsk, tidstats, group_dead, mycpu);
+ taskstats_exit_free(tidstats);
+ delayacct_tsk_exit(tsk);
+
exit_mm(tsk);
if (group_dead)
exit_mm(tsk);
if (group_dead)
@@
-926,9
+937,17
@@
fastcall NORET_TYPE void do_exit(long code)
tsk->mempolicy = NULL;
#endif
/*
tsk->mempolicy = NULL;
#endif
/*
- * If DEBUG_MUTEXES is on, make sure we are holding no locks:
+ * This must happen late, after the PID is not
+ * hashed anymore:
*/
*/
- mutex_debug_check_no_locks_held(tsk);
+ if (unlikely(!list_empty(&tsk->pi_state_list)))
+ exit_pi_state_list(tsk);
+ if (unlikely(current->pi_state_cache))
+ kfree(current->pi_state_cache);
+ /*
+ * Make sure we are holding no locks:
+ */
+ debug_check_no_locks_held(tsk);
if (tsk->io_context)
exit_io_context();
if (tsk->io_context)
exit_io_context();
@@
-1003,7
+1022,7
@@
asmlinkage void sys_exit_group(int error_code)
do_group_exit((error_code & 0xff) << 8);
}
do_group_exit((error_code & 0xff) << 8);
}
-static int eligible_child(pid_t pid, int options,
task_
t *p)
+static int eligible_child(pid_t pid, int options,
struct task_struc
t *p)
{
if (pid > 0) {
if (p->pid != pid)
{
if (pid > 0) {
if (p->pid != pid)
@@
-1044,12
+1063,13
@@
static int eligible_child(pid_t pid, int options, task_t *p)
return 1;
}
return 1;
}
-static int wait_noreap_copyout(
task_
t *p, pid_t pid, uid_t uid,
+static int wait_noreap_copyout(
struct task_struc
t *p, pid_t pid, uid_t uid,
int why, int status,
struct siginfo __user *infop,
struct rusage __user *rusagep)
{
int retval = rusagep ? getrusage(p, RUSAGE_BOTH, rusagep) : 0;
int why, int status,
struct siginfo __user *infop,
struct rusage __user *rusagep)
{
int retval = rusagep ? getrusage(p, RUSAGE_BOTH, rusagep) : 0;
+
put_task_struct(p);
if (!retval)
retval = put_user(SIGCHLD, &infop->si_signo);
put_task_struct(p);
if (!retval)
retval = put_user(SIGCHLD, &infop->si_signo);
@@
-1074,7
+1094,7
@@
static int wait_noreap_copyout(task_t *p, pid_t pid, uid_t uid,
* the lock and this task is uninteresting. If we return nonzero, we have
* released the lock and the system call should return.
*/
* the lock and this task is uninteresting. If we return nonzero, we have
* released the lock and the system call should return.
*/
-static int wait_task_zombie(
task_
t *p, int noreap,
+static int wait_task_zombie(
struct task_struc
t *p, int noreap,
struct siginfo __user *infop,
int __user *stat_addr, struct rusage __user *ru)
{
struct siginfo __user *infop,
int __user *stat_addr, struct rusage __user *ru)
{
@@
-1236,8
+1256,8
@@
static int wait_task_zombie(task_t *p, int noreap,
* the lock and this task is uninteresting. If we return nonzero, we have
* released the lock and the system call should return.
*/
* the lock and this task is uninteresting. If we return nonzero, we have
* released the lock and the system call should return.
*/
-static int wait_task_stopped(
task_t *p, int delayed_group_leader, int noreap
,
- struct siginfo __user *infop,
+static int wait_task_stopped(
struct task_struct *p, int delayed_group_leader
,
+
int noreap,
struct siginfo __user *infop,
int __user *stat_addr, struct rusage __user *ru)
{
int retval, exit_code;
int __user *stat_addr, struct rusage __user *ru)
{
int retval, exit_code;
@@
-1351,7
+1371,7
@@
bail_ref:
* the lock and this task is uninteresting. If we return nonzero, we have
* released the lock and the system call should return.
*/
* the lock and this task is uninteresting. If we return nonzero, we have
* released the lock and the system call should return.
*/
-static int wait_task_continued(
task_
t *p, int noreap,
+static int wait_task_continued(
struct task_struc
t *p, int noreap,
struct siginfo __user *infop,
int __user *stat_addr, struct rusage __user *ru)
{
struct siginfo __user *infop,
int __user *stat_addr, struct rusage __user *ru)
{
@@
-1437,7
+1457,7
@@
repeat:
int ret;
list_for_each(_p,&tsk->children) {
int ret;
list_for_each(_p,&tsk->children) {
- p = list_entry(_p,
struct task_struct,
sibling);
+ p = list_entry(_p,
struct task_struct,
sibling);
ret = eligible_child(pid, options, p);
if (!ret)
ret = eligible_child(pid, options, p);
if (!ret)