函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

Source Code:mm\vmalloc.c Create Date:2022-07-27 16:29:55
Last Modify:2020-03-12 14:18:49 Copyright©Brick
首页 函数Tree
注解内核,赢得工具下载SCCTEnglish

函数名称:__vunmap

函数原型:static void __vunmap(const void *addr, int deallocate_pages)

返回类型:void

参数:

类型参数名称
const void *addr
intdeallocate_pages
2279  如果非addr则返回
2282  如果WARN(!st whether an address (unsigned long or pointer) is aligned to PAGE_SIZE (addr), "Trying to vfree() bad address (%p)\n", addr)则返回
2286  area等于d_vm_area - find a continuous kernel virtual area*@addr: base address* Search for the kernel VM area starting at @addr, and return it
2287  如果此条件成立可能性小(为编译器优化)(!area)则
2288  WARN(1, r conditions "Trying to vfree() nonexistent vm area (%p)\n", addr)
2290  返回
2293  Called when kernel memory is freed (or unmapped), or if a lock* is destroyed or reinitialized - this code checks whether there is* any held lock in the memory range of to :
2294  debug_check_no_obj_freed(addr, Lowlevel-APIs (not for driver use!))
2296  kasan_poison_vmalloc(addr, size)
2298  Handle removing and resetting vm mappings related to the vm_struct.
2300  如果deallocate_pages
2303 i小于nr_pages循环
2304  page等于pages[i]
2306  BUG_ON(!page)
2307  __free_pages(page, 0)
2309  atomic_long_sub(nr_pages, & nr_vmalloc_pages)
2311  kvfree() - Free memory.*@addr: Pointer to allocated memory.* kvfree frees memory allocated by any of vmalloc(), kmalloc() or kvmalloc().* It is slightly more efficient to use kfree() or vfree() if you are certain* that you know which one to use.
2314  释放内存
2315  返回
调用者
名称描述
free_work
__vfree
vunmapvunmap - release virtual mapping obtained by vmap()*@addr: memory base address* Free the virtually contiguous memory area starting at @addr,* which was created from the page array passed to vmap().* Must not be called in interrupt context.