All of lore.kernel.org
 help / color / mirror / Atom feed
From: Andi Kleen <andi@firstfloor.org>
To: "Julio M. Merino Vidal" <jmerino@ac.upc.edu>
Cc: linux-kernel@vger.kernel.org
Subject: Re: Per-CPU data as a structure
Date: 03 May 2007 19:19:21 +0200	[thread overview]
Message-ID: <p73ps5hx1t2.fsf@bingen.suse.de> (raw)
In-Reply-To: <16C35E62-A26F-49FC-9CD8-7BADFCD97BA5@ac.upc.edu>

"Julio M. Merino Vidal" <jmerino@ac.upc.edu> writes:
 
> Similarly, and if I understood it correctly, the PDA (Per-processor
> Data Area) also aims to do the above, but at the moment it only
> contains some fields and is not defined in all platforms.  There are
> still a lot of usages of the percpu functionality (such as, e.g., in
> kernel/sched.c).

PDA is an earlier version of percpu; it still can be more efficiently
accessed so it is kept for some low level code.
 
> As far as I can tell, the advantage of percpu is that you can define
> new "fields" anywhere in the code and independently from the rest of
> the system. 

- Independent maintenance as you noted
- Fast access and relatively compact code
- Avoids false sharing by keeping cache lines of different CPUs separate
- Doesn't waste a lot of memory in padding like NR_CPUs arrays usually
need to to avoid the previous point.

Any replacement that doesn't have these properties too will probably
be not useful.

-Andi


  reply	other threads:[~2007-05-03 16:21 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-05-03 15:16 Per-CPU data as a structure Julio M. Merino Vidal
2007-05-03 17:19 ` Andi Kleen [this message]
2007-05-04  8:36   ` Julio M. Merino Vidal
2007-05-04  8:55     ` Eric Dumazet
2007-05-04 14:07     ` Andi Kleen

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=p73ps5hx1t2.fsf@bingen.suse.de \
    --to=andi@firstfloor.org \
    --cc=jmerino@ac.upc.edu \
    --cc=linux-kernel@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.