lkml.org 
[lkml]   [2006]   [Jun]   [12]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [SPARSEMEM] confusing uses of SPARSEM_EXTREME (try #2)
Hi Andy

2006/6/12, Andy Whitcroft <apw@shadowen.org>:
>
> In my mind the positive option is selecting for code supporting EXTREME
> so it seems to make sense to use that option.

well I find it confusing because in my mind, something like this seems
more logical.

#ifndef CONFIG_SPARSEMEM_STATIC
static struct mem_section *sparse_index_alloc(int nid)
{
return alloc_bootmem_node(...);
}
#else
static struct mem_section *sparse_index_alloc(int nid)
{
/* nothing to do here, since it has been statically allocated */
return 0;
}
#endif

This code only deals with section allocation and the way it's achieved
depends only if the section array has been statically allocated.
There's nothing related on the two-level lookups here, is there ?

And use SPARSEMEM_EXTREME when it deals only with two-level lookups:

#ifdef CONFIG_SPARSEMEM_EXTREME
#define SECTIONS_PER_ROOT (PAGE_SIZE / sizeof (struct mem_section))
#else
#define SECTIONS_PER_ROOT 1
#endif

> Perhaps the confusion
> comes from a lack of comments there to say that the else case is STATIC.
>

nope but maybe a comment to explain why i386 use SPARSEMEM_STATIC
option could be useful. At least for someone who is not working on
this arch...

Thanks
--
Franck
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2006-06-12 19:24    [W:0.048 / U:1.232 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site