All of lore.kernel.org
 help / color / mirror / Atom feed
From: Tony Lindgren <tony@atomide.com>
To: Christoph Lameter <cl@linux.com>
Cc: Chris Mason <clmason@fusionio.com>,
	Pekka Enberg <penberg@kernel.org>,
	Linus Torvalds <torvalds@linux-foundation.org>,
	Andrew Morton <akpm@linux-foundation.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: Re: [GIT PULL] SLAB changes for v3.10
Date: Wed, 8 May 2013 12:11:09 -0700	[thread overview]
Message-ID: <20130508191109.GB32546@atomide.com> (raw)
In-Reply-To: <0000013e85852607-fd84223c-112e-46b9-a60f-73d9597d90ac-000000@email.amazonses.com>

* Christoph Lameter <cl@linux.com> [130508 12:06]:
> On Wed, 8 May 2013, Chris Mason wrote:
> 
> > > You correctly moved the checks out of the if (!kmalloc_cacheS())
> > > condition so that the caches are created properly.
> >
> > But if the ordering is required at all, why is it ok to create cache 2
> > after cache 6 instead of after cache 7?
> 
> The power of two caches are 2^x beginning with KMALLOC_MIN_SHIFT. The non
> power of two caches were folded into number 1 + 2 since they do not fit
> into the scheme and they are special cased throughout. This works since
> the minimal slab cache size is 8 bytes.
> 
> > IOW if we can safely do cache 2 after cache 6, why can't we just do both
> > cache 1 and cache 2 after the loop?
> 
> Because the cache creation in SLAB can cause the use of a fractional slab
> size if kmem_cache_create() thinks its better to put the metadata on a
> different slab cache (OFF_SLAB type) because data will align better that
> way. Its weird I know but its due to the way that SLAB aligns data in the
> page frame.

Hmm OK so kmalloc_caches[7] got created earlier with INDEX_AC != INDEX_NODE,
and those are defined as:

#define INDEX_AC kmalloc_index(sizeof(struct arraycache_init))
#define INDEX_NODE kmalloc_index(sizeof(struct kmem_cache_node))

So the different sizes for the structs can trigger it like Pekka was
speculating earlier.

Regards,

Tony

  reply	other threads:[~2013-05-08 19:11 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-05-07  6:37 [GIT PULL] SLAB changes for v3.10 Pekka Enberg
2013-05-08  0:30 ` Tony Lindgren
2013-05-08  4:24   ` Tony Lindgren
2013-05-08  5:16     ` Tony Lindgren
2013-05-08  6:20       ` Pekka Enberg
2013-05-08 11:58         ` Glauber Costa
2013-05-08 12:26           ` Pekka Enberg
2013-05-08 12:38             ` Glauber Costa
2013-05-08 13:56     ` Christoph Lameter
2013-05-08 15:45       ` Tony Lindgren
     [not found]         ` <alpine.DEB.2.02.1305081309310.3124@gentwo.org>
2013-05-08 18:29           ` Christoph Lameter
2013-05-08 18:13     ` Chris Mason
2013-05-08 18:25       ` Christoph Lameter
2013-05-08 18:48         ` Chris Mason
2013-05-08 19:01           ` Christoph Lameter
2013-05-08 19:11             ` Tony Lindgren [this message]
2013-05-08 19:56             ` [PATCH] Fix crash during slab init Chris Mason
2013-05-08 20:10               ` Sören Brinkmann
2013-05-08 21:48               ` Tetsuo Handa
2013-05-08 22:09               ` Andrew Morton
2013-05-08 19:05         ` [GIT PULL] SLAB changes for v3.10 Tony Lindgren
2013-05-08 21:01       ` Konrad Rzeszutek Wilk

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=20130508191109.GB32546@atomide.com \
    --to=tony@atomide.com \
    --cc=akpm@linux-foundation.org \
    --cc=cl@linux.com \
    --cc=clmason@fusionio.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=penberg@kernel.org \
    --cc=torvalds@linux-foundation.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.