Re: [oom]: [0/4] fix OOM deadlock running OAST

From: William Lee Irwin III
Date: Thu Jun 24 2004 - 10:23:08 EST


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@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/