From: 赵军奎 <bernard@vivo.com>
To: Matthew Wilcox <willy@infradead.org>
Cc: Christoph Lameter <cl@linux.com>,
Pekka Enberg <penberg@kernel.org>,
David Rientjes <rientjes@google.com>,
Joonsoo Kim <iamjoonsoo.kim@lge.com>,
Andrew Morton <akpm@linux-foundation.org>,
linux-mm@kvack.org, linux-kernel@vger.kernel.org,
opensource.kernel@vivo.com
Subject: Re:Re: Re: [PATCH V2] kmalloc_index optimization(code size & runtime stable)
Date: Wed, 22 Apr 2020 09:12:07 +0800 (GMT+08:00) [thread overview]
Message-ID: <AJ6AOADeCMOyb*91QJCWH4rn.3.1587517927424.Hmail.bernard@vivo.com> (raw)
In-Reply-To: <20200421143609.GM5820@bombadil.infradead.org>
发件人:Matthew Wilcox <willy@infradead.org>
发送日期:2020-04-21 22:36:09
收件人:"赵军奎" <bernard@vivo.com>
抄送人:Christoph Lameter <cl@linux.com>,Pekka Enberg <penberg@kernel.org>,David Rientjes <rientjes@google.com>,Joonsoo Kim <iamjoonsoo.kim@lge.com>,Andrew Morton <akpm@linux-foundation.org>,linux-mm@kvack.org,linux-kernel@vger.kernel.org,opensource.kernel@vivo.com
主题:Re: Re: [PATCH V2] kmalloc_index optimization(code size & runtime stable)>On Tue, Apr 21, 2020 at 07:55:03PM +0800, 赵军奎 wrote:
>> Sure, i just received some kbuild compiler error mails and prompt me to do something?
>> I don`t know why this happened, so i update the patch again.
>
>Don't. The patch has been NACKed, so there's no need to post a v2.
>
>If you want to do something useful, how about looking at the effect
>of adding different slab sizes? There's a fairly common pattern of
>allocating things which are a power of two + a header. So it may make
>sense to have kmalloc caches of 320 (256 + 64), 576 (512 + 64) and 1088
>(1024 + 64). I use 64 here as that's the size of a cacheline, so we
>won't get false sharing between users.
>
>This could save a fair quantity of memory; today if you allocate 512 +
>8 bytes, it will round up to 1024. So we'll get 4 allocations per 4kB
>page, but with a 576-byte slab, we'd get 7 allocations per 4kB page.
>Of course, if there aren't a lot of users which allocate memory in this
>range, then it'll be a waste of memory. On my laptop, it seems like
>there might be a decent amount of allocations in the right range:
>
>kmalloc-2k 3881 4384 2048 16 8 : tunables 0 0 0 : sla
>bdata 274 274 0
>kmalloc-1k 6488 7056 1024 16 4 : tunables 0 0 0 : slabdata 441 441 0
>kmalloc-512 7700 8256 512 16 2 : tunables 0 0 0 : slabdata 516 516 0
>
>Now, maybe 576 isn't quite the right size. Need to try it on a variety
>of configurations and find out. Want to investigate this?
This looks like a great idea!
Maybe I can do some research on our mobile phone products,
and see how the original size of kmalloc is distributed.
This may be useful as a reference to provide a flexible configuration method.
Thank you very much for your sharing.
Regards,
Bernard
next prev parent reply other threads:[~2020-04-22 1:44 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-04-21 3:25 [PATCH V2] kmalloc_index optimization(code size & runtime stable) Bernard Zhao
2020-04-21 11:18 ` Matthew Wilcox
2020-04-21 11:55 ` 赵军奎
2020-04-21 14:36 ` Matthew Wilcox
2020-04-22 1:12 ` 赵军奎 [this message]
2020-04-21 13:13 ` Vlastimil Babka
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='AJ6AOADeCMOyb*91QJCWH4rn.3.1587517927424.Hmail.bernard@vivo.com' \
--to=bernard@vivo.com \
--cc=akpm@linux-foundation.org \
--cc=cl@linux.com \
--cc=iamjoonsoo.kim@lge.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=opensource.kernel@vivo.com \
--cc=penberg@kernel.org \
--cc=rientjes@google.com \
--cc=willy@infradead.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;
as well as URLs for NNTP newsgroup(s).