From: ShiYong LI <a22381@motorola.com>
To: linux-kernel@vger.kernel.org
Cc: cl@linux-foundation.org, penberg@cs.helsinki.fi, mpm@selenic.com,
linux-mm@kvack.org
Subject: [PATCH] Fix missing of last user while dumping slab corruption log
Date: Fri, 2 Apr 2010 15:21:16 +0800 [thread overview]
Message-ID: <k2s4810ea571004020021hade8123mb571b803b8472aef@mail.gmail.com> (raw)
Hi,
Even with SLAB_RED_ZONE and SLAB_STORE_USER enabled, kernel would NOT
store redzone and last user data around allocated memory space if arch
cache line > sizeof(unsigned long long). As a result, last user information
is unexpectedly MISSED while dumping slab corruption log.
This patch makes sure that redzone and last user tags get stored whatever
arch cache line.
Compared to original codes, the change surely affects head redzone (redzone1).
Actually, with SLAB_RED_ZONE and SLAB_STORE_USER enabled,
allocated memory layout is as below:
[ redzone1 ] <--------- Affected area.
[ real object space ]
[ redzone2 ]
[ last user ]
[ ... ]
Let's do some analysis: (whatever SLAB_STORE_USER is).
1) With SLAB_RED_ZONE on, "align" >= sizeof(unsigned long long) according to
the following codes:
/* 2) arch mandated alignment */
if (ralign < ARCH_SLAB_MINALIGN) {
ralign = ARCH_SLAB_MINALIGN;
}
/* 3) caller mandated alignment */
if (ralign < align) {
ralign = align;
}
...
/*
* 4) Store it.
*/
align = ralign;
That's to say, could guarantee that redzone1 does NOT get broken
at all. Meanwhile,
Real object space could meet the need of cache line size by using
"align" argument.
2) With SLAB_RED_ZONE off, the change has no impact.
next reply other threads:[~2010-04-02 7:21 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-04-02 7:21 ShiYong LI [this message]
2010-04-06 1:24 ` [PATCH] Fix missing of last user while dumping slab corruption log TAO HU
2010-04-07 14:32 ` TAO HU
2010-04-07 15:25 ` Pekka Enberg
2010-04-08 3:13 ` TAO HU
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=k2s4810ea571004020021hade8123mb571b803b8472aef@mail.gmail.com \
--to=a22381@motorola.com \
--cc=cl@linux-foundation.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=mpm@selenic.com \
--cc=penberg@cs.helsinki.fi \
/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;
as well as URLs for NNTP newsgroup(s).