]> git.neil.brown.name Git - history.git/commitdiff
[PATCH] BKL reduction in do_exit
authorDave Hansen <haveblue@us.ibm.com>
Wed, 3 Apr 2002 02:58:29 +0000 (18:58 -0800)
committerDave Jones <davej@suse.de>
Wed, 3 Apr 2002 02:58:29 +0000 (18:58 -0800)
Push BKL down to the (few) routines that actually need it,
remove it from the do_exit() path.

drivers/char/tty_io.c
ipc/sem.c
kernel/exit.c

index 9fdd57eff81c48e7008cd0449763cf5bddfadeaf..d77cfdb24515f2379237c9d2b5ef142711522652 100644 (file)
@@ -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)
index 1c8d9837082f0197750b5b58d937358fe6168cd0..90fc3c33c773568190b76f2cb5bb226e5a044ca9 100644 (file)
--- 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
index b93c86ff2d4ae1c3e9a597022e524625fbd62ffc..d1a6b145161907472fc11bd46b09d4ddee7a225e 100644 (file)
@@ -494,7 +494,6 @@ fake_volatile:
        acct_process(code);
        __exit_mm(tsk);
 
-       lock_kernel();
        sem_exit();
        __exit_files(tsk);
        __exit_fs(tsk);