From: Andrew Morton <akpm@linux-foundation.org>
To: Gavin Guo <gavin.guo@canonical.com>
Cc: Christoph Lameter <cl@linux.com>,
penberg@kernel.org, rientjes@google.com, iamjoonsoo.kim@lge.com,
linux-mm@kvack.org, linux-kernel <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH v2] mm/slab_common: Support the slub_debug boot option on specific object size
Date: Wed, 22 Apr 2015 20:28:42 -0700 [thread overview]
Message-ID: <20150422202842.47cb7940.akpm@linux-foundation.org> (raw)
In-Reply-To: <CA+eFSM38C+P5_2GRXxNR=LtGBHFo-gDyPMvembw75XV+0OkGCQ@mail.gmail.com>
On Thu, 23 Apr 2015 11:10:40 +0800 Gavin Guo <gavin.guo@canonical.com> wrote:
> >> for (i = KMALLOC_SHIFT_LOW; i <= KMALLOC_SHIFT_HIGH; i++) {
> >> if (!kmalloc_caches[i]) {
> >> - kmalloc_caches[i] = create_kmalloc_cache(NULL,
> >> + kmalloc_caches[i] = create_kmalloc_cache(
> >> + kmalloc_names[i],
> >> 1 << i, flags);
> >> }
> >
> > You could do something like
> >
> > kmalloc_caches[i] = create_kmalloc_cache(
> > kmalloc_names[i],
> > kstrtoul(kmalloc_names[i] + 8),
> > flags);
> >
> > here, and remove those weird "96" and "192" cases.
>
> Thanks for your reply. I'm not sure if I am following your idea. Would you
> mean to simply replace the string like:
>
> kmalloc_caches[1] = create_kmalloc_cache(
> kmalloc_names[1], 96, flags);
> as follows:
>
> kmalloc_caches[1] = create_kmalloc_cache(
> kmalloc_names[1],
> kstrtoul(kmalloc_names[i] + 8),
> flags);
>
> or if you like to merge the last 2 if conditions for 96 and 192 cases to
> the first if condition check:
>
> if (!kmalloc_caches[i]) {
> kmalloc_caches[i] = create_kmalloc_cache(NULL,
> 1 << i, flags);
> }
The latter - initialize all the caches in a single loop.
--
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-04-23 3:21 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-04-22 8:33 Gavin Guo
2015-04-22 14:27 ` Christoph Lameter
2015-04-22 21:00 ` Andrew Morton
2015-04-22 21:02 ` Andrew Morton
2015-04-23 3:10 ` Gavin Guo
2015-04-23 3:28 ` Andrew Morton [this message]
2015-04-23 9:55 ` Rasmus Villemoes
2015-04-23 11:15 ` Gavin Guo
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=20150422202842.47cb7940.akpm@linux-foundation.org \
--to=akpm@linux-foundation.org \
--cc=cl@linux.com \
--cc=gavin.guo@canonical.com \
--cc=iamjoonsoo.kim@lge.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--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