Re: 2.6.8-r1 mem issues

From: Marcelo Tosatti
Date: Mon Sep 20 2004 - 06:58:32 EST


On Sun, Sep 19, 2004 at 04:20:48PM -0700, Max Michaels wrote:
> This is my first post, so please be forgiving of any faux-pas. I am
> having issues with 2.6.8-r1 with memory being eaten by the kernel. Top
> reveals that only about 35% of the memory (3GB) is being used but the
> actual count of free memory is only about 10MB. /proc/slabinfo shows no
> odd numbers and /proc/meminfo shows the same 10MB as the top total. No
> processes account for this memory, so I'm assuming it must be the
> kernel. Eventually, I run out of memory and OOM-killer starts killing
> processes until it has some memory. Is there some troubleshooting method
> I am missing or is this a known issue?

Hi Max,

Please try 2.6.9-rc2-mm1 and see if you can reproduce the problem there.

If you can, please apply the attached patch and wait for the OOM killer to trigger.

Doing so will show us how many swap pages were free at the moment of the killing,
if there was swap space available there's something wrong.

--- mm/page_alloc.c.orig 2004-08-24 20:37:53.000000000 -0300
+++ mm/page_alloc.c 2004-08-24 22:51:49.498375608 -0300
@@ -1021,11 +1021,12 @@
void show_free_areas(void)
{
struct page_state ps;
- int cpu, temperature;
+ int cpu, temperature, i;
unsigned long active;
unsigned long inactive;
unsigned long free;
struct zone *zone;
+ unsigned int swap_pages = 0;

for_each_zone(zone) {
show_node(zone);
@@ -1086,6 +1087,8 @@
" active:%lukB"
" inactive:%lukB"
" present:%lukB"
+ " pages_scanned:%lu"
+ " all_unreclaimable? %s"
"\n",
zone->name,
K(zone->free_pages),
@@ -1094,7 +1097,9 @@
K(zone->pages_high),
K(zone->nr_active),
K(zone->nr_inactive),
- K(zone->present_pages)
+ K(zone->present_pages),
+ zone->pages_scanned,
+ (zone->all_unreclaimable ? "yes" : "no")
);
printk("protections[]:");
for (i = 0; i < MAX_NR_ZONES; i++)
@@ -1125,6 +1130,18 @@
printk("= %lukB\n", K(total));
}

+ swap_list_lock();
+ for (i = 0; i < nr_swapfiles; i++) {
+ if (!(swap_info[i].flags & SWP_USED) ||
+ (swap_info[i].flags & SWP_WRITEOK))
+ continue;
+ swap_pages += swap_info[i].inuse_pages;
+ }
+ swap_pages += nr_swap_pages;
+ swap_list_unlock();
+
+ printk("nr_free_swap_pages: %u\n", swap_pages);
+
show_swap_cache_info();
}