From: David Rientjes <rientjes@google.com>
To: Pengfei Li <lpf.vector@gmail.com>
Cc: akpm@linux-foundation.org, vbabka@suse.cz, cl@linux.com,
penberg@kernel.org, iamjoonsoo.kim@lge.com, linux-mm@kvack.org,
linux-kernel@vger.kernel.org, guro@fb.com
Subject: Re: [RESEND v4 7/7] mm, slab_common: Modify kmalloc_caches[type][idx] to kmalloc_caches[idx][type]
Date: Sun, 15 Sep 2019 14:38:40 -0700 (PDT) [thread overview]
Message-ID: <alpine.DEB.2.21.1909151437530.211705@chino.kir.corp.google.com> (raw)
In-Reply-To: <20190915170809.10702-8-lpf.vector@gmail.com>
On Mon, 16 Sep 2019, Pengfei Li wrote:
> KMALLOC_NORMAL is the most frequently accessed, and kmalloc_caches[]
> is initialized by different types of the same size.
>
> So modifying kmalloc_caches[type][idx] to kmalloc_caches[idx][type]
> will benefit performance.
>
> $ ./scripts/bloat-o-meter vmlinux.patch_1-6 vmlinux.patch_1-7
> add/remove: 0/0 grow/shrink: 2/57 up/down: 8/-457 (-449)
> Function old new delta
> tg3_self_test 4255 4259 +4
> nf_queue 666 670 +4
> kmalloc_slab 97 93 -4
> i915_sw_fence_await_dma_fence 441 437 -4
> __igmp_group_dropped 619 615 -4
> gss_import_sec_context 176 170 -6
> xhci_alloc_command 212 205 -7
> create_kmalloc_caches 155 148 -7
> xprt_switch_alloc 136 128 -8
> xhci_segment_alloc 297 289 -8
> xhci_ring_alloc 369 361 -8
> xhci_mem_init 3664 3656 -8
> xhci_alloc_virt_device 496 488 -8
> xhci_alloc_tt_info 346 338 -8
> xhci_alloc_stream_info 718 710 -8
> xhci_alloc_container_ctx 215 207 -8
> xfrm_policy_alloc 271 263 -8
> tcp_sendmsg_locked 3120 3112 -8
> tcp_md5_do_add 774 766 -8
> tcp_fastopen_defer_connect 270 262 -8
> sr_read_tochdr.isra 251 243 -8
> sr_read_tocentry.isra 328 320 -8
> sr_is_xa 376 368 -8
> sr_get_mcn 260 252 -8
> selinux_sk_alloc_security 113 105 -8
> sdev_evt_send_simple 118 110 -8
> sdev_evt_alloc 79 71 -8
> scsi_probe_and_add_lun 2938 2930 -8
> sbitmap_queue_init_node 418 410 -8
> ring_buffer_read_prepare 94 86 -8
> request_firmware_nowait 396 388 -8
> regulatory_hint_found_beacon 394 386 -8
> ohci_urb_enqueue 3176 3168 -8
> nla_strdup 142 134 -8
> nfs_alloc_seqid 87 79 -8
> nfs4_get_state_owner 1040 1032 -8
> nfs4_do_close 578 570 -8
> nf_ct_tmpl_alloc 85 77 -8
> mempool_create_node 164 156 -8
> ip_setup_cork 362 354 -8
> ip6_setup_cork 1021 1013 -8
> gss_create_cred 140 132 -8
> drm_flip_work_allocate_task 70 62 -8
> dma_pool_alloc 410 402 -8
> devres_open_group 214 206 -8
> cfg80211_stop_iface 260 252 -8
> cfg80211_sinfo_alloc_tid_stats 77 69 -8
> cfg80211_port_authorized 212 204 -8
> cfg80211_parse_mbssid_data 2397 2389 -8
> cfg80211_ibss_joined 335 327 -8
> call_usermodehelper_setup 149 141 -8
> bpf_prog_alloc_no_stats 182 174 -8
> blk_alloc_flush_queue 191 183 -8
> bdi_alloc_node 195 187 -8
> audit_log_d_path 196 188 -8
> _netlbl_catmap_getnode 247 239 -8
> ____ip_mc_inc_group 475 467 -8
> __i915_sw_fence_await_sw_fence 417 405 -12
> ida_alloc_range 955 934 -21
> Total: Before=14874316, After=14873867, chg -0.00%
>
> Signed-off-by: Pengfei Li <lpf.vector@gmail.com>
This also seems more intuitive.
Acked-by: David Rientjes <rientjes@google.com>
prev parent reply other threads:[~2019-09-15 21:38 UTC|newest]
Thread overview: 24+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-09-15 17:08 [RESEND v4 0/7] mm, slab: Make kmalloc_info[] contain all types of names Pengfei Li
2019-09-15 17:08 ` [RESEND v4 1/7] " Pengfei Li
2019-09-15 21:38 ` David Rientjes
2019-09-16 14:52 ` Pengfei Li
2019-09-15 17:08 ` [RESEND v4 2/7] mm, slab: Remove unused kmalloc_size() Pengfei Li
2019-09-15 21:38 ` David Rientjes
2019-09-15 17:08 ` [RESEND v4 3/7] mm, slab_common: Use enum kmalloc_cache_type to iterate over kmalloc caches Pengfei Li
2019-09-15 21:38 ` David Rientjes
2019-09-15 17:08 ` [RESEND v4 4/7] mm, slab: Return ZERO_SIZE_ALLOC for zero sized kmalloc requests Pengfei Li
2019-09-15 21:38 ` David Rientjes
2019-09-15 17:08 ` [RESEND v4 5/7] mm, slab_common: Make kmalloc_caches[] start at size KMALLOC_MIN_SIZE Pengfei Li
2019-09-15 21:38 ` David Rientjes
2019-09-17 14:10 ` Pengfei Li
2019-09-16 1:45 ` kbuild test robot
2019-09-16 15:14 ` Pengfei Li
2019-09-16 3:14 ` kbuild test robot
2019-09-16 4:53 ` kbuild test robot
2019-09-16 15:15 ` Pengfei Li
2019-09-16 4:53 ` [RFC PATCH] mm, slab_common: all_kmalloc_info[] can be static kbuild test robot
2019-09-15 17:08 ` [RESEND v4 6/7] mm, slab_common: Initialize the same size of kmalloc_caches[] Pengfei Li
2019-09-15 21:38 ` David Rientjes
2019-09-16 15:04 ` Pengfei Li
2019-09-15 17:08 ` [RESEND v4 7/7] mm, slab_common: Modify kmalloc_caches[type][idx] to kmalloc_caches[idx][type] Pengfei Li
2019-09-15 21:38 ` David Rientjes [this message]
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=alpine.DEB.2.21.1909151437530.211705@chino.kir.corp.google.com \
--to=rientjes@google.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=lpf.vector@gmail.com \
--cc=penberg@kernel.org \
--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