lkml.org 
[lkml]   [2001]   [May]   [14]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
Subject[PATCH] out_of_memory() fix
Hi Linus,

instead of walking the whole swap bitmap, out_of_memory()
might just as well check the nr_swap_pages variable which
is used by __get_swap_page() ...

regards,

Rik
--
Virtual memory is like a game you can't win;
However, without VM there's truly nothing to lose...

http://www.surriel.com/ http://distro.conectiva.com/

Send all your spam to aardvark@nl.linux.org (spam digging piggy)


--- linux-2.4.5-pre1/mm/oom_kill.c.orig Mon May 14 01:03:33 2001
+++ linux-2.4.5-pre1/mm/oom_kill.c Mon May 14 01:06:56 2001
@@ -191,7 +191,6 @@
*/
int out_of_memory(void)
{
- struct sysinfo swp_info;

/* Enough free memory? Not OOM. */
if (nr_free_pages() > freepages.min)
@@ -201,8 +200,7 @@
return 0;

/* Enough swap space left? Not OOM. */
- si_swapinfo(&swp_info);
- if (swp_info.freeswap > 0)
+ if (nr_swap_pages > 0)
return 0;

/* Else... */
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2005-03-22 12:52    [W:0.025 / U:1.552 seconds]
©2003-2018 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site