lkml.org 
[lkml]   [2005]   [Mar]   [14]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH 0/4] sparsemem intro patches
On Mon, 14 Mar 2005 14:18:31 -0800
Dave Hansen <haveblue@us.ibm.com> wrote:

> Those bits are used today for page_zone() and page_to_nid(). I assume
> that you don't support NUMA, but how do you get around the page_zone()
> definition? (a quick grep in asm-sparc64 didn't show anything obvious)
>
> static inline struct zone *page_zone(struct page *page)
> {
> return zone_table[page->flags >> NODEZONE_SHIFT];
> }

NODEZONE_SHIFT is (64 /* sizeof(page_flags_t)*8 */ -
1 /* MAX_NODES_SHIFT */ -
2 /* MAX_ZONES_SHIFT */)

Which means the table is indexed by the top 3 bits of page->flags.
Sparc64 only uses a couple bits (specifically, enough to hold
(NR_CPUS - 1)) starting at bit 24, so this should not intersect
the page_zone() usage.

I don't even accidently modify those bits when setting and clearing
this cpu field.

However, I do notice that I assume NR_CPUS is a power of two. I should
certainly cure that. (Basically, I use ~(NR_CPUS - 1) as a mask).

> BTW, in theory, the new patch should allow page->flags to be better
> managed by a variety of users, including special arch users. An
> architecture should be able to relatively easily add the necessary
> pieces to reserve them. We could even have a ARCH_RESERVED_BITS macro
> or something.

That sounds like a great idea. We have several issues like this, perhaps
it's time to create some abstraction accessors via include/asm-*/page-flags.h
The platform can specify the type and size or whatever of page_flags_t, how
to stick node and zone numbers into the field, and whatever else. Furthermore,
we can have an asm-generic/page-flags.h that most folks can just use and
replicates what occurs right now.

That may be overkill, however.
-
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: 2005-03-22 14:11    [W:0.345 / U:0.268 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site