mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* Re: [patch] remove direct mem_map refs for x86-64
  2004-11-03 16:47 [patch] remove direct mem_map refs for x86-64 Matt Tolentino
@ 2004-11-03 16:32 ` Arjan van de Ven
  2004-11-03 17:02   ` Andi Kleen
  2004-11-03 17:01 ` Andi Kleen
  1 sibling, 1 reply; 6+ messages in thread
From: Arjan van de Ven @ 2004-11-03 16:32 UTC (permalink / raw)
  To: Matt Tolentino; +Cc: ak, linux-kernel

On Wed, 2004-11-03 at 08:47 -0800, Matt Tolentino wrote:
> -                       page = pgdat->node_mem_map + i;
> -		total++;
> +			page = pfn_to_page(pgdat->node_start_pfn + i);
> +			total++;

this can't be correct... pfn_to_page starts to count from address 0
while the original code starts from the start of the node..



^ permalink raw reply	[flat|nested] 6+ messages in thread

* [patch] remove direct mem_map refs for x86-64
@ 2004-11-03 16:47 Matt Tolentino
  2004-11-03 16:32 ` Arjan van de Ven
  2004-11-03 17:01 ` Andi Kleen
  0 siblings, 2 replies; 6+ messages in thread
From: Matt Tolentino @ 2004-11-03 16:47 UTC (permalink / raw)
  To: ak; +Cc: linux-kernel

Hi Andi,

No real functional change here.  Just use the pfn_to_page
macros instead of directly indexing into the mem_map. 
Patch is against 2.6.10-rc1-mm2.  Please consider...

matt

Signed-off-by: Matt Tolentino <matthew.e.tolentino@intel.com>

This removes all but one direct reference to mem_map
for x86-64.  This is needed on systems where we 
break the mem_map up and directly indexing into 
mem_map to get the page structure doesn't work anymore.


diff -urN linux-2.6.10-rc1-mm2-vanilla/arch/x86_64/mm/init.c linux-2.6.10-rc1-mm2/arch/x86_64/mm/init.c
--- linux-2.6.10-rc1-mm2-vanilla/arch/x86_64/mm/init.c	2004-11-03 06:40:21.501214144 -0500
+++ linux-2.6.10-rc1-mm2/arch/x86_64/mm/init.c	2004-11-03 06:20:34.000000000 -0500
@@ -68,8 +68,8 @@
 
 	for_each_pgdat(pgdat) {
                for (i = 0; i < pgdat->node_spanned_pages; ++i) {
-                       page = pgdat->node_mem_map + i;
-		total++;
+			page = pfn_to_page(pgdat->node_start_pfn + i);
+			total++;
                        if (PageReserved(page))
 			reserved++;
                        else if (PageSwapCache(page))
@@ -466,7 +466,7 @@
 		/*
 		 * Only count reserved RAM pages
 		 */
-		if (page_is_ram(tmp) && PageReserved(mem_map+tmp))
+		if (page_is_ram(tmp) && PageReserved(pfn_to_page(tmp)))
 			reservedpages++;
 #endif
 

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [patch] remove direct mem_map refs for x86-64
  2004-11-03 16:47 [patch] remove direct mem_map refs for x86-64 Matt Tolentino
  2004-11-03 16:32 ` Arjan van de Ven
@ 2004-11-03 17:01 ` Andi Kleen
  1 sibling, 0 replies; 6+ messages in thread
From: Andi Kleen @ 2004-11-03 17:01 UTC (permalink / raw)
  To: Matt Tolentino; +Cc: ak, linux-kernel

On Wed, Nov 03, 2004 at 08:47:48AM -0800, Matt Tolentino wrote:
> Hi Andi,
> 
> No real functional change here.  Just use the pfn_to_page
> macros instead of directly indexing into the mem_map. 
> Patch is against 2.6.10-rc1-mm2.  Please consider...

Thanks looks good. I put it into my tree.

-Andi

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [patch] remove direct mem_map refs for x86-64
  2004-11-03 16:32 ` Arjan van de Ven
