linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Matt Helsley <matthltc@us.ibm.com>
To: Jes Sorensen <jes@trained-monkey.org>
Cc: John Hesterberg <jh@sgi.com>,
	Shailabh Nagar <nagar@watson.ibm.com>,
	Andrew Morton <akpm@osdl.org>, Jay Lan <jlan@engr.sgi.com>,
	LKML <linux-kernel@vger.kernel.org>,
	elsa-devel@lists.sourceforge.net, lse-tech@lists.sourceforge.net,
	CKRM-Tech <ckrm-tech@lists.sourceforge.net>,
	Paul Jackson <pj@sgi.com>, Erik Jacobson <erikj@sgi.com>,
	Jack Steiner <steiner@sgi.com>
Subject: Re: [Lse-tech] Re: [ckrm-tech] Re: [PATCH 00/01] Move Exit Connectors
Date: Thu, 12 Jan 2006 15:20:30 -0800	[thread overview]
Message-ID: <1137108030.6673.255.camel@stark> (raw)
In-Reply-To: <yq0fynt3gv6.fsf@jaguar.mkp.net>

On Thu, 2006-01-12 at 05:01 -0500, Jes Sorensen wrote:
> >>>>> "Matt" == Matt Helsley <matthltc@us.ibm.com> writes:
> 
> Matt> On Wed, 2006-01-11 at 15:39 -0600, John Hesterberg wrote:
> >> I have two concerns about an all-tasks notification interface.
> >> First, we want this to scale, so don't want more global locks.  One
> >> unique part of the task notify is that it doesn't use locks.
> 
> Matt> 	Are you against global locks in these paths based solely on
> Matt> principle or have you measured their impact on scalability in
> Matt> those locations?
> 
> Matt,
> 
> It all depends on the specific location of the locks and how often
> they are taken. As long as something is taken by the same CPU all the
> time is not going to be a major issue, but if we end up with anything
> resembling a global lock, even if it is only held for a very short
> time, it is going to bite badly. On a 4-way you probably won't notice,
> but go to a 64-way and it bites, on a 512-way it eats you alive (we
> had a problem in the timer code quite a while back that prevented the
> machine from booting - it wasn't a lock that was held for a long time,
> just the fact that every CPU would take it every HZ was enough).

	OK, so you've established that global locks in timer paths are Bad.
However you haven't established that timer paths are almost the same as
the task paths we're talking about. I suspect timer paths are used much
more frequently than fork, exec, or exit.

	I've appended a small patch that adds a global lock to the task_notify
paths for testing purposes. I'm curious to know what kind of a
performance difference you would see on your 64 or 512-way if you were
to run with it.

	Looking at the ideas for lockless implementations I'm curious how well
Keith's notifier chains patch would work in this case. It does not
acquire a global lock in the "call" path and, as Keith suggested,
probably can be modified to avoid cache bouncing.

Cheers,
	-Matt Helsley

> Matt> 	Without measurement there are two conflicting principles here:
> Matt> code complexity vs. scalability.
> 
> The two should never be mutually exlusive as long as we are careful.
> 
> Matt> 	If you've made measurements I'm curious to know what kind of
> Matt> locks were measured, where they were used, what the load was
> Matt> doing -- as a rough characterization of the pattern of
> Matt> notifications -- and how much it impacted scalability. This
> Matt> information might help suggest a better solution.
> 
> The one I mentioned above was in the timer interrupt path.
> 
> Cheers,
> Jes


Index: linux-2.6.15/kernel/fork.c
===================================================================
--- linux-2.6.15.orig/kernel/fork.c
+++ linux-2.6.15/kernel/fork.c
@@ -849,10 +849,12 @@ asmlinkage long sys_set_tid_address(int 
 	current->clear_child_tid = tidptr;
 
 	return current->pid;
 }
 
+extern spinlock_t proposed_global_lock;
+
 /*
  * This creates a new process as a copy of the old one,
  * but does not actually start it yet.
  *
  * It copies the registers, and all the appropriate
@@ -1137,12 +1139,14 @@ static task_t *copy_process(unsigned lon
 		p->signal->tty = NULL;
 
 	nr_threads++;
 	total_forks++;
 	write_unlock_irq(&tasklist_lock);
+	spin_lock(&proposed_global_lock);
 	proc_fork_connector(p);
 	cpuset_fork(p);
+	spin_unlock(&proposed_global_lock);
 	retval = 0;
 
 fork_out:
 	if (retval)
 		return ERR_PTR(retval);
Index: linux-2.6.15/kernel/exit.c
===================================================================
--- linux-2.6.15.orig/kernel/exit.c
+++ linux-2.6.15/kernel/exit.c
@@ -784,10 +784,11 @@ static void exit_notify(struct task_stru
 	/* If the process is dead, release it - nobody will wait for it */
 	if (state == EXIT_DEAD)
 		release_task(tsk);
 }
 
+extern spinlock_t proposed_global_lock;
 fastcall NORET_TYPE void do_exit(long code)
 {
 	struct task_struct *tsk = current;
 	int group_dead;
 
@@ -844,10 +845,12 @@ fastcall NORET_TYPE void do_exit(long co
 	if (group_dead) {
  		del_timer_sync(&tsk->signal->real_timer);
 		exit_itimers(tsk->signal);
 		acct_process(code);
 	}
+	spin_lock(&proposed_global_lock);
+	spin_unlock(&proposed_global_lock);
 	exit_mm(tsk);
 
 	exit_sem(tsk);
 	__exit_files(tsk);
 	__exit_fs(tsk);
Index: linux-2.6.15/fs/exec.c
===================================================================
--- linux-2.6.15.orig/fs/exec.c
+++ linux-2.6.15/fs/exec.c
@@ -1121,10 +1121,12 @@ int search_binary_handler(struct linux_b
 	return retval;
 }
 
 EXPORT_SYMBOL(search_binary_handler);
 
+extern spinlock_t proposed_global_lock;
+
 /*
  * sys_execve() executes a new program.
  */
 int do_execve(char * filename,
 	char __user *__user *argv,
@@ -1190,10 +1192,12 @@ int do_execve(char * filename,
 
 	retval = copy_strings(bprm->argc, argv, bprm);
 	if (retval < 0)
 		goto out;
 
+	spin_lock(&proposed_global_lock);
+	spin_unlock(&proposed_global_lock);
 	retval = search_binary_handler(bprm,regs);
 	if (retval >= 0) {
 		free_arg_pages(bprm);
 
 		/* execve success */
Index: linux-2.6.15/init/main.c
===================================================================
--- linux-2.6.15.orig/init/main.c
+++ linux-2.6.15/init/main.c
@@ -440,10 +440,11 @@ void __init parse_early_param(void)
 
 /*
  *	Activate the first processor.
  */
 
+spinlock_t proposed_global_lock = SPIN_LOCK_UNLOCKED;
 asmlinkage void __init start_kernel(void)
 {
 	char * command_line;
 	extern struct kernel_param __start___param[], __stop___param[];
 /*



  reply	other threads:[~2006-01-12 23:26 UTC|newest]

Thread overview: 53+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-01-03 23:16 [Patch 0/6] Per-task delay accounting Shailabh Nagar
2006-01-03 23:23 ` [Patch 1/6] Delay accounting: timespec diff Shailabh Nagar
2006-01-03 23:26 ` [Patch 2/6] Delay accounting: Initialization, kernel boot option Shailabh Nagar
2006-01-03 23:28 ` [Patch 3/6] Delay accounting: Sync block I/O delays Shailabh Nagar
2006-01-03 23:30 ` [Patch 4/6] Delay accounting: Swap in delays Shailabh Nagar
2006-01-03 23:31 ` [Patch 5/6] Delay accounting: /proc interface Shailabh Nagar
2006-01-03 23:33 ` [Patch 6/6] Delay accounting: Connector interface Shailabh Nagar
2006-01-04  0:21   ` Greg KH
2006-01-04  0:42     ` Shailabh Nagar
2006-01-04  0:51       ` Greg KH
2006-01-04  7:49         ` [Lse-tech] " Shailabh Nagar
2006-01-04 19:04   ` Jay Lan
2006-01-04 21:31     ` Shailabh Nagar
2006-01-04 22:40     ` [ckrm-tech] " Matt Helsley
2006-01-04 23:17       ` Andrew Morton
2006-01-05 18:42         ` [PATCH 00/01] Move Exit Connectors Matt Helsley
2006-01-05 19:17           ` [PATCH 01/01][RFC] " Matt Helsley
2006-01-05 19:20           ` [PATCH 00/01] " Matt Helsley
2006-01-05 23:10             ` Andrew Morton
2006-01-06  0:06               ` [ckrm-tech] " Matt Helsley
2006-01-06  8:57                 ` [Lse-tech] " Jes Sorensen
2006-01-06 16:45                   ` Shailabh Nagar
2006-01-11 10:36                     ` Jes Sorensen
2006-01-11 12:56                       ` John Hesterberg
2006-01-11 13:50                         ` Jes Sorensen
2006-01-11 21:02                       ` Matt Helsley
2006-01-11 21:39                         ` John Hesterberg
2006-01-11 22:42                           ` Matt Helsley
2006-01-12 10:01                             ` Jes Sorensen
2006-01-12 23:20                               ` Matt Helsley [this message]
2006-01-13  9:35                                 ` Jes Sorensen
2006-01-14  7:23                                   ` Matt Helsley
2006-01-12  3:29                           ` Keith Owens
2006-01-12  5:04                             ` Paul E. McKenney
2006-01-12  5:38                               ` Keith Owens
2006-01-12  6:19                               ` Keith Owens
2006-01-12  6:51                                 ` Paul E. McKenney
2006-01-12  7:50                                   ` Keith Owens
2006-01-12 15:17                                     ` Paul E. McKenney
2006-01-17 17:26                                       ` Paul E. McKenney
2006-01-17 23:57                                         ` Keith Owens
2006-01-18  2:49                                           ` Paul E. McKenney
2006-01-18  2:55                                             ` Lee Revell
2006-01-18  6:29                                               ` Paul E. McKenney
2006-01-12  5:26                             ` Matt Helsley
2006-01-12  5:45                               ` Keith Owens
2006-01-12  9:51                         ` Jes Sorensen
2006-01-12 23:01                           ` Matt Helsley
2006-01-13  9:59                             ` Jes Sorensen
2006-01-13 10:38                             ` Jes Sorensen
2006-01-13 23:22                               ` Matt Helsley
2006-01-12 23:49                       ` Matt Helsley
2006-01-05  0:01       ` [ckrm-tech] Re: [Patch 6/6] Delay accounting: Connector interface Shailabh Nagar

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=1137108030.6673.255.camel@stark \
    --to=matthltc@us.ibm.com \
    --cc=akpm@osdl.org \
    --cc=ckrm-tech@lists.sourceforge.net \
    --cc=elsa-devel@lists.sourceforge.net \
    --cc=erikj@sgi.com \
    --cc=jes@trained-monkey.org \
    --cc=jh@sgi.com \
    --cc=jlan@engr.sgi.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=lse-tech@lists.sourceforge.net \
    --cc=nagar@watson.ibm.com \
    --cc=pj@sgi.com \
    --cc=steiner@sgi.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;
as well as URLs for NNTP newsgroup(s).