2007-01-26 18:39:15

by Christoph Lameter

[permalink] [raw]
Subject: Re: mm snapshot broken-out-2007-01-26-00-36.tar.gz uploaded

On Fri, 26 Jan 2007, Michal Piotrowski wrote:

> mm/page_alloc.c: In function 'nr_free_inactive_pages_node':
> mm/page_alloc.c:1588: error: 'struct zone' has no member named 'nr_inactive'
> mm/page_alloc.c:1589: error: 'struct zone' has no member named 'free_pages'
> make[1]: *** [mm/page_alloc.o] Error 1
> make: *** [mm] Error 2

I cannot get it to compile either:

christoph@schroedinger:~/software/linux/xx/linux-2.6.20-rc6$ make
mm/page_alloc.o
scripts/kconfig/conf -s arch/i386/Kconfig
Warning! Found recursive dependency: INET GFS2_FS_LOCKING_DLM SYSFS
OCFS2_FS INET
CHK include/linux/version.h
CHK include/linux/utsrelease.h
CC arch/i386/kernel/asm-offsets.s
In file included from include/linux/sched.h:87,
from include/linux/utsname.h:35,
from include/asm/elf.h:12,
from include/linux/elf.h:7,
from include/linux/module.h:15,
from include/linux/crypto.h:21,
from arch/i386/kernel/asm-offsets.c:7:
include/linux/nsproxy.h: In function 'preexit_task_namespaces':
include/linux/nsproxy.h:56: error: dereferencing pointer to incomplete
type
make[1]: *** [arch/i386/kernel/asm-offsets.s] Error 1
make: *** [prepare0] Error 2

but I would think that this would fix the compile errors that are my
responsibility (sort of .... patch was against rc6 and not against mm).
More when I track down the above issue:


mm-fixes to ZVC patches

Fix uses of free_pages

Signed-off-by: Christoph Lameter <[email protected]>

Index: linux-2.6.20-rc6/kernel/power/swsusp.c
===================================================================
--- linux-2.6.20-rc6.orig/kernel/power/swsusp.c 2007-01-26 10:32:05.000000000 -0800
+++ linux-2.6.20-rc6/kernel/power/swsusp.c 2007-01-26 10:32:24.000000000 -0800
@@ -230,7 +230,8 @@ int swsusp_shrink_memory(void)
for_each_zone (zone)
if (populated_zone(zone)) {
if (is_highmem(zone)) {
- highmem_size -= zone->free_pages;
+ highmem_size -=
+ zone_page_state(zone, NR_FREE_PAGES);
} else {
tmp -= zone->free_pages;
tmp += zone->lowmem_reserve[ZONE_NORMAL];
Index: linux-2.6.20-rc6/mm/page_alloc.c
===================================================================
--- linux-2.6.20-rc6.orig/mm/page_alloc.c 2007-01-26 10:32:19.000000000 -0800
+++ linux-2.6.20-rc6/mm/page_alloc.c 2007-01-26 10:32:27.000000000 -0800
@@ -1581,12 +1581,12 @@ unsigned int nr_free_pagecache_pages(voi
unsigned long nr_free_inactive_pages_node(int nid)
{
enum zone_type i;
- unsigned long sum = 0;
+ unsigned long sum = node_page_state(nid, NR_FREE_PAGES)
+ + node_page_state(nid, NR_INACTIVE);
struct zone *zones = NODE_DATA(nid)->node_zones;

for (i = 0; i < MAX_NR_ZONES; i++)
- sum += zones[i].nr_inactive +
- zones[i].free_pages - zones[i].pages_low;
+ sum -= zones[i].pages_low;

return sum;
}


2007-01-26 18:43:35

by Pavel Machek

[permalink] [raw]
Subject: Re: mm snapshot broken-out-2007-01-26-00-36.tar.gz uploaded

Hi!

> but I would think that this would fix the compile errors that are my
> responsibility (sort of .... patch was against rc6 and not against mm).
> More when I track down the above issue:

...

> Signed-off-by: Christoph Lameter <[email protected]>
>
> Index: linux-2.6.20-rc6/kernel/power/swsusp.c
> ===================================================================
> --- linux-2.6.20-rc6.orig/kernel/power/swsusp.c 2007-01-26 10:32:05.000000000 -0800
> +++ linux-2.6.20-rc6/kernel/power/swsusp.c 2007-01-26 10:32:24.000000000 -0800
> @@ -230,7 +230,8 @@ int swsusp_shrink_memory(void)
> for_each_zone (zone)
> if (populated_zone(zone)) {
> if (is_highmem(zone)) {
> - highmem_size -= zone->free_pages;
> + highmem_size -=
> + zone_page_state(zone, NR_FREE_PAGES);
> } else {
> tmp -= zone->free_pages;

Does last line need similar conversion, too?
Pavel
--
(english) http://www.livejournal.com/~pavelmachek
(cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html

2007-01-26 18:45:53

by Michal Piotrowski

[permalink] [raw]
Subject: Re: mm snapshot broken-out-2007-01-26-00-36.tar.gz uploaded

On 26/01/07, Christoph Lameter <[email protected]> wrote:
> On Fri, 26 Jan 2007, Michal Piotrowski wrote:
>
> > mm/page_alloc.c: In function 'nr_free_inactive_pages_node':
> > mm/page_alloc.c:1588: error: 'struct zone' has no member named 'nr_inactive'
> > mm/page_alloc.c:1589: error: 'struct zone' has no member named 'free_pages'
> > make[1]: *** [mm/page_alloc.o] Error 1
> > make: *** [mm] Error 2
>
> I cannot get it to compile either:
>
> christoph@schroedinger:~/software/linux/xx/linux-2.6.20-rc6$ make
> mm/page_alloc.o
> scripts/kconfig/conf -s arch/i386/Kconfig
> Warning! Found recursive dependency: INET GFS2_FS_LOCKING_DLM SYSFS
> OCFS2_FS INET
> CHK include/linux/version.h
> CHK include/linux/utsrelease.h
> CC arch/i386/kernel/asm-offsets.s
> In file included from include/linux/sched.h:87,
> from include/linux/utsname.h:35,
> from include/asm/elf.h:12,
> from include/linux/elf.h:7,
> from include/linux/module.h:15,
> from include/linux/crypto.h:21,
> from arch/i386/kernel/asm-offsets.c:7:
> include/linux/nsproxy.h: In function 'preexit_task_namespaces':
> include/linux/nsproxy.h:56: error: dereferencing pointer to incomplete
> type
> make[1]: *** [arch/i386/kernel/asm-offsets.s] Error 1
> make: *** [prepare0] Error 2

Please try patches from
http://www.stardust.webpages.pl/files/tbf/euridica/mm-snapshot-2007-01-26/

http://www.stardust.webpages.pl/files/tbf/euridica/mm-snapshot-2007-01-26/bugs_and_patches.txt

Regards,
Michal

--
Michal K. K. Piotrowski
LTG - Linux Testers Group
(http://www.stardust.webpages.pl/ltg/)

2007-01-26 19:07:48

by Christoph Lameter

[permalink] [raw]
Subject: Re: mm snapshot broken-out-2007-01-26-00-36.tar.gz uploaded

On Fri, 26 Jan 2007, Michal Piotrowski wrote:

> Please try patches from
> http://www.stardust.webpages.pl/files/tbf/euridica/mm-snapshot-2007-01-26/
>
> http://www.stardust.webpages.pl/files/tbf/euridica/mm-snapshot-2007-01-26/bugs_and_patches.txt

Ahh. Okay that fixes most of the issues


ZVC writeback: Fix mm and other issues

This deals with swap prefetch and various things changed in mm.

Signed-off-by: Christoph Lameter <[email protected]>

Index: linux-2.6.20-rc6/kernel/power/swsusp.c
===================================================================
--- linux-2.6.20-rc6.orig/kernel/power/swsusp.c 2007-01-26 10:32:05.000000000 -0800
+++ linux-2.6.20-rc6/kernel/power/swsusp.c 2007-01-26 10:51:56.000000000 -0800
@@ -230,9 +230,10 @@ int swsusp_shrink_memory(void)
for_each_zone (zone)
if (populated_zone(zone)) {
if (is_highmem(zone)) {
- highmem_size -= zone->free_pages;
+ highmem_size -=
+ zone_page_state(zone, NR_FREE_PAGES);
} else {
- tmp -= zone->free_pages;
+ tmp -= zone_page_state(zone, NR_FREE_PAGES);
tmp += zone->lowmem_reserve[ZONE_NORMAL];
tmp += snapshot_additional_pages(zone);
}
Index: linux-2.6.20-rc6/mm/page_alloc.c
===================================================================
--- linux-2.6.20-rc6.orig/mm/page_alloc.c 2007-01-26 10:32:19.000000000 -0800
+++ linux-2.6.20-rc6/mm/page_alloc.c 2007-01-26 10:48:04.000000000 -0800
@@ -1581,12 +1581,12 @@ unsigned int nr_free_pagecache_pages(voi
unsigned long nr_free_inactive_pages_node(int nid)
{
enum zone_type i;
- unsigned long sum = 0;
+ unsigned long sum = node_page_state(nid, NR_FREE_PAGES)
+ + node_page_state(nid, NR_INACTIVE);
struct zone *zones = NODE_DATA(nid)->node_zones;

for (i = 0; i < MAX_NR_ZONES; i++)
- sum += zones[i].nr_inactive +
- zones[i].free_pages - zones[i].pages_low;
+ sum -= zones[i].pages_low;

return sum;
}
@@ -1634,7 +1634,8 @@ void si_meminfo_node(struct sysinfo *val
val->freeram = node_page_state(nid, NR_FREE_PAGES);
#ifdef CONFIG_HIGHMEM
val->totalhigh = pgdat->node_zones[ZONE_HIGHMEM].present_pages;
- val->freehigh = pgdat->node_zones[ZONE_HIGHMEM].free_pages;
+ val->freehigh = zone_page_state(&pgdat->node_zones[ZONE_HIGHMEM],
+ NR_FREE_PAGES);
#else
val->totalhigh = 0;
val->freehigh = 0;
Index: linux-2.6.20-rc6/mm/swap_prefetch.c
===================================================================
--- linux-2.6.20-rc6.orig/mm/swap_prefetch.c 2007-01-26 10:51:53.000000000 -0800
+++ linux-2.6.20-rc6/mm/swap_prefetch.c 2007-01-26 10:51:56.000000000 -0800
@@ -281,7 +281,7 @@ static void examine_free_limits(void)
ns->lowfree[idx] = z->pages_high * 3;
ns->highfree[idx] = ns->lowfree[idx] + z->pages_high;

- if (z->free_pages > ns->highfree[idx]) {
+ if (zone_page_state(z, NR_FREE_PAGES) > ns->highfree[idx]) {
/*
* We've gotten above the high watermark of free pages
* so we can start prefetching till we get to the low
@@ -338,7 +338,7 @@ static int prefetch_suitable(void)
ns = &sp_stat.node[node];
idx = zone_idx(z);

- free = z->free_pages;
+ free = zone_page_state(z, NR_FREE_PAGES);
if (free < *ns->pointfree[idx]) {
/*
* Free pages have dropped below the low watermark so
Index: linux-2.6.20-rc6/include/linux/mm_inline.h
===================================================================
--- linux-2.6.20-rc6.orig/include/linux/mm_inline.h 2007-01-26 10:58:53.000000000 -0800
+++ linux-2.6.20-rc6/include/linux/mm_inline.h 2007-01-26 10:58:59.000000000 -0800
@@ -16,7 +16,7 @@ static inline void
add_page_to_inactive_list_tail(struct zone *zone, struct page *page)
{
list_add_tail(&page->lru, &zone->inactive_list);
- zone->nr_inactive++;
+ __inc_zone_state(zone, NR_INACTIVE);
}

static inline void

2007-01-26 19:20:53

by Michal Piotrowski

[permalink] [raw]
Subject: Re: mm snapshot broken-out-2007-01-26-00-36.tar.gz uploaded

Christoph Lameter napisaƂ(a):
> On Fri, 26 Jan 2007, Michal Piotrowski wrote:
>
>> Please try patches from
>> http://www.stardust.webpages.pl/files/tbf/euridica/mm-snapshot-2007-01-26/
>>
>> http://www.stardust.webpages.pl/files/tbf/euridica/mm-snapshot-2007-01-26/bugs_and_patches.txt
>
> Ahh. Okay that fixes most of the issues
>
>
> ZVC writeback: Fix mm and other issues
>
> This deals with swap prefetch and various things changed in mm.
>

Additional fix

Regards,
Michal

--
Michal K. K. Piotrowski
LTG - Linux Testers Group
(http://www.stardust.webpages.pl/ltg/)

Signed-off-by: Michal Piotrowski <[email protected]>

--- linux-work-clean/kernel/power/snapshot.c 2007-01-26 16:45:32.000000000 +0100
+++ linux-work/kernel/power/snapshot.c 2007-01-26 20:17:09.000000000 +0100
@@ -591,7 +591,7 @@ static unsigned int count_free_highmem_p

for_each_zone(zone)
if (populated_zone(zone) && is_highmem(zone))
- cnt += zone->free_pages;
+ cnt += zone_page_state(zone, NR_FREE_PAGES);

return cnt;
}
@@ -869,7 +869,7 @@ static int enough_free_mem(unsigned int
for_each_zone(zone) {
meta += snapshot_additional_pages(zone);
if (!is_highmem(zone))
- free += zone->free_pages;
+ free += zone_page_state(zone, NR_FREE_PAGES);
}

nr_pages += count_pages_for_highmem(nr_highmem);