lkml.org 
[lkml]   [2002]   [Apr]   [3]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
SubjectRe: [RFC][PATCH] BKL reduction in do_exit
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);
\
 
 \ /
  Last update: 2005-03-22 13:22    [W:0.054 / U:0.952 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site