Commit 4e413ec6 authored by Dave Hansen's avatar Dave Hansen Committed by Dave Jones

[PATCH] BKL reduction in do_exit

Push BKL down to the (few) routines that actually need it,
remove it from the do_exit() path.
parent 8cceac24
......@@ -569,6 +569,8 @@ void disassociate_ctty(int on_exit)
struct task_struct *p;
int tty_pgrp = -1;
lock_kernel();
if (tty) {
tty_pgrp = tty->pgrp;
if (on_exit && tty->driver.type != TTY_DRIVER_TYPE_PTY)
......@@ -578,6 +580,7 @@ void disassociate_ctty(int on_exit)
kill_pg(current->tty_old_pgrp, SIGHUP, on_exit);
kill_pg(current->tty_old_pgrp, SIGCONT, on_exit);
}
unlock_kernel();
return;
}
if (tty_pgrp > 0) {
......@@ -595,6 +598,7 @@ void disassociate_ctty(int on_exit)
if (p->session == current->session)
p->tty = NULL;
read_unlock(&tasklist_lock);
unlock_kernel();
}
void stop_tty(struct tty_struct *tty)
......
......@@ -995,6 +995,8 @@ void sem_exit (void)
struct sem_array *sma;
int nsems, i;
lock_kernel();
/* If the current process was sleeping for a semaphore,
* remove it from the queue.
*/
......@@ -1051,6 +1053,8 @@ void sem_exit (void)
sem_unlock(semid);
}
current->semundo = NULL;
unlock_kernel();
}
#ifdef CONFIG_PROC_FS
......
......@@ -494,7 +494,6 @@ NORET_TYPE void do_exit(long code)
acct_process(code);
__exit_mm(tsk);
lock_kernel();
sem_exit();
__exit_files(tsk);
__exit_fs(tsk);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment