X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=kernel%2Fexit.c;h=2b64888d0019b1297b235a08d9618680844d9459;hb=90ad8654ffeb336af8c878fdf7bc72e2ac72467a;hp=60075cbb3d9fb5c6b97230becda2f4ff7e322a88;hpb=a91482bdcc2e0f6035702e46f1b99043a0893346;p=linux-2.6.git diff --git a/kernel/exit.c b/kernel/exit.c index 60075cbb3..2b64888d0 100644 --- a/kernel/exit.c +++ b/kernel/exit.c @@ -26,7 +26,6 @@ #include #include #include -#include #include #include @@ -44,7 +43,8 @@ static void __unhash_process(struct task_struct *p) /* tasklist_lock is held, is this sufficient? */ if (p->vx_info) { atomic_dec(&p->vx_info->cacct.nr_threads); - atomic_dec(&p->vx_info->limit.rcur[RLIMIT_NPROC]); + vx_nproc_dec(p->vx_info); + // atomic_dec(&p->vx_info->limit.res[RLIMIT_NPROC]); } detach_pid(p, PIDTYPE_PID); detach_pid(p, PIDTYPE_TGID); @@ -392,7 +392,7 @@ static inline void close_files(struct files_struct * files) filp_close(file, files); cond_resched(); } - // vx_openfd_dec(fd); + vx_openfd_dec(fd); } i++; set >>= 1; @@ -524,12 +524,6 @@ static inline void __exit_mm(struct task_struct * tsk) task_lock(tsk); tsk->mm = NULL; up_read(&mm->mmap_sem); -#ifdef CONFIG_CKRM_RES_MEM - spin_lock(&mm->peertask_lock); - list_del_init(&tsk->mm_peers); - ckrm_mem_evaluate_mm(mm); - spin_unlock(&mm->peertask_lock); -#endif enter_lazy_tlb(mm, current); task_unlock(tsk); mmput(mm); @@ -843,13 +837,6 @@ asmlinkage NORET_TYPE void do_exit(long code) } acct_process(code); - if (current->tux_info) { -#ifdef CONFIG_TUX_DEBUG - printk("Possibly unexpected TUX-thread exit(%ld) at %p?\n", - code, __builtin_return_address(0)); -#endif - current->tux_exit(); - } __exit_mm(tsk); exit_sem(tsk); @@ -866,6 +853,9 @@ asmlinkage NORET_TYPE void do_exit(long code) module_put(tsk->binfmt->module); tsk->exit_code = code; +#ifdef CONFIG_CKRM_TYPE_TASKCLASS + numtasks_put_ref(tsk->taskclass); +#endif exit_notify(tsk); #ifdef CONFIG_NUMA mpol_free(tsk->mempolicy); @@ -1047,17 +1037,20 @@ static int wait_task_zombie(task_t *p, unsigned int __user *stat_addr, struct ru if (p->real_parent != p->parent) { __ptrace_unlink(p); p->state = TASK_ZOMBIE; - /* - * If this is not a detached task, notify the parent. If it's - * still not detached after that, don't release it now. - */ - if (p->exit_signal != -1) { + /* If this is a detached thread, this is where it goes away. */ + if (p->exit_signal == -1) { + /* release_task takes the lock itself. */ + write_unlock_irq(&tasklist_lock); + release_task (p); + } + else { do_notify_parent(p, p->exit_signal); - if (p->exit_signal != -1) - p = NULL; + write_unlock_irq(&tasklist_lock); } + p = NULL; } - write_unlock_irq(&tasklist_lock); + else + write_unlock_irq(&tasklist_lock); } if (p != NULL) release_task(p);