All of lore.kernel.org
 help / color / mirror / Atom feed
From: Andi Kleen <ak@suse.de>
To: Christoph Lameter <clameter@sgi.com>
Cc: linux-arch@vger.kernel.org
Subject: Re: Better local_t implementation needed
Date: Fri, 20 Apr 2007 19:01:39 +0200	[thread overview]
Message-ID: <200704201901.39437.ak@suse.de> (raw)
In-Reply-To: <Pine.LNX.4.64.0704200903130.20232@schroedinger.engr.sgi.com>

On Friday 20 April 2007 18:10:32 Christoph Lameter wrote:

> 
> > Using local_t for per cpu counters is nice because then
> > one can use cpu_local_add() etc. and that generates very good 
> > code at least on x86 and a few other architectures. That would
> > then allow very cheap per CPU statistics, which are useful
> > in a number of subsystems (like networking or MM code)
> 
> Is the per cpu access fixed on x86? Last I checked it was not atomic.

With upcomming patches per cpu can be directly referenced using %fs/%gs
Then cpu_local_add() etc will be a single instruction that is atomic
regarding interrupts.

> Uhhh.... Yuck.
> 
> > Drawback will be larger code. 
> 
> Fix the per cpu area access instead?

That doesn't help on architectures that don't have r-m-w instructions
on memory (like all RISCSs)

-Andi

  reply	other threads:[~2007-04-20 17:04 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-04-20 10:56 Better local_t implementation needed Andi Kleen
2007-04-20 16:10 ` Christoph Lameter
2007-04-20 17:01   ` Andi Kleen [this message]
2007-04-20 17:05     ` Christoph Lameter
2007-04-20 18:31 ` Luck, Tony
2007-04-20 20:14   ` Andi Kleen
2007-04-20 20:27     ` Christoph Lameter
2007-04-20 21:25 ` Roman Zippel
2007-04-20 22:39   ` David Miller
2007-04-21  0:25     ` Christoph Lameter
2007-04-21  4:45       ` David Miller
     [not found] <617E1C2C70743745A92448908E030B2A015F2392@scsmsx411.amr.corp.intel.com>
2007-04-20 20:38 ` 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=200704201901.39437.ak@suse.de \
    --to=ak@suse.de \
    --cc=clameter@sgi.com \
    --cc=linux-arch@vger.kernel.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 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.