linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: "David S. Miller" <davem@davemloft.net>
To: Dave Hansen <haveblue@us.ibm.com>
Cc: akpm@osdl.org, linux-mm@kvack.org, linux-kernel@vger.kernel.org,
	apw@shadowen.org
Subject: Re: [PATCH 0/4] sparsemem intro patches
Date: Mon, 14 Mar 2005 14:33:23 -0800	[thread overview]
Message-ID: <20050314143323.6c66dfc3.davem@davemloft.net> (raw)
In-Reply-To: <1110838711.19340.58.camel@localhost>

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, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"aart@kvack.org"> aart@kvack.org </a>

  reply	other threads:[~2005-03-14 22:33 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-03-14 21:14 Dave Hansen
2005-03-14 21:50 ` David S. Miller
2005-03-14 22:18   ` Dave Hansen
2005-03-14 22:33     ` David S. Miller [this message]
2005-03-15  2:30 ` Andrew Morton
2005-03-15  3:53   ` Dave Hansen
2005-03-15 14:56   ` Martin J. Bligh
2005-03-17 16:21   ` Andy Whitcroft
2005-03-19 19:33 ` Pavel Machek
2005-03-28 21:23   ` Dave Hansen
2005-03-28 22:22     ` Pavel Machek

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20050314143323.6c66dfc3.davem@davemloft.net \
    --to=davem@davemloft.net \
    --cc=akpm@osdl.org \
    --cc=apw@shadowen.org \
    --cc=haveblue@us.ibm.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox