From: Pengfei Li <lpf.vector@gmail.com>
To: akpm@linux-foundation.org
Cc: cl@linux.com, penberg@kernel.org, rientjes@google.com,
iamjoonsoo.kim@lge.com, vbabka@suse.cz, guro@fb.com,
linux-mm@kvack.org, linux-kernel@vger.kernel.org,
Pengfei Li <lpf.vector@gmail.com>
Subject: [PATCH v6 0/3] mm, slab: Make kmalloc_info[] contain all types of names
Date: Mon, 23 Sep 2019 20:27:25 +0800 [thread overview]
Message-ID: <1569241648-26908-1-git-send-email-lpf.vector@gmail.com> (raw)
Changes in v6
--
1. abandon patch 4-7 (Because there is not enough reason to explain
that they are beneficial)
Changes in v5
--
1. patch 1/7:
- rename SET_KMALLOC_SIZE to INIT_KMALLOC_INFO
2. patch 5/7:
- fix build errors (Reported-by: kbuild test robot)
- make all_kmalloc_info[] static (Reported-by: kbuild test robot)
3. patch 6/7:
- for robustness, determine kmalloc_cache is !NULL in
new_kmalloc_cache()
4. add ack tag from David Rientjes
Changes in v4
--
1. [old] abandon patch 4/4
2. [new] patch 4/7:
- return ZERO_SIZE_ALLOC instead 0 for zero sized requests
3. [new] patch 5/7:
- reorder kmalloc_info[], kmalloc_caches[] (in order of size)
- hard to split, so slightly larger
4. [new] patch 6/7:
- initialize kmalloc_cache[] with the same size but different
types
5. [new] patch 7/7:
- modify kmalloc_caches[type][idx] to kmalloc_caches[idx][type]
Patch 4-7 are newly added, more information can be obtained from
commit messages.
Changes in v3
--
1. restore __initconst (patch 1/4)
2. rename patch 3/4
3. add more clarification for patch 4/4
4. add ack tag from Roman Gushchin
Changes in v2
--
1. remove __initconst (patch 1/5)
2. squash patch 2/5
3. add ack tag from Vlastimil Babka
There are three types of kmalloc, KMALLOC_NORMAL, KMALLOC_RECLAIM
and KMALLOC_DMA.
The name of KMALLOC_NORMAL is contained in kmalloc_info[].name,
but the names of KMALLOC_RECLAIM and KMALLOC_DMA are dynamically
generated by kmalloc_cache_name().
Patch1 predefines the names of all types of kmalloc to save
the time spent dynamically generating names.
These changes make sense, and the time spent by new_kmalloc_cache()
has been reduced by approximately 36.3%.
Time spent by new_kmalloc_cache()
(CPU cycles)
5.3-rc7 66264
5.3-rc7+patch 42188
Pengfei Li (3):
mm, slab: Make kmalloc_info[] contain all types of names
mm, slab: Remove unused kmalloc_size()
mm, slab_common: Use enum kmalloc_cache_type to iterate over kmalloc
caches
include/linux/slab.h | 20 -----------
mm/slab.c | 7 ++--
mm/slab.h | 2 +-
mm/slab_common.c | 99 ++++++++++++++++++++++++++++------------------------
4 files changed, 58 insertions(+), 70 deletions(-)
--
2.7.4
next reply other threads:[~2019-09-23 12:27 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-09-23 12:27 Pengfei Li [this message]
2019-09-23 12:27 ` [PATCH v6 1/3] mm, slab: Make kmalloc_info[] contain all types of names Pengfei Li
2019-09-23 12:27 ` [PATCH v6 2/3] mm, slab: Remove unused kmalloc_size() Pengfei Li
2019-09-23 12:27 ` [PATCH v6 3/3] mm, slab_common: Use enum kmalloc_cache_type to iterate over kmalloc caches Pengfei Li
2019-10-02 23:06 ` [PATCH v6 0/3] mm, slab: Make kmalloc_info[] contain all types of names Andrew Morton
2019-10-08 14:21 ` Pengfei Li
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=1569241648-26908-1-git-send-email-lpf.vector@gmail.com \
--to=lpf.vector@gmail.com \
--cc=akpm@linux-foundation.org \
--cc=cl@linux.com \
--cc=guro@fb.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 \
--cc=vbabka@suse.cz \
/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).