public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Dave Hansen <haveblue@us.ibm.com>
To: linux-kernel@vger.kernel.org
Cc: Linus Torvalds <torvalds@transmeta.com>
Subject: [RFC][PATCH] BKL reduction in do_exit
Date: Wed, 03 Apr 2002 09:12:39 -0800	[thread overview]
Message-ID: <3CAB3807.5040508@us.ibm.com> (raw)

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

A week ago, I posted this:
http://groups.google.com/groups?selm=linux.kernel.3CA20C9B.20309%40us.ibm.com

Nobody had anything to sayabout it, so here's a patch.  It moves the 
disassociate_ctty(1) up, and releases the BKl after it gets done.  Is 
this a sane thing to do, or do some of those exit_*() functions still 
need the tty?

The patch reduces hold times of the BKL in do_exit() by a factor of 100. 
   They were on the order of 200us, now they're about 1.5us.  However, 
those numbers were on Martin Bligh's NUMA-Q box, so they represent a 
serious worst-case scenario.

The patch is stable, but I don't properly understand the consequences of 
moving the disassociate_ctty(1) up.  I guess we could do this instead:

  	lock_kernel();
  	sem_exit();
	unlock_kernel();
	
  	__exit_files(tsk);
  	__exit_fs(tsk);
  	exit_namespace(tsk);
  	exit_sighand(tsk);
  	exit_thread();
	
	lock_kernel();
	if (current->leader)
		disassociate_ctty(1);
	unlock_kernel();

But, I hesitated to do that because of the lock bouncing consequences on 
the NUMA-Q.

-- 
Dave Hansen
haveblue@us.ibm.com



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

--- linux-2.5.7-clean/kernel/exit.c	Tue Apr  2 10:43:28 2002
+++ linux//kernel/exit.c	Wed Apr  3 08:56:00 2002
@@ -500,15 +500,16 @@
 
 	lock_kernel();
 	sem_exit();
+	if (current->leader)
+		disassociate_ctty(1);
+	unlock_kernel();
+	
 	__exit_files(tsk);
 	__exit_fs(tsk);
 	exit_namespace(tsk);
 	exit_sighand(tsk);
 	exit_thread();
 
-	if (current->leader)
-		disassociate_ctty(1);
-
 	put_exec_domain(tsk->thread_info->exec_domain);
 	if (tsk->binfmt && tsk->binfmt->module)
 		__MOD_DEC_USE_COUNT(tsk->binfmt->module);

             reply	other threads:[~2002-04-03 17:13 UTC|newest]

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

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=3CAB3807.5040508@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox