mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Christoph Lameter <clameter@engr.sgi.com>
To: Ravikiran G Thirumalai <kiran@scalex86.org>
Cc: Andrew Morton <akpm@osdl.org>,
	linux-kernel@vger.kernel.org,
	"Shai Fultheim (Shai@scalex86.org)" <shai@scalex86.org>,
	nippung@calsoftinc.com
Subject: Re: [rfc][patch] Avoid taking global tasklist_lock for single threaded process at getrusage()
Date: Wed, 21 Dec 2005 12:20:20 -0800 (PST)	[thread overview]
Message-ID: <Pine.LNX.4.62.0512211209300.2829@schroedinger.engr.sgi.com> (raw)
In-Reply-To: <20051221182320.GA4514@localhost.localdomain>

On Wed, 21 Dec 2005, Ravikiran G Thirumalai wrote:

> Following patch avoids taking the global tasklist_lock when possible,
> if a process is single threaded during getrusage().  Any avoidance of 
> tasklist_lock is good for NUMA boxes (and possibly for large SMPs).  We found 
> that this optimization reduces the runtime of a certain scientific application 
> by half on a 16 cpu NUMA box.
> 
> This optimization is similar to the sys_times tasklist_lock optimization.

The optimization of sys_times is only possible because the "current" 
task is running and therefore guarantees that the thread will not be 
exiting.

getrusage and k_getrusage can be called onother tasks than the currently 
executing task and in those cases better take the tasklist lock because 
the task may exit while getrusage runs.

See wait_noreap_copyout() in kernel/exit.c and 
arch/mips/kernel/{sysirix,irixsig}.c for uses of getrusage where the 
struct task_struct * != current.

Maybe you can deal with these and insure that getrusage is always called 
for the current process? In that case the struct task_struct * parameter
needs to be dropped from getrusage and k_getrusage.


  reply	other threads:[~2005-12-21 20:20 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-12-21 18:23 Ravikiran G Thirumalai
2005-12-21 20:20 ` Christoph Lameter [this message]
2005-12-21 21:11   ` Ravikiran G Thirumalai
2005-12-21 21:22     ` Christoph Lameter
2005-12-21 21:35       ` Ravikiran G Thirumalai
2005-12-23 23:15       ` Ravikiran G Thirumalai
2005-12-24  0:13         ` Christoph Lameter
2005-12-24  5:34 Nippun Goel
2005-12-24 17:52 Oleg Nesterov
2005-12-27 20:21 ` Christoph Lameter

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=Pine.LNX.4.62.0512211209300.2829@schroedinger.engr.sgi.com \
    --to=clameter@engr.sgi.com \
    --cc=akpm@osdl.org \
    --cc=kiran@scalex86.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=nippung@calsoftinc.com \
    --cc=shai@scalex86.org \
    /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

all inboxes | Powered by JetHome®