mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Dave Kleikamp <shaggy@austin.ibm.com>
To: Andrew Morton <akpm@osdl.org>
Cc: Badari Pulavarty <pbadari@us.ibm.com>,
	ext2-devel <Ext2-devel@lists.sourceforge.net>,
	Herbert Xu <herbert@gondor.apana.org.au>,
	lkml <linux-kernel@vger.kernel.org>
Subject: Re: [Ext2-devel] [RFC][PATCH] Manage jbd allocations from its own slabs
Date: Thu, 24 Aug 2006 12:41:05 +0000	[thread overview]
Message-ID: <1156423265.7908.10.camel@kleikamp.austin.ibm.com> (raw)
In-Reply-To: <20060823163410.d9af3baa.akpm@osdl.org>

On Wed, 2006-08-23 at 16:34 -0700, Andrew Morton wrote:
> On Wed, 23 Aug 2006 16:08:15 -0700
> Badari Pulavarty <pbadari@us.ibm.com> wrote:

> >  /*
> > + * jbd slab management: create 1k, 2k, 4k, 8k slabs and allocate
> > + * frozen and commit buffers from these slabs.
> > + *
> > + * Reason for doing this is to avoid, SLAB_DEBUG - since it could
> > + * cause bh to cross page boundary.
> > + */
> > +
> > +static kmem_cache_t *jbd_slab[4];
> > +static const char *jbd_slab_names[4] = {
> > +	"jbd_1k",
> > +	"jbd_2k",
> > +	"jbd_4k",
> > +	"jbd_8k",
> > +};
> > +
> > +static void journal_destroy_jbd_slabs(void)
> > +{
> > +	int i;
> > +
> > +	for (i=0; i<4; i++) {
> > +		if (jbd_slab[i])
> > +			kmem_cache_destroy(jbd_slab[i]);
> > +		jbd_slab[i] = NULL;
> > +	}
> > +}
> > +
> > +static int journal_init_jbd_slabs(void)
> > +{
> > +	int i = 0;
> > +	int retval = 0;
> > +
> > +	for (i=0; i<4; i++) {
> > +		unsigned long slab_size = 1024 << i;
> > +		jbd_slab[i] = kmem_cache_create(jbd_slab_names[i],
> > +					slab_size, slab_size,
> > +					0, NULL, NULL);
> 
> OK, passing align=slab_size fixes the bug.

The comments above don't mention the alignment of the slabs, so a
comment here may help explain that the alignment is the key to avoiding
the page-straddling.  Or you could elaborate above.

Shaggy
-- 
David Kleikamp
IBM Linux Technology Center


  reply	other threads:[~2006-08-24 12:41 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-08-23 23:08 Badari Pulavarty
2006-08-23 23:34 ` Andrew Morton
2006-08-24 12:41   ` Dave Kleikamp [this message]
2006-08-25  0:00   ` Badari Pulavarty
2006-08-24 12:29 ` [Ext2-devel] " Dave Kleikamp
2006-08-24 17:12   ` Badari Pulavarty
2006-08-24 18:53 ` Christoph Hellwig
2006-08-24 19:11   ` Badari Pulavarty
2006-08-25  2:24     ` [Ext2-devel] " Theodore Tso

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=1156423265.7908.10.camel@kleikamp.austin.ibm.com \
    --to=shaggy@austin.ibm.com \
    --cc=Ext2-devel@lists.sourceforge.net \
    --cc=akpm@osdl.org \
    --cc=herbert@gondor.apana.org.au \
    --cc=linux-kernel@vger.kernel.org \
    --cc=pbadari@us.ibm.com \
    /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®