lkml.org 
[lkml]   [2002]   [Sep]   [23]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
Subject2.5.37: oom stress test crashes immediately
I've added oom handling into the natsemi network driver, but testing it 
was tricky: I immediately ran into oopses.

The attached patch fails kmalloc and kmem_cache_alloc if

(jiffies%HZ) < HZ/10

with a 5 minute guaranteed success, for the boot process.

Is that something the kernel should survive? Obviously the computer is
unusable after the 5 minute grace period, but I didn't expect oopses.

--

Manfred
--- 2.5/mm/slab.c Sat Sep 21 17:03:15 2002
+++ build-2.5/mm/slab.c Sun Sep 22 16:59:29 2002
@@ -1568,6 +1568,9 @@
*/
void * kmem_cache_alloc (kmem_cache_t *cachep, int flags)
{
+ if (jiffies > HZ*300 && (jiffies % HZ) < HZ/10)
+ return NULL;
+
return __kmem_cache_alloc(cachep, flags);
}

@@ -1596,6 +1599,9 @@
{
cache_sizes_t *csizep = cache_sizes;

+ if (jiffies > HZ*300 && (jiffies % HZ) < HZ/10)
+ return NULL;
+
for (; csizep->cs_size; csizep++) {
if (size > csizep->cs_size)
continue;
\
 
 \ /
  Last update: 2005-03-22 13:29    [W:0.025 / U:0.996 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site