All of lore.kernel.org
 help / color / mirror / Atom feed
From: Manfred Spraul <manfred@colorfullife.com>
To: linux-kernel@vger.kernel.org
Subject: 2.5.37: oom stress test crashes immediately
Date: Mon, 23 Sep 2002 15:07:33 +0200	[thread overview]
Message-ID: <3D8F1215.8060108@colorfullife.com> (raw)

[-- Attachment #1: Type: text/plain, Size: 415 bytes --]

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

[-- Attachment #2: patch-kmalloc-fail --]
[-- Type: text/plain, Size: 515 bytes --]

--- 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;

                 reply	other threads:[~2002-09-23 13:02 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=3D8F1215.8060108@colorfullife.com \
    --to=manfred@colorfullife.com \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.