@ 2004-11-03 17:02   ` Andi Kleen
  2004-11-03 17:09     ` Arjan van de Ven
  0 siblings, 1 reply; 6+ messages in thread
From: Andi Kleen @ 2004-11-03 17:02 UTC (permalink / raw)
  To: Arjan van de Ven; +Cc: Matt Tolentino, ak, linux-kernel

On Wed, Nov 03, 2004 at 05:32:47PM +0100, Arjan van de Ven wrote:
> On Wed, 2004-11-03 at 08:47 -0800, Matt Tolentino wrote:
> > -                       page = pgdat->node_mem_map + i;
> > -		total++;
> > +			page = pfn_to_page(pgdat->node_start_pfn + i);
> > +			total++;
> 
> this can't be correct... pfn_to_page starts to count from address 0
> while the original code starts from the start of the node..

That is why he adds node_start_pfn

-Andi

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [patch] remove direct mem_map refs for x86-64
  2004-11-03 17:02   ` Andi Kleen
@ 2004-11-03 17:09     ` Arjan van de Ven
  0 siblings, 0 replies; 6+ messages in thread
From: Arjan van de Ven @ 2004-11-03 17:09 UTC (permalink / raw)
  To: Andi Kleen; +Cc: Matt Tolentino, linux-kernel

On Wed, 2004-11-03 at 18:02 +0100, Andi Kleen wrote:
> On Wed, Nov 03, 2004 at 05:32:47PM +0100, Arjan van de Ven wrote:
> > On Wed, 2004-11-03 at 08:47 -0800, Matt Tolentino wrote:
> > > -                       page = pgdat->node_mem_map + i;
> > > -		total++;
> > > +			page = pfn_to_page(pgdat->node_start_pfn + i);
> > > +			total++;
> > 
> > this can't be correct... pfn_to_page starts to count from address 0
> > while the original code starts from the start of the node..
> 
> That is why he adds node_start_pfn

DOH yes; sorry.



^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [patch] remove direct mem_map refs for x86-64
@ 2004-11-03 17:24 Matt Tolentino
  0 siblings, 0 replies; 6+ messages in thread
From: Matt Tolentino @ 2004-11-03 17:24 UTC (permalink / raw)
  To: arjan, metolent; +Cc: ak, linux-kernel

>From SRS0+fff01e338c482ba0c24b+437+infradead.org+arjan@canuck.srs.infradead.org  Wed Nov  3 08:54:21 2004
>On Wed, 2004-11-03 at 08:47 -0800, Matt Tolentino wrote:
>> -                       page = pgdat->node_mem_map + i;
>> -		total++;
>> +			page = pfn_to_page(pgdat->node_start_pfn + i);
>> +			total++;
>
>this can't be correct... pfn_to_page starts to count from address 0
>while the original code starts from the start of the node..

Yep, you're right.  I've been thinking about single nodes too much
lately.

matt


diff -urN linux-2.6.10-rc1-mm2-vanilla/arch/x86_64/mm/init.c linux-2.6.10-rc1-mm2/arch/x86_64/mm/init.c
--- linux-2.6.10-rc1-mm2-vanilla/arch/x86_64/mm/init.c	2004-11-03 06:50:01.939974040 -0500
+++ linux-2.6.10-rc1-mm2/arch/x86_64/mm/init.c	2004-11-03 07:26:15.922478464 -0500
@@ -466,7 +466,7 @@
 		/*
 		 * Only count reserved RAM pages
 		 */
-		if (page_is_ram(tmp) && PageReserved(mem_map+tmp))
+		if (page_is_ram(tmp) && PageReserved(pfn_to_page(tmp)))
 			reservedpages++;
 #endif
 

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2004-11-03 17:13 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-11-03 16:47 [patch] remove direct mem_map refs for x86-64 Matt Tolentino
2004-11-03 16:32 ` Arjan van de Ven
2004-11-03 17:02   ` Andi Kleen
2004-11-03 17:09     ` Arjan van de Ven
2004-11-03 17:01 ` Andi Kleen
2004-11-03 17:24 Matt Tolentino

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®