lkml.org 
[lkml]   [1996]   [Sep]   [8]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
SubjectCache eats memory: partially "solved"!?
Hello,

today I made some tests and found the reason why in recent kernels there
is some memory missing:

It was the patch to mm/vmscan.c in patch-2.0.5

I assume the following:

With older kernels the system could hang when no more swap was available.
For this reason the change in vmscan.c was made. But now the kernel seems
to give up too early. It returns even if there are cached buffers which
could be freed in order to get some memory.

When I reverse the patch to vmscan.c, I'm able to install on a system with
only 8 MB of memory and no swap. I know this is not the correct solution
for that problem, but it may show the right way to the kernel hackers that
are familiar with that part of the kernel.

Hubert mantel@suse.de

This is the patch which gives me the lost memory:

---- snip -------------------------------------------------------------
diff -urN linux-2.0.18-clean/mm/vmscan.c linux-2.0.18-big/mm/vmscan.c
--- linux-2.0.18-clean/mm/vmscan.c Tue Aug 13 14:00:33 1996
+++ linux-2.0.18-big/mm/vmscan.c Sun Sep 8 17:04:42 1996
@@ -109,7 +109,7 @@
if (page_map->count != 1)
return 0;
if (!(entry = get_swap_page()))
- return -1; /* Aieee!!! Out of swap space! */
+ return 0;
vma->vm_mm->rss--;
flush_cache_page(vma, address);
set_pte(page_table, __pte(entry));
@@ -312,8 +312,6 @@
if (!--p->swap_cnt)
swap_task++;
switch (swap_out_process(p, dma, wait)) {
- case -1:
- return 0;
case 0:
if (p->swap_cnt)
swap_task++;
---- snip -------------------------------------------------------------


\
 
 \ /
  Last update: 2005-03-22 13:38    [W:0.045 / U:0.272 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site