All of lore.kernel.org
 help / color / mirror / Atom feed
From: Dave Hansen <haveblue@us.ibm.com>
To: Linus Torvalds <torvalds@transmeta.com>
Cc: linux-kernel@vger.kernel.org
Subject: Re: [RFC][PATCH] BKL reduction in do_exit
Date: Wed, 03 Apr 2002 10:10:31 -0800	[thread overview]
Message-ID: <3CAB4597.70602@us.ibm.com> (raw)
In-Reply-To: <Pine.LNX.4.33.0204030945310.3571-100000@home.transmeta.com>

[-- Attachment #1: Type: text/plain, Size: 236 bytes --]

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

[-- Attachment #2: do_exit-bkl_reduction-2.5.7.patch.2 --]
[-- Type: text/plain, Size: 1305 bytes --]

--- 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);

      reply	other threads:[~2002-04-03 18:11 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-04-03 17:12 [RFC][PATCH] BKL reduction in do_exit Dave Hansen
2002-04-03 17:50 ` Linus Torvalds
2002-04-03 18:10   ` Dave Hansen [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=3CAB4597.70602@us.ibm.com \
    --to=haveblue@us.ibm.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=torvalds@transmeta.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.