mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Christoph Lameter <clameter@sgi.com>
To: "Håvard Skinnemoen" <hskinnemoen@gmail.com>
Cc: Haavard Skinnemoen <hskinnemoen@atmel.com>,
	Linux Kernel <linux-kernel@vger.kernel.org>
Subject: Re: kernel BUG at mm/slub.c:3689!
Date: Mon, 11 Jun 2007 10:52:32 -0700 (PDT)	[thread overview]
Message-ID: <Pine.LNX.4.64.0706111041160.17264@schroedinger.engr.sgi.com> (raw)
In-Reply-To: <1defaf580706111011w641b26fbu68d6d34028f6e953@mail.gmail.com>

[-- Attachment #1: Type: TEXT/PLAIN, Size: 1896 bytes --]

On Mon, 11 Jun 2007, Håvard Skinnemoen wrote:

> On 6/11/07, Christoph Lameter <clameter@sgi.com> wrote:
> > Ahhh... I see its the same phenomenon as before but triggered by
> > a different cause.
> > 
> > If you set the align to 32 then the first kmalloc slabs of size
> > 
> > 8
> > 16
> > 32
> > 
> > are all of the same size which leads to duplicate files in sysfs.
> 
> Yes, that seems to be the problem.
> 
> > Does this patch fix it?
> 
> Unfortunately, no. But I get a different error message; see below...

Hmmmm.. Yeah slabs with different user object sizes may coexist.

Argh!

Ok. Drop the patch and use this one instead. This one avoids the use
of smaller slabs that cause the conflict. The first slab will be sized 32
bytes instead of 8.

Note that I do not get why you would be aligning the objects to 32 bytes. 
Increasing the smallest cache size wastes a lot of memory. And it is 
usually advantageous if multiple related objects are in the same cacheline 
unless you have heavy SMP contention.

---
 include/linux/slub_def.h |    6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

Index: linux-2.6/include/linux/slub_def.h
===================================================================
--- linux-2.6.orig/include/linux/slub_def.h	2007-06-11 10:50:09.000000000 -0700
+++ linux-2.6/include/linux/slub_def.h	2007-06-11 10:50:58.000000000 -0700
@@ -56,7 +56,8 @@ struct kmem_cache {
 /*
  * Kmalloc subsystem.
  */
-#define KMALLOC_SHIFT_LOW 3
+#define KMALLOC_SHIFT_LOW 5
+
 
 /*
  * We keep the general caches in an array of slab caches that are used for
@@ -76,6 +77,9 @@ static inline int kmalloc_index(size_t s
 	if (size > KMALLOC_MAX_SIZE)
 		return -1;
 
+	if (size <= (1 << KMALLOC_SHIFT_LOW))
+		return KMALLOC_SHIFT_LOW;
+
 	if (size > 64 && size <= 96)
 		return 1;
 	if (size > 128 && size <= 192)

  reply	other threads:[~2007-06-11 17:52 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-06-11 14:19 Haavard Skinnemoen
2007-06-11 15:38 ` Paul Mundt
2007-06-11 15:58   ` Håvard Skinnemoen
2007-06-11 16:19 ` Christoph Lameter
2007-06-11 16:43   ` Håvard Skinnemoen
2007-06-11 16:49     ` Christoph Lameter
2007-06-11 17:11       ` Håvard Skinnemoen
2007-06-11 17:52         ` Christoph Lameter [this message]
2007-06-11 18:22           ` Håvard Skinnemoen
2007-06-11 18:32             ` Christoph Lameter
2007-06-11 19:04               ` Håvard Skinnemoen
2007-06-11 19:11                 ` Christoph Lameter
2007-06-11 19:35                   ` Håvard Skinnemoen
2007-06-11 19:40                     ` Christoph Lameter
2007-06-11 19:53                       ` Håvard Skinnemoen
2007-06-12  3:16                         ` Christoph Lameter
2007-06-12  8:55                           ` Haavard Skinnemoen
2007-06-12 10:16                             ` Haavard Skinnemoen

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=Pine.LNX.4.64.0706111041160.17264@schroedinger.engr.sgi.com \
    --to=clameter@sgi.com \
    --cc=hskinnemoen@atmel.com \
    --cc=hskinnemoen@gmail.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®