본문 바로가기

리눅스 커널의 구조와 원리/14. 메모리 관리

(7)
[Debug] Simple slub configuration If you enable the following configuration, the slub debugging feature is enabled without using SLUB_DEBUG. CONFIG_POMPEII_SLUB_SIMPLE_DEBUG=y CONFIG_POMPEII_SLUB_FREEPOINTER_DEBUG=y The advantage of this patch is that you are not going through any performance degradation.  This patch is generated based on v4.9.[Part.1]slub: simple debug feature added---diff --git a/arch/arm64/mm/pageattr.c b/arc..
[Linux kernel] Quick Review over OOM(Out of Memory) Killer routine Log at the moment of OOM [ 126.809058] sysrq: Manual OOM execution [ 126.809184] kworker/0:2 invoked oom-killer: gfp_mask=0x6000c0(GFP_KERNEL), nodemask=(null), order=-1, oom_score_ adj=0 [ 126.809217] kworker/0:2 cpuset=/ mems_allowed=0 ... [ 126.810045] lowmem_reserve[]: 0 0 1204 1204 [ 126.810093] HighMem free:1054428kB min:512kB low:7216kB high:13920kB active_anon:22608kB inactive_anon:9220k..
[mm] 'vm_flags' of 'struct vm_area_struct' 'vm_flags' is important field in the 'struct vm_area_struct'. struct vm_area_struct { /* The first cache line has the info for VMA tree walking. */ unsigned long vm_start; /* Our start address within vm_mm. */ unsigned long vm_end; /* The first byte after our end address within vm_mm. */ /* linked list of VM areas per task, sorted by address */ struct vm_area_struct *vm_next, *vm_prev; ... unsig..
[mm] anon page debugging crash64> bt ... #20 [ffffffc00932be70] do_el0_svc at ffffffd174227f30 #21 [ffffffc00932be80] el0_svc at ffffffd174d4d328 #22 [ffffffc00932bea0] el0t_64_sync_handler at ffffffd174d4da20 #23 [ffffffc00932bfe0] el0t_64_sync at ffffffd17421160c PC: 0000007fa528cb20 LR: 0000007fa5237f94 SP: 0000007fc3fc7ad0 X29: 0000007fc3fc7ad0 X28: 000000557d72f000 X27: 0000000000000000 X26: 000000557d6f5000 X25: 0..
[mm] OOM Killer log and kernel code review log [ 747.358161] 81920 pages cma reserved [ 747.358164] Tasks state (memory values in pages): [ 747.358167] [ pid ] uid tgid total_vm rss pgtables_bytes swapents oom_score_adj name [ 747.358186] [ 142] 0 142 12270 43 94208 236 -250 systemd-journal ... [ 747.358591] [ 1468] 0 1468 1740 131 45056 0 0 bash [ 747.358597] [ 1502] 1000 1502 39991 99 65536 0 0 gvfsd-metadata [ 747.358607] [ 1604] 0 16..
[MM] 페이지 엔트리 속성 (PTE) 매크로 https://elixir.bootlin.com/linux/v5.15.30/source/arch/arm64/include/asm/pgtable-hwdef.h#L151 #define PTE_VALID (_AT(pteval_t, 1)
[Linux] mm: memory layout memory layout is traced at boot in the previous kernel version where the current version cannot show the memory map. https://elixir.bootlin.com/linux/v4.14.30/source/arch/arm64/mm/init.c#L583 void __init mem_init(void) { if (swiotlb_force == SWIOTLB_FORCE || max_pfn > (arm64_dma_phys_limit >> PAGE_SHIFT)) swiotlb_init(1); else swiotlb_force = SWIOTLB_NO_FORCE; set_max_mapnr(pfn_to_page(max_pfn) ..