All of lore.kernel.org
 help / color / mirror / Atom feed
* trying to avoid "#ifdef CONFIG_NUMA"?
@ 2008-04-07 11:45 Robert P. J. Day
  2008-04-07 12:43 ` Matthew Wilcox
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Robert P. J. Day @ 2008-04-07 11:45 UTC (permalink / raw)
  To: kernel-janitors


  from <linux/kernel.h>:

/* This helps us to avoid #ifdef CONFIG_NUMA */
#ifdef CONFIG_NUMA
#define NUMA_BUILD 1
#else
#define NUMA_BUILD 0
#endif

  however, there's still a pile of that preprocessor directive
scattered throughout the kernel.  what kind of "avoidance" are we
talking about here?

$ grep -r "#ifdef CONFIG_NUMA" * | wc -l
159

$ grep -rw NUMA_BUILD *
include/linux/kernel.h:#define NUMA_BUILD 1
include/linux/kernel.h:#define NUMA_BUILD 0
mm/page_alloc.c:                if (NUMA_BUILD && zlc_active &&
mm/page_alloc.c:                if (NUMA_BUILD)
mm/page_alloc.c:                if (NUMA_BUILD && !did_zlc_setup) {
mm/page_alloc.c:        if (unlikely(NUMA_BUILD && page = NULL && zlc_active)) {
mm/page_alloc.c:        if (NUMA_BUILD && (gfp_mask & GFP_THISNODE) = GFP_THISNODE)
mm/page_alloc.c:        if (NUMA_BUILD)
$

  not a lot of avoiding going on there, i'd say.

rday
--

====================================
Robert P. J. Day
Linux Consulting, Training and Annoying Kernel Pedantry:
    Have classroom, will lecture.

http://crashcourse.ca                          Waterloo, Ontario, CANADA
====================================

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: trying to avoid "#ifdef CONFIG_NUMA"?
  2008-04-07 11:45 trying to avoid "#ifdef CONFIG_NUMA"? Robert P. J. Day
@ 2008-04-07 12:43 ` Matthew Wilcox
  2008-04-07 12:56 ` Robert P. J. Day
  2008-04-12 11:28 ` Vegard Nossum
  2 siblings, 0 replies; 4+ messages in thread
From: Matthew Wilcox @ 2008-04-07 12:43 UTC (permalink / raw)
  To: kernel-janitors

On Mon, Apr 07, 2008 at 07:45:01AM -0400, Robert P. J. Day wrote:
> /* This helps us to avoid #ifdef CONFIG_NUMA */
> #ifdef CONFIG_NUMA
> #define NUMA_BUILD 1
> #else
> #define NUMA_BUILD 0
> #endif

> mm/page_alloc.c:                if (NUMA_BUILD && zlc_active &&
> 
>   not a lot of avoiding going on there, i'd say.

but it's important where it happens.  it would uglify the code
significantly to replace the if (NUMA_BUILD) with #ifdef CONFIG_NUMA.
Maybe NUMA_BUILD should be used in more places, but how about doing
something useful instead?

-- 
Intel are signing my paycheques ... these opinions are still mine
"Bill, look, we understand that you're interested in selling us this
operating system, but compare it to ours.  We can't possibly take such
a retrograde step."

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: trying to avoid "#ifdef CONFIG_NUMA"?
  2008-04-07 11:45 trying to avoid "#ifdef CONFIG_NUMA"? Robert P. J. Day
  2008-04-07 12:43 ` Matthew Wilcox
@ 2008-04-07 12:56 ` Robert P. J. Day
  2008-04-12 11:28 ` Vegard Nossum
  2 siblings, 0 replies; 4+ messages in thread
From: Robert P. J. Day @ 2008-04-07 12:56 UTC (permalink / raw)
  To: kernel-janitors

On Mon, 7 Apr 2008, Matthew Wilcox wrote:

> On Mon, Apr 07, 2008 at 07:45:01AM -0400, Robert P. J. Day wrote:
> > /* This helps us to avoid #ifdef CONFIG_NUMA */
> > #ifdef CONFIG_NUMA
> > #define NUMA_BUILD 1
> > #else
> > #define NUMA_BUILD 0
> > #endif
>
> > mm/page_alloc.c:                if (NUMA_BUILD && zlc_active &&
> >
> >   not a lot of avoiding going on there, i'd say.
>
> but it's important where it happens.  it would uglify the code
> significantly to replace the if (NUMA_BUILD) with #ifdef
> CONFIG_NUMA. Maybe NUMA_BUILD should be used in more places, but how
> about doing something useful instead?

i wasn't planning on changing any of that, i was just trying to figure
out why the comment promoted "avoiding" the #ifdef when there was so
much of it still around.

rday
--

====================================
Robert P. J. Day
Linux Consulting, Training and Annoying Kernel Pedantry:
    Have classroom, will lecture.

http://crashcourse.ca                          Waterloo, Ontario, CANADA
====================================

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: trying to avoid "#ifdef CONFIG_NUMA"?
  2008-04-07 11:45 trying to avoid "#ifdef CONFIG_NUMA"? Robert P. J. Day
  2008-04-07 12:43 ` Matthew Wilcox
  2008-04-07 12:56 ` Robert P. J. Day
@ 2008-04-12 11:28 ` Vegard Nossum
  2 siblings, 0 replies; 4+ messages in thread
From: Vegard Nossum @ 2008-04-12 11:28 UTC (permalink / raw)
  To: kernel-janitors

On Mon, Apr 7, 2008 at 2:56 PM, Robert P. J. Day <rpjday@crashcourse.ca> wrote:
> On Mon, 7 Apr 2008, Matthew Wilcox wrote:
>
>  > On Mon, Apr 07, 2008 at 07:45:01AM -0400, Robert P. J. Day wrote:
>  > > /* This helps us to avoid #ifdef CONFIG_NUMA */
>  > > #ifdef CONFIG_NUMA
>  > > #define NUMA_BUILD 1
>  > > #else
>  > > #define NUMA_BUILD 0
>  > > #endif
>  >
>  > > mm/page_alloc.c:                if (NUMA_BUILD && zlc_active &&
>  > >
>  > >   not a lot of avoiding going on there, i'd say.
>  >
>  > but it's important where it happens.  it would uglify the code
>  > significantly to replace the if (NUMA_BUILD) with #ifdef
>  > CONFIG_NUMA. Maybe NUMA_BUILD should be used in more places, but how
>  > about doing something useful instead?
>
>  i wasn't planning on changing any of that, i was just trying to figure
>  out why the comment promoted "avoiding" the #ifdef when there was so
>  much of it still around.

It avoids it in the sense that you can now use NUMA_BUILD in
expression, as opposed to CONFIG_NUMA, which won't take the value 0 if
it's =n. It is not intended to replace CONFIG_NUMA when it is not used
inside expressions. (That's my understanding of it anyway).

Vegard

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2008-04-12 11:28 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-04-07 11:45 trying to avoid "#ifdef CONFIG_NUMA"? Robert P. J. Day
2008-04-07 12:43 ` Matthew Wilcox
2008-04-07 12:56 ` Robert P. J. Day
2008-04-12 11:28 ` Vegard Nossum

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.