Re: + pg_uncached-is-ia64-only.patch added to -mm tree

From: KAMEZAWA Hiroyuki
Date: Fri Apr 07 2006 - 01:39:09 EST


On Thu, 6 Apr 2006 21:52:42 -0700
Andrew Morton <akpm@xxxxxxxx> wrote:

> KAMEZAWA Hiroyuki <kamezawa.hiroyu@xxxxxxxxxxxxxx> wrote:
>
> -#define FLAGS_RESERVED 32
> +#define FLAGS_RESERVED 24
>

Oh..we get more 8bits flags on 64bit machines !!!
but could you reserve 30bits now ?

This is my understanding..
==
At the first look, SPARSEMEM with ia64

#define SECTION_SIZE_BITS (30)
#define MAX_PHYSMEM_BITS (50)

so SECTIONS_SHIFT = 50 - 30 = 20bits.

20bits of page->flags is used for SPARSEMEM's section id.

sgi have NODES_SHIFT=8, and always ZONES_SHIFT=2 .

At worst, 20 + 8 + 2 = 30bits should be used. but..

extra code is here..
==
#if SECTIONS_WIDTH+ZONES_WIDTH+NODES_SHIFT <= FLAGS_RESERVED
#define NODES_WIDTH NODES_SHIFT
#else
#define NODES_WIDTH 0
#endif
==
So, node-id is not encoded into flags.
In this case,
==
<snip>
#define FLAGS_HAS_NODE (NODES_WIDTH > 0 || NODES_SHIFT == 0)

<snip>
static inline unsigned long page_to_nid(struct page *page)
{
if (FLAGS_HAS_NODE)
return (page->flags >> NODES_PGSHIFT) & NODES_MASK;
else
return page_zone(page)->zone_pgdat->node_id;
}
==
page_zone(page) looks up zone from zone_table[].
If FLAGS_HAS_NODE=0, zone_table indexing is this.
==

(page->flags >> (offset of zone bit)) & ((1 << (SECTIONS_SHIFT + ZONES_SHIFT)) - 1)

See above, SECTIONS_SHIFT + ZONES_SHIFT = 22bits.

so, many ia64 people has to use 32M(22bits * 8bytes) zone_table[] ???
please fix if I'm wrong ...this is complicated.

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