From: Michael Ellerman <michael@ellerman.id.au>
To: Andy Whitcroft <apw@shadowen.org>
Cc: Andrew Morton <akpm@osdl.org>,
linux-kernel@vger.kernel.org, haveblue@us.ibm.com,
kravetz@us.ibm.com
Subject: Re: [PATCH] SPARSEMEM + NUMA can't handle unaligned memory regions?
Date: Wed, 10 May 2006 16:06:13 +1000 [thread overview]
Message-ID: <1147241173.8091.21.camel@localhost.localdomain> (raw)
In-Reply-To: <4460A6F3.5060303@shadowen.org>
[-- Attachment #1: Type: text/plain, Size: 1827 bytes --]
On Tue, 2006-05-09 at 15:28 +0100, Andy Whitcroft wrote:
> Andy Whitcroft wrote:
> > 3) record the nid -- when we record the memory present in the system we
> > are passed the nid.
> >
> > Somehow the last of these seems the most logical given we have the
> > correct information at the time we record that we need to instantiate
> > the section. So I had a quick go at something which seems to have come
> > out pretty clean. Attached is a completly untested patch to show what I
> > am proposing.
>
> Ok. Attached is a version which builds and boots. The patch looks
> pretty simple. Michael could you give it a spin on the broken machine
> for me.
Hey, it's not broken, it's just special :D
That works a treat, boots and otherwise seems fine.
> Signed-off-by: Andy Whitcroft <apw@shadowen.org>
> +/*
> + * During early boot we need to record the nid from which we will
> + * later allocate the section mem_map. Encode this into the section
> + * pointer. Overload the section_mem_map with this information.
> + */
> +static inline unsigned long sparse_encode_early_nid(int nid)
> +{
> + return (nid << SECTION_MAP_LAST_BIT);
> +}
> +
> +static inline int sparse_early_nid(struct mem_section *section)
> +{
> + unsigned long nid = section->section_mem_map;
> + return (nid >> SECTION_MAP_LAST_BIT);
> +}
What about just for readability: (in linux/mmzone.h)
#define SECTION_MARKED_PRESENT (1UL<<0)
#define SECTION_HAS_MEM_MAP (1UL<<1)
#define SECTION_MAP_LAST_BIT (1UL<<2)
#define SECTION_NID_SHIFT SECTION_MAP_LAST_BIT
cheers
--
Michael Ellerman
IBM OzLabs
wwweb: http://michael.ellerman.id.au
phone: +61 2 6212 1183 (tie line 70 21183)
We do not inherit the earth from our ancestors,
we borrow it from our children. - S.M.A.R.T Person
[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 191 bytes --]
next prev parent reply other threads:[~2006-05-10 6:06 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-05-09 7:03 Michael Ellerman
2006-05-09 8:32 ` Andy Whitcroft
2006-05-09 9:11 ` Michael Ellerman
2006-05-09 10:24 ` Andy Whitcroft
2006-05-09 13:34 ` Andy Whitcroft
2006-05-09 14:28 ` Andy Whitcroft
2006-05-09 16:26 ` Dave Hansen
2006-05-09 16:31 ` Andy Whitcroft
2006-05-10 6:06 ` Michael Ellerman [this message]
2006-05-10 10:51 ` [PATCH] sparsemem record nid during memory present Andy Whitcroft
2006-05-09 16:05 ` [PATCH] SPARSEMEM + NUMA can't handle unaligned memory regions? mike kravetz
2006-05-09 16:14 ` Andy Whitcroft
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=1147241173.8091.21.camel@localhost.localdomain \
--to=michael@ellerman.id.au \
--cc=akpm@osdl.org \
--cc=apw@shadowen.org \
--cc=haveblue@us.ibm.com \
--cc=kravetz@us.ibm.com \
--cc=linux-kernel@vger.kernel.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
all inboxes | Powered by JetHome®