Re: [RFC][PATCH] BKL reduction in do_exit

From: Dave Hansen (haveblue@us.ibm.com)
Date: Wed Apr 03 2002 - 13:10:31 EST


Linus Torvalds wrote:
> I'd prefer to have the BKL just moved into the functions that need it, and
> removed altogether from do_exit().

I like the push-it-down approach better too. Patch attached.

-- 
Dave Hansen
haveblue@us.ibm.com

--- linux-2.5.7-clean/drivers/char/tty_io.c Thu Mar 7 18:18:54 2002 +++ linux/drivers/char/tty_io.c Wed Apr 3 10:03:27 2002 @@ -569,6 +569,8 @@ 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 @@ 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 @@ if (p->session == current->session) p->tty = NULL; read_unlock(&tasklist_lock); + unlock_kernel(); } void stop_tty(struct tty_struct *tty) --- linux-2.5.7-clean/ipc/sem.c Thu Mar 7 18:18:25 2002 +++ linux/ipc/sem.c Wed Apr 3 10:07:28 2002 @@ -995,6 +995,8 @@ 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 @@ sem_unlock(semid); } current->semundo = NULL; + + unlock_kernel(); } #ifdef CONFIG_PROC_FS --- linux-2.5.7-clean/kernel/exit.c Tue Apr 2 10:43:28 2002 +++ linux/kernel/exit.c Wed Apr 3 10:06:19 2002 @@ -498,7 +498,6 @@ #endif __exit_mm(tsk); - lock_kernel(); sem_exit(); __exit_files(tsk); __exit_fs(tsk);

- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/



This archive was generated by hypermail 2b29 : Sun Apr 07 2002 - 22:00:11 EST