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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Thu, 6 Apr 2006 21:52:42 -0700
Andrew Morton <[email protected]> wrote:

> KAMEZAWA Hiroyuki <[email protected]> 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 [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[Index of Archives]     [Kernel Newbies]     [Netfilter]     [Bugtraq]     [Photo]     [Stuff]     [Gimp]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Video 4 Linux]     [Linux for the blind]     [Linux Resources]
  Powered by Linux