diff options
| author | Dave Hansen <haveblue@us.ibm.com> | 2002-04-02 18:58:29 -0800 |
|---|---|---|
| committer | Dave Jones <davej@suse.de> | 2002-04-02 18:58:29 -0800 |
| commit | 4e413ec6ddfe6c2514c3454c58f45142ce1c9d63 (patch) | |
| tree | 6971bd2b135127a2bfdfeff70e619e6131708229 | |
| parent | 8cceac248d17302bffec61f3468fb19f262626f1 (diff) | |
[PATCH] BKL reduction in do_exit
Push BKL down to the (few) routines that actually need it,
remove it from the do_exit() path.
| -rw-r--r-- | drivers/char/tty_io.c | 4 | ||||
| -rw-r--r-- | ipc/sem.c | 4 | ||||
| -rw-r--r-- | kernel/exit.c | 1 |
3 files changed, 8 insertions, 1 deletions
diff --git a/drivers/char/tty_io.c b/drivers/char/tty_io.c index 9fdd57eff81c..d77cfdb24515 100644 --- a/drivers/char/tty_io.c +++ b/drivers/char/tty_io.c @@ -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) diff --git a/ipc/sem.c b/ipc/sem.c index 1c8d9837082f..90fc3c33c773 100644 --- a/ipc/sem.c +++ b/ipc/sem.c @@ -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 @@ next_entry: sem_unlock(semid); } current->semundo = NULL; + + unlock_kernel(); } #ifdef CONFIG_PROC_FS diff --git a/kernel/exit.c b/kernel/exit.c index b93c86ff2d4a..d1a6b1451619 100644 --- a/kernel/exit.c +++ b/kernel/exit.c @@ -494,7 +494,6 @@ fake_volatile: acct_process(code); __exit_mm(tsk); - lock_kernel(); sem_exit(); __exit_files(tsk); __exit_fs(tsk); |
