1 ============================ 2 Subsystem Trace Points: kmem 3 ============================ 4 5 The kmem tracing system captures events relate 6 within the kernel. Broadly speaking there are 7 8 - Slab allocation of small objects of unknow 9 - Slab allocation of small objects of known 10 - Page allocation 11 - Per-CPU Allocator Activity 12 - External Fragmentation 13 14 This document describes what each of the trace 15 might be useful. 16 17 1. Slab allocation of small objects of unknown 18 ============================================== 19 :: 20 21 kmalloc call_site=%lx ptr=%p b 22 kmalloc_node call_site=%lx ptr=%p bytes_req 23 kfree call_site=%lx ptr=%p 24 25 Heavy activity for these events may indicate t 26 justified, particularly if kmalloc slab pages 27 internal fragmented as a result of the allocat 28 kmalloc with kfree, it may be possible to iden 29 the allocation sites were. 30 31 32 2. Slab allocation of small objects of known t 33 ============================================== 34 :: 35 36 kmem_cache_alloc call_site=%lx ptr=%p b 37 kmem_cache_alloc_node call_site=%lx ptr=%p b 38 kmem_cache_free call_site=%lx 39 40 These events are similar in usage to the kmall 41 it is likely easier to pin the event down to a 42 of writing, no information is available on wha 43 but the call_site can usually be used to extra 44 45 3. Page allocation 46 ================== 47 :: 48 49 mm_page_alloc page=%p pfn=%lu orde 50 mm_page_alloc_zone_locked page=%p pfn=%lu or 51 mm_page_free page=%p pfn=%lu orde 52 mm_page_free_batched page=%p pfn=%lu orde 53 54 These four events deal with page allocation an 55 a simple indicator of page allocator activity. 56 the per-CPU allocator (high performance) or th 57 58 If pages are allocated directly from the buddy 59 mm_page_alloc_zone_locked event is triggered. 60 amounts of activity imply high activity on the 61 impairs performance by disabling interrupts, d 62 CPUs and serialising many CPUs. 63 64 When a page is freed directly by the caller, t 65 is triggered. Significant amounts of activity 66 callers should be batching their activities. 67 68 When pages are freed in batch, the also mm_pag 69 Broadly speaking, pages are taken off the LRU 70 freed in batch with a page list. Significant a 71 indicate that the system is under memory press 72 contention on the lruvec->lru_lock. 73 74 4. Per-CPU Allocator Activity 75 ============================= 76 :: 77 78 mm_page_alloc_zone_locked page=%p pfn=%l 79 mm_page_pcpu_drain page=%p pfn=%l 80 81 In front of the page allocator is a per-cpu pa 82 for order-0 pages, reduces contention on the z 83 amount of writing on struct page. 84 85 When a per-CPU list is empty or pages of the w 86 the zone->lock will be taken once and the per- 87 triggered is mm_page_alloc_zone_locked for eac 88 event indicating whether it is for a percpu_re 89 90 When the per-CPU list is too full, a number of 91 which triggers a mm_page_pcpu_drain event. 92 93 The individual nature of the events is so that 94 between allocation and freeing. A number of dr 95 consecutively imply the zone->lock being taken 96 refills and drains could imply an imbalance be 97 is being concentrated in one place. It could a 98 lists should be a larger size. Finally, large 99 and drains on another could be a factor in cau 100 line bounces due to writes between CPUs and wo 101 can be allocated and freed on the same CPU thr 102 103 5. External Fragmentation 104 ========================= 105 :: 106 107 mm_page_alloc_extfrag page=%p pfn=%l 108 109 External fragmentation affects whether a high- 110 successful or not. For some types of hardware, 111 it is avoided where possible. If the system is 112 to be able to resize the pool over the lifetim 113 is important. 114 115 Large numbers of this event implies that memor 116 high-order allocations will start failing at s 117 means of reducing the occurrence of this event 118 min_free_kbytes in increments of 3*pageblock_s 119 pageblock_size is usually the size of the defa
Linux® is a registered trademark of Linus Torvalds in the United States and other countries.
TOMOYO® is a registered trademark of NTT DATA CORPORATION.