lkml.org 
[lkml]   [2004]   [Jun]   [24]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
SubjectRe: [oom]: [0/4] fix OOM deadlock running OAST
On Thu, Jun 24, 2004 at 08:18:33AM -0700, William Lee Irwin III wrote:
> Hmm. 2.4 appears to still be lacking some of the fixes (unrelated to
> the nr_swap_pages check causing deadlocks) for functional issues.

Hmm, looks like I forgot the jiffies wrap fix when I sent oom_lock, too.


-- wli

out_of_memory() attempts to determine whether one jiffies-valued
variable refers to a point in time preceding another jiffies-valued
variable, but does not do so in a jiffies wrap -safe fashion. The
following patch corrects this by using the expansion of the 2.6
macro time_after() to check this condition.

Index: linux-2.4/mm/oom_kill.c
===================================================================
--- linux-2.4.orig/mm/oom_kill.c 2004-06-23 19:41:08.000000000 -0700
+++ linux-2.4/mm/oom_kill.c 2004-06-23 19:50:59.000000000 -0700
@@ -283,7 +283,7 @@
spin_lock(&oom_lock);

reset:
- if (first < now)
+ if ((long)first - (long)now < 0)
first = now;
count = 0;

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