mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "Julio M. Merino Vidal" <jmerino@ac.upc.edu>
To: linux-kernel@vger.kernel.org
Subject: Per-CPU data as a structure
Date: Thu, 3 May 2007 17:16:17 +0200	[thread overview]
Message-ID: <16C35E62-A26F-49FC-9CD8-7BADFCD97BA5@ac.upc.edu> (raw)

Hello,

At the moment, data specific to a CPU is stored in different, fixed- 
size separate arrays by means of the "percpu framework".  I'm working  
on some changes to modify the way some CPUs are represented, and I'm  
wondering what's the rationale behind such a representation.

At first sight, it'd seem more reasonable to have a structure holding  
all the information that is CPU-specific (as is done with any object  
represented within the system).  After searching the mail archives, I  
see that similar changes were proposed before, but those threads did  
not seem to get any reply (so I'm assuming that the changes were not  
desired).

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).

Part of my changes introduce a new structure that is able to  
represent any kind of CPU (and which each platform can extend to add  
new information to it).  It is supposed to supersede the per-cpu  
definitions.  I bet this could also be redone by using percpu in some  
way...  The thing is I am willing to share my work when I've finished  
it (it is still very much work-in-progress), but first I'm interested  
to know if adding this new structure is a crazy idea (meaning I  
should stick to percpu wherever possible) or something that can be  
accepted later on.

Summarizing, my questions are:
- Why is the code currently using multiple separate arrays (percpu)
   to hold CPU information instead of a structure?
- Could this structure-based approach (instead of all these separate
   arrays) be considered for inclusion into the system?

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.  Also, I seem to understand that there are performance  
advantages related to this.  But on the other hand, percpu seems like  
an unnatural approach to "reimplement" regular structures.

Thank you very much.

-- 
Julio M. Merino Vidal <jmerino@ac.upc.edu>



             reply	other threads:[~2007-05-03 15:48 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-05-03 15:16 Julio M. Merino Vidal [this message]
2007-05-03 17:19 ` Andi Kleen
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=16C35E62-A26F-49FC-9CD8-7BADFCD97BA5@ac.upc.edu \
    --to=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 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®