From: Chris Mason <clmason@fusionio.com>
To: Christoph Lameter <cl@linux.com>
Cc: 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>,
Tony Lindgren <tony@atomide.com>
Subject: [PATCH] Fix crash during slab init
Date: Wed, 8 May 2013 15:56:28 -0400 [thread overview]
Message-ID: <20130508195628.4271.97115@localhost.localdomain> (raw)
In-Reply-To: <0000013e85852607-fd84223c-112e-46b9-a60f-73d9597d90ac-000000@email.amazonses.com>
Commit 8a965b3b introduced a regression that caused us to crash early
during boot. The commit was introducing ordering of slab creation,
making sure two odd-sized slabs were created after specific powers of
two sizes.
But, if any of the power of two slabs were created earlier during boot,
slabs at index 1 or 2 might not get created at all. This patch makes
sure none of the slabs get skipped.
Tony Lindgren bisected this down to the offending commit, which really
helped because bisect kept bringing me to almost but not quite this one.
Signed-off-by: Chris Mason <chris.mason@fusionio.com>
Acked-by: Christoph Lameter <cl@linux.com>
Acked-by: Tony Lindgren <tony@atomide.com>
---
v1->v2 reword description
diff --git a/mm/slab_common.c b/mm/slab_common.c
index d2517b0..ff3218a 100644
--- a/mm/slab_common.c
+++ b/mm/slab_common.c
@@ -446,18 +446,18 @@ void __init create_kmalloc_caches(unsigned long flags)
if (!kmalloc_caches[i]) {
kmalloc_caches[i] = create_kmalloc_cache(NULL,
1 << i, flags);
+ }
- /*
- * Caches that are not of the two-to-the-power-of size.
- * These have to be created immediately after the
- * earlier power of two caches
- */
- if (KMALLOC_MIN_SIZE <= 32 && !kmalloc_caches[1] && i == 6)
- kmalloc_caches[1] = create_kmalloc_cache(NULL, 96, flags);
+ /*
+ * Caches that are not of the two-to-the-power-of size.
+ * These have to be created immediately after the
+ * earlier power of two caches
+ */
+ if (KMALLOC_MIN_SIZE <= 32 && !kmalloc_caches[1] && i == 6)
+ kmalloc_caches[1] = create_kmalloc_cache(NULL, 96, flags);
- if (KMALLOC_MIN_SIZE <= 64 && !kmalloc_caches[2] && i == 7)
- kmalloc_caches[2] = create_kmalloc_cache(NULL, 192, flags);
- }
+ if (KMALLOC_MIN_SIZE <= 64 && !kmalloc_caches[2] && i == 7)
+ kmalloc_caches[2] = create_kmalloc_cache(NULL, 192, flags);
}
/* Kmalloc array is now usable */
next prev parent reply other threads:[~2013-05-08 19:56 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
2013-05-08 19:56 ` Chris Mason [this message]
2013-05-08 20:10 ` [PATCH] Fix crash during slab init 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=20130508195628.4271.97115@localhost.localdomain \
--to=clmason@fusionio.com \
--cc=akpm@linux-foundation.org \
--cc=cl@linux.com \
--cc=linux-kernel@vger.kernel.org \
--cc=penberg@kernel.org \
--cc=tony@atomide.com \
--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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
Powered by JetHome