From: Joonsoo Kim <js1304@gmail.com>
To: Christoph Lameter <cl@linux.com>
Cc: Joonsoo Kim <iamjoonsoo.kim@lge.com>,
Andrew Morton <akpm@linux-foundation.org>,
liu.hailong6@zte.com.cn, Pekka Enberg <penberg@kernel.org>,
Linux Memory Management List <linux-mm@kvack.org>,
jiang.xuexin@zte.com.cn, David Rientjes <rientjes@google.com>
Subject: Re: slab:Fix the unexpected index mapping result of kmalloc_size(INDEX_NODE + 1)
Date: Fri, 11 Sep 2015 23:32:32 +0900 [thread overview]
Message-ID: <CAAmzW4O9d6i1cDArzG72WpBQfn5VgmiQVr1DBS8QN4o4V7gPHg@mail.gmail.com> (raw)
In-Reply-To: <alpine.DEB.2.11.1509081249240.26204@east.gentwo.org>
2015-09-09 2:49 GMT+09:00 Christoph Lameter <cl@linux.com>:
> On Mon, 7 Sep 2015, Joonsoo Kim wrote:
>
>> Sure. It should be fixed soon. If Christoph agree with my approach, I
>> will make it to proper formatted patch.
>
> Could you explain that approach again?
Instead of following hunk,
- if (size >= kmalloc_size(INDEX_NODE + 1)
+ if (size >= kmalloc_size(INDEX_NODE) * 2 &&
Using this hunk.
- if (size >= kmalloc_size(INDEX_NODE + 1)
+ if (!slab_early_init &&
+ size >= kmalloc_size(INDEX_NODE) &&
+ size >= 256 &&
What this codes intend for is to determine whether this slab
can be debugged by debug_pagealloc. It become possible
when off slab management is possible so this condition is to
check whether off slab management is possible or not. Off slab
management requires small sized slab so we should not allow
debug_pagealloc until proper sized slab is initialized.
Initialization sequence is like:
The mapping table in the latest kernel is like:
index = {0, 1, 2 , 3, 4, 5, 6, n}
size = {0, 96, 192, 8, 16, 32, 64, 2^n}
So, when we initialize 96, 192 or 8, proper slab isn't initialized.
If we allow debug_pagealloc larger than 256 sized slab,
small sized slab would be already initialized so no error
happens. I think it is better than
kmalloc_size(INDEX_NODE) * 2, because that doesn't
guarantee size is larger than 192.
Thanks.
--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org. For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>
next prev parent reply other threads:[~2015-09-11 14:32 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-07-09 5:56 slab:Fix the unexpected index mapping result of kmalloc_size(INDEX_NODE + 1) liu.hailong6
2015-07-29 22:28 ` Andrew Morton
2015-07-30 16:29 ` Christoph Lameter
2015-07-31 0:18 ` Joonsoo Kim
2015-07-31 13:57 ` Christoph Lameter
2015-08-07 1:56 ` Joonsoo Kim
2015-09-04 20:29 ` Andrew Morton
2015-09-07 5:38 ` Joonsoo Kim
2015-09-08 17:49 ` Christoph Lameter
2015-09-11 14:32 ` Joonsoo Kim [this message]
2015-09-11 14:49 ` Christoph Lameter
-- strict thread matches above, loose matches on Subject: below --
2015-07-09 3:35 liu.hailong6
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=CAAmzW4O9d6i1cDArzG72WpBQfn5VgmiQVr1DBS8QN4o4V7gPHg@mail.gmail.com \
--to=js1304@gmail.com \
--cc=akpm@linux-foundation.org \
--cc=cl@linux.com \
--cc=iamjoonsoo.kim@lge.com \
--cc=jiang.xuexin@zte.com.cn \
--cc=linux-mm@kvack.org \
--cc=liu.hailong6@zte.com.cn \
--cc=penberg@kernel.org \
--cc=rientjes@google.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;
as well as URLs for NNTP newsgroup(s).