From 4e413ec6ddfe6c2514c3454c58f45142ce1c9d63 Mon Sep 17 00:00:00 2001 From: Dave Hansen Date: Tue, 2 Apr 2002 18:58:29 -0800 Subject: [PATCH] BKL reduction in do_exit Push BKL down to the (few) routines that actually need it, remove it from the do_exit() path. --- drivers/char/tty_io.c | 4 ++++ ipc/sem.c | 4 ++++ kernel/exit.c | 1 - 3 files changed, 8 insertions(+), 1 deletion(-) 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); -- cgit v1.2.3