2006-01-11 01:27:19

by Greg Ungerer

[permalink] [raw]
Subject: [PATCH] remove uneccesary page++

Remove unecessary page++ from memmap_init_zone loop.

Signed-off-by: Greg Ungerer <[email protected]>


--- linux-2.6.15/mm/page_alloc.c 2006-01-03 13:21:10.000000000 +1000
+++ linux-2.6.15-uc0/mm/page_alloc.c 2006-01-11 11:16:46.981376296 +1000
@@ -1706,7 +1706,7 @@
unsigned long end_pfn = start_pfn + size;
unsigned long pfn;

- for (pfn = start_pfn; pfn < end_pfn; pfn++, page++) {
+ for (pfn = start_pfn; pfn < end_pfn; pfn++) {
if (!early_pfn_valid(pfn))
continue;
if (!early_pfn_in_nid(pfn, nid))


2006-01-11 02:16:00

by Dave Hansen

[permalink] [raw]
Subject: Re: [PATCH] remove uneccesary page++

On Wed, 2006-01-11 at 11:28 +1000, Greg Ungerer wrote:
> Remove unecessary page++ from memmap_init_zone loop.
>
> Signed-off-by: Greg Ungerer <[email protected]>
>
>
> --- linux-2.6.15/mm/page_alloc.c 2006-01-03 13:21:10.000000000 +1000
> +++ linux-2.6.15-uc0/mm/page_alloc.c 2006-01-11 11:16:46.981376296 +1000
> @@ -1706,7 +1706,7 @@
> unsigned long end_pfn = start_pfn + size;
> unsigned long pfn;
>
> - for (pfn = start_pfn; pfn < end_pfn; pfn++, page++) {
> + for (pfn = start_pfn; pfn < end_pfn; pfn++) {
> if (!early_pfn_valid(pfn))
> continue;
> if (!early_pfn_in_nid(pfn, nid))

You're right. Somebody missed that when we made it re-calculate the
struct page each time. Probably from the sparsemem updates. You could
also take the page variable and just declare it inside that loop. The
use appears to be local there.

for (pfn = start_pfn; pfn < end_pfn; pfn++) {
struct page *page;
if (!early_pfn_valid(pfn))
continue;
if (!early_pfn_in_nid(pfn, nid))
continue;
page = pfn_to_page(pfn);


-- Dave