lkml.org 
[lkml]   [2009]   [Apr]   [1]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH UPDATED] percpu: use dynamic percpu allocator as the default percpu allocator

* Matthew Wilcox <matthew@wil.cx> wrote:

> On Wed, Apr 01, 2009 at 12:39:46PM -0700, Linus Torvalds wrote:
>
> > The thing is, things like "read_mostly" or "access_rarely" may
> > talk about how we access those individual variables, but you're
> > missing a _huge_ chunk of the puzzle if you ignore the
> > _correlations_ of those accesses with accesses to other
> > variables.
> >
> > The thign is, if you have variables 'a' and 'b', and they are
> > always accessed together, then it's probably worth it to put
> > them in the same cacheline.
>
> If you've got two global variables that are generally accessed
> together, they should probably be `annotated' as such by putting
> them in a struct.

It is certainly done so in a number of cases (say the RCU core and
the scheduler), but i dont think it should be forced or preferred in
any way.

IMHO it's equally good and clean code to have the global variables
separately at the top of a .c file. Sometimes it's cleaner.

Ingo


\
 
 \ /
  Last update: 2009-04-02 04:19    [W:0.108 / U:0.052 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site