lkml.org 
[lkml]   [2001]   [Sep]   [25]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: Out of memory handling broken
On Tue, 25 Sep 2001, Pavel Machek wrote:

> I need to allocate as much memory as possible (but not more).
> Okay, so I use out_of_memory, right?

Nope, out_of_memory() is about virtual memory handling,
not at all about physical memory.

> But, when I looked into out_of_memory... Of course its
> wrong. out_of_memory() contains
>
> if (nr_swap_pages > 0)
> return 0;
>
> ...which is obviously wrong. It is well possible to have free
> swap _and_ be out of memory -- eat_memory() loop gets system to
> this state easily.

This is because you're using out_of_memory() for something
it was never meant for. ;)

Even if it didn't take swap into account, you'd still end
up counting highmem pages your code cannot use...

cheers,

Rik
--
IA64: a worthy successor to the i860.

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


-
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 13:03    [W:0.078 / U:0.544 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site