一:slub合并说明
kernel有一个默认的行为是把相同大小的slub进行合并,因为每一种slub的维护都需要开销,因此合并相同大小的slub可以节约系统资源,提升性能。事情总是双面的,在经常定位关键的踩内存时,看见这个slub大小了却往往因为合并了slub找不到罪魁祸首是谁,所以本文常见的slub合并打印出来,当读者需要查询哪些合并时候方便查找。
另一个定位方式是关闭slub合并,内核提供了如下参数。
slab_nomerge [MM]
Disable merging of slabs with similar size. May be
necessary if there is some reason to distinguish
allocs to different slabs, especially in hardened
environments where the risk of heap overflows and
layout control by attackers can usually be
frustrated by disabling merging. This will reduce
most of the exposure of a heap attack to a single
cache (risks via metadata attacks are mostly
unchanged). Debug options disable merging on their
own.
二:查询表
kmem_alias
内核版本4.19.17:
左边的项会合并到右边
trace_event_file alias with vmap_area
shared_policy_node alias with ftrace_event_field
Acpi-ParseExt alias with Acpi-State
fs_cache alias with anon_vma_chain
nsproxy alias with Acpi-Parse
key_jar alias with pool_workqueue
seq_file alias with pid
task_delay_info alias with anon_vma_chain
fsnotify_mark_connector alias with numa_policy
file_lock_ctx alias with Acpi-Parse
audit_buffer alias with numa_policy
uid_cache alias with dmaengine-unmap-16
ksm_rmap_item alias with dmaengine-unmap-2
ksm_stable_node alias with dmaengine-unmap-2
ksm_mm_slot alias with ftrace_event_field
khugepaged_mm_slot alias with Acpi-Namespace
bio_integrity_payload alias with dmaengine-unmap-16
biovec-16 alias with pool_workqueue
bio-0 alias with pool_workqueue
eventpoll_epi alias with pid
ip_dst_cache alias with dmaengine-unmap-16
ip_fib_alias alias with Acpi-Parse
ip_fib_trie alias with ftrace_event_field
inet_peer_cache alias with dmaengine-unmap-16
tcp_bind_bucket alias with dmaengine-unmap-2
UDP-Lite alias with UDP
ip_mrt_cache alias with dmaengine-unmap-16
UNIX alias with signal_cache
pid_namespace alias with ip4-frags
fasync_cache alias with ftrace_event_field
bio-1 alias with pool_workqueue
dio alias with task_group
dnotify_mark alias with inotify_inode_mark
fsnotify_mark alias with eventpoll_pwq
fanotify_event_info alias with Acpi-Parse
fanotify_perm_event_info alias with dmaengine-unmap-2
aio_kiocb alias with dmaengine-unmap-16
kioctx alias with task_group
cfq_queue alias with posix_timers_cache
btree_node alias with secpath_cache
sgpool-8 alias with pool_workqueue
sgpool-16 alias with skbuff_fclone_cache
sgpool-32 alias with biovec-64
sgpool-64 alias with biovec-128
UDPLITEv6 alias with UDPv6
ip6_mrt_cache alias with dmaengine-unmap-16
ip6_dst_cache alias with pool_workqueue
fib6_nodes alias with secpath_cache
ip6-frags alias with dmaengine-unmap-16
zswap_entry alias with Acpi-Parse
dm_rq_target_io alias with cfq_io_cq
dm_old_clone_request alias with blkdev_requests
io alias with dmaengine-unmap-2
scsi_data_buffer alias with numa_policy
uhci_urb_priv alias with Acpi-Parse
bio-2 alias with mnt_cache
bio-3 alias with xfrm_dst_cache
bio-4 alias with xfrm_dst_cache
xfs_bmap_free_item alias with dmaengine-unmap-2
xfs_efi_item alias with xfs_efd_item
xfs_ili alias with dmaengine-unmap-16
xfs_icr alias with xfs_log_ticket
xfs_cud_item alias with xfs_rud_item
xfs_cui_item alias with xfs_efd_item
xfs_bud_item alias with xfs_rud_item
xfs_buf alias with mnt_cache
rpc_tasks alias with pool_workqueue
rpc_buffers alias with biovec-128
nf-frags alias with dmaengine-unmap-16
nf_conntrack_expect alias with xfs_bui_item
bridge_fdb_cache alias with secpath_cache
pid_2 alias with secpath_cache
kernel:5.4.71
shared_policy_node alias with ftrace_event_field
Acpi-Namespace alias with ftrace_event_field
Acpi-ParseExt alias with Acpi-State
fs_cache alias with anon_vma_chain
nsproxy alias with Acpi-Parse
key_jar alias with pool_workqueue
kernfs_iattrs_cache alias with Acpi-State
sigqueue alias with Acpi-State
seq_file alias with pid
file_lock_ctx alias with Acpi-Parse
audit_buffer alias with numa_policy
dmaengine-unmap-2 alias with vmap_area
uid_cache alias with skbuff_ext_cache
ksm_rmap_item alias with vmap_area
ksm_stable_node alias with vmap_area
ksm_mm_slot alias with ftrace_event_field
bio_integrity_payload alias with dmaengine-unmap-16
biovec-16 alias with pool_workqueue
bio-0 alias with pool_workqueue
inotify_inode_mark alias with task_delay_info
eventpoll_epi alias with pid
UDP alias with signal_cache
ip_dst_cache alias with dmaengine-unmap-16
ip_fib_alias alias with Acpi-Parse
ip_fib_trie alias with ftrace_event_field
xfrm_dst_cache alias with mnt_cache
inet_peer_cache alias with dmaengine-unmap-16
tcp_bind_bucket alias with skbuff_ext_cache
UDP-Lite alias with signal_cache
ip_mrt_cache alias with dmaengine-unmap-16
posix_timers_cache alias with pool_workqueue
audit_tree_mark alias with Acpi-State
fasync_cache alias with ftrace_event_field
bio-1 alias with pool_workqueue
dio alias with task_group
dnotify_mark alias with task_delay_info
fsnotify_mark alias with eventpoll_pwq
fanotify_event alias with vmap_area
fanotify_perm_event alias with Acpi-Operand
aio_kiocb alias with dmaengine-unmap-16
kioctx alias with task_group
io_kiocb alias with pool_workqueue
btree_node alias with skbuff_ext_cache
sgpool-8 alias with pool_workqueue
sgpool-32 alias with biovec-64
sgpool-64 alias with biovec-128
sgpool-128 alias with biovec-max
UDPLITEv6 alias with UDPv6
ip6_mrt_cache alias with dmaengine-unmap-16
ip6_dst_cache alias with pool_workqueue
fib6_nodes alias with skbuff_ext_cache
zswap_entry alias with Acpi-Parse
io alias with vmap_area
uhci_urb_priv alias with Acpi-Parse
scsi_data_buffer alias with numa_policy
bio-2 alias with mnt_cache
bio-3 alias with pool_workqueue
bio-4 alias with mnt_cache
xfs_log_ticket alias with ip6-frags
xfs_bmap_free_item alias with vmap_area
xfs_efi_item alias with xfs_efd_item
xfs_ili alias with dmaengine-unmap-16
xfs_icr alias with ip6-frags
xfs_cud_item alias with xfs_rud_item
xfs_cui_item alias with xfs_efd_item
xfs_bud_item alias with xfs_rud_item
xfs_bui_item alias with file_lock_cache
xfs_dqtrx alias with user_namespace
rpc_tasks alias with pool_workqueue
rpc_buffers alias with biovec-128
nf-frags alias with ip6-frags
nf_conntrack_expect alias with file_lock_cache
pid_2 alias with skbuff_ext_cache
bridge_fdb_cache alias with skbuff_ext_cache