All of lore.kernel.org
 help / color / mirror / Atom feed
From: James Bottomley <James.Bottomley@steeleye.com>
To: Marcelo Tosatti <marcelo@conectiva.com.br>
Cc: James.Bottomley@SteelEye.com, linux-kernel@vger.kernel.org
Subject: [PATCH 2.4] Enable checking of reap of in-use slab
Date: Fri, 20 Dec 2002 10:45:19 -0600	[thread overview]
Message-ID: <200212201645.gBKGjJQ03941@localhost.localdomain> (raw)

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

Hi Marcelo,

On older (2.4.9) kernels, we keep running into the occasional attempts to reap 
in-use slabs.  The checks for this were compiled out on 2.4.10 and above in 
the name of efficiency.

I'd like to add the checks just for the in use parts back just to make 
assurances doubly sure that this bug is actually fixed, not just obscured.  
The changes use the BUG_ON macro, so the actual debugging stuff is in the 
unlikely branch which shouldn't impact the critical path too much.

Please consider applying for 2.4.22

Thanks,

James


[-- Attachment #2: tmp.diff --]
[-- Type: text/plain , Size: 882 bytes --]

===== mm/slab.c 1.21 vs edited =====
--- 1.21/mm/slab.c	Mon Dec 16 00:22:20 2002
+++ edited/mm/slab.c	Fri Dec 20 10:33:02 2002
@@ -928,10 +928,9 @@
 			break;
 
 		slabp = list_entry(cachep->slabs_free.prev, slab_t, list);
-#if DEBUG
-		if (slabp->inuse)
-			BUG();
-#endif
+
+		BUG_ON(slabp->inuse);
+
 		list_del(&slabp->list);
 
 		spin_unlock_irq(&cachep->spinlock);
@@ -1785,10 +1784,9 @@
 		p = searchp->slabs_free.next;
 		while (p != &searchp->slabs_free) {
 			slabp = list_entry(p, slab_t, list);
-#if DEBUG
-			if (slabp->inuse)
-				BUG();
-#endif
+
+			BUG_ON(slabp->inuse);
+
 			full_free++;
 			p = p->next;
 		}
@@ -1838,10 +1836,9 @@
 		if (p == &best_cachep->slabs_free)
 			break;
 		slabp = list_entry(p,slab_t,list);
-#if DEBUG
-		if (slabp->inuse)
-			BUG();
-#endif
+
+		BUG_ON(slabp->inuse);
+
 		list_del(&slabp->list);
 		STATS_INC_REAPED(best_cachep);
 

                 reply	other threads:[~2002-12-20 16:37 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=200212201645.gBKGjJQ03941@localhost.localdomain \
    --to=james.bottomley@steeleye.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=marcelo@conectiva.com.br \
    /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.