内部碎片:进程已经申请到了某块内存,在通过虚拟地址空间管理时出现了VMA(virtual memory area)层面的碎片化,导致已经分配出去的物理内存无法得到使用,直到进程退出/释放该内存后,系统才能重新利用这块内存,这种场景称之为内部碎片。 内部与外部都是相对于进程的角度而言的。 1 alloc_pages() 在UMA(Uniform Memory Acces...
static vm_fault_t __handle_mm_fault(struct vm_area_struct *vma, unsigned long address, unsigned int flags) { struct vm_fault vmf = { .vma = vma, .address = address & PAGE_MASK, .flags = flags, .pgoff = linear_page_index(vma, address), .gfp_mask = __get_fault_gfp_mask(vma)...
<6>[ 95.385392] (0)[5:kworker/u:0]binder_release: 2003 threads 1, nodes 0 (ref 0), refs 2, active transactions 0, buffers 1, pages 1 <6>[ 136.355312] (0)[176:Binder_1]binder: 131 close vm area 4081c000-40a1a000 (2040 K) vma 2220051 pagep 79f <6>[ 136.373461] (0)[201...
<6>[ 45.091894] (1)[44:kworker/u:1]binder_release: 1727 threads 4, nodes 2 (ref 2), refs 8, active transactions 0, buffers 0, pages 1 <6>[ 95.385043] (0)[2003:MyClient]binder: 2003 close vm area 401aa000-403a8000 (2040 K) vma 2220051 pagep 79f <6>[ 95.385316] (0)[5:...
2), refs 8, active transactions 0, buffers 0, pages 1 <6>[ 95.385043] (0)[2003:MyClient]binder: 2003 close vm area 401aa000-403a8000 (2040 K) vma 2220051 pagep 79f <6>[ 95.385316] (0)[5:kworker/u:0]binder_release: 2003: page 0 at e0c00000 not freed ...
hugetlb_drop_vma_policy(&pseudo_vma); if (IS_ERR(page)) { if (IS_ERR(folio)) { mutex_unlock(&hugetlb_fault_mutex_table[hash]); error = PTR_ERR(page); error = PTR_ERR(folio); goto out; } clear_huge_page(page, addr, pages_per_huge_page(h)); __SetPageUptodate(page); erro...
struct vm_area_struct *vma, unsigned long addr) { struct page *page = NULL; struct folio *folio = NULL; struct mempolicy *mpol; gfp_t gfp_mask = htlb_alloc_mask(h); int nid; @@ -2460,16 +2460,16 @@ struct page *alloc_buddy_huge_page_with_mpol(struct hstate *h, ...
alloc->buffer_size = min_t(unsigned long, vma->vm_end - vma->vm_start, SZ_4M); mutex_unlock(&binder_alloc_mmap_lock); alloc->buffer = (void __user *)vma->vm_start; alloc->pages = kcalloc(alloc->buffer_size / PAGE_SIZE, ...
* it points to anon_vma object: * see PAGE_MAPPING_ANON below. */ void *s_mem; /* slab first object */ atomic_t compound_mapcount; /* first tail page */ /* page_deferred_list().next -- second tail page */ }; /* Second double word */ ...
Files master LICENSE README mmap_alloc.c mmap_alloc_test.c Latest commit Claudio Scordino Usage of dma_alloc_coherent Sep 21, 2012 4ba696d·Sep 21, 2012 History History