Re: Final pre-2.0.31.. Expect this to be same as real 2.0.31

Dr. Werner Fink (werner@suse.de)
Wed, 17 Sep 1997 16:01:06 +0200


>
> > > > Could not get a free page is ok, does not depend on swap space free
> > > > and does not mean anything bad.
> > > Well, imho it is bad. It means something in the allocation mechanism fails,
> > > and if it happens in some critical routine, the kernel is cooked.
> >
> > If you get the message while svgatextmode is going towards a higher
> > resolution mode, then the kernel is allocating memory for the
> > offscreen video buffers. In that case, you have to have enough memory
> > available. Because this operation requires quite a lot of extra memory
> That's right, I've just checked that in svgatextmode sources. Well...
>
> > at exactly one moment in time, there is not much we can do about
> > it....
> Right, but still the system has all the swap space available - so why doesn't
> that swap occur when stm needs that memory?

Have you tried the patch of Krzysztof Strasburger
(Swap cache patch for pre-2.0.31-9)?

This one makes it possible to start a programm which needs more
virtual memory than the amount of physical memory ... if swap
space is available.

Werner

Patch of Krzysztof Strasburger against pre9
----------------------------------------------------------------------
diff -u -r linux.orig/include/linux/swap.h linux/include/linux/swap.h
--- linux.orig/include/linux/swap.h Mon Jun 3 14:38:37 1996
+++ linux/include/linux/swap.h Fri Apr 18 17:11:22 1997
@@ -34,6 +34,7 @@

extern int nr_swap_pages;
extern int nr_free_pages;
+extern int nr_swap_cache_pages;
extern atomic_t nr_async_pages;
extern int min_free_pages;
extern int free_pages_low;
@@ -113,10 +114,12 @@
swap_cache_find_total++;
#endif
entry = xchg(swap_cache + index, 0);
+ if (entry) {
#ifdef SWAP_CACHE_INFO
- if (entry)
swap_cache_find_success++;
#endif
+ nr_swap_cache_pages--;
+ }
return entry;
}

@@ -133,6 +136,7 @@
swap_cache_del_success++;
#endif
swap_free(entry);
+ nr_swap_cache_pages--;
return 1;
}
return 0;
diff -u -r linux.orig/mm/mmap.c linux/mm/mmap.c
--- linux.orig/mm/mmap.c Fri Dec 6 22:09:24 1996
+++ linux/mm/mmap.c Fri Apr 18 17:12:08 1997
@@ -55,9 +55,10 @@
long freepages;
freepages = buffermem >> PAGE_SHIFT;
freepages += page_cache_size;
- freepages >>= 1;
+/* freepages >>= 1; 64 MB used as buffers and you can't run a 50 MB program */
freepages += nr_free_pages;
freepages += nr_swap_pages;
+ freepages += nr_swap_cache_pages;
freepages -= MAP_NR(high_memory) >> 4;
return freepages > pages;
}
diff -u -r linux.orig/mm/swap_state.c linux/mm/swap_state.c
--- linux.orig/mm/swap_state.c Wed Mar 13 14:17:23 1996
+++ linux/mm/swap_state.c Fri Apr 18 17:12:11 1997
@@ -32,6 +32,8 @@
*/
unsigned long *swap_cache;

+int nr_swap_cache_pages = 0;
+
#ifdef SWAP_CACHE_INFO
unsigned long swap_cache_add_total = 0;
unsigned long swap_cache_add_success = 0;
@@ -64,6 +66,7 @@
#ifdef SWAP_CACHE_INFO
swap_cache_add_success++;
#endif
+ nr_swap_cache_pages++;
return 1;
}
return 0;
diff -u -r linux.orig/mm/swapfile.c linux/mm/swapfile.c
--- linux.orig/mm/swapfile.c Thu Apr 10 23:47:14 1997
+++ linux/mm/swapfile.c Fri Apr 18 17:12:12 1997
@@ -570,6 +570,7 @@
++val->totalswap;
}
}
+ val->freeswap += nr_swap_cache_pages;
val->freeswap <<= PAGE_SHIFT;
val->totalswap <<= PAGE_SHIFT;
return;