函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

函数名称:vb_free

函数原型:static void vb_free(const void *addr, unsigned long size)

返回类型:void

参数:

类型参数名称
const void *addr
unsigned longsize
1666  BUG_ON(offset_in_page(size))
1667  BUG_ON(size > PAGE_SIZE * 256K with 4K pages )
1669  flush_cache_vunmap((unsignedlong)addr, (unsignedlong)addr + size)
1671  order等于get_order - Determine the allocation order of a memory size*@size: The size for which to get the order* Determine the allocation order of a particular sized block of memory
1673  offset等于addr按位与VMAP_BLOCK_SIZE减1
1674  offset右移等于PAGE_SHIFT determines the page size
1676  vb_idx等于We should probably have a fallback mechanism to allocate virtual memory* out of partially filled vmap blocks. However vmap block sizing should be* fairly reasonable according to the vmalloc size, so it shouldn't be a* big problem.
1677  _read_lock() - mark the beginning of an RCU read-side critical section* When synchronize_rcu() is invoked on one CPU while other CPUs* are within RCU read-side critical sections, then the* synchronize_rcu() is guaranteed to block until after all the other
1678  vb等于adix_tree_lookup - perform lookup operation on a radix tree*@root: radix tree root*@index: index key* Lookup the item at the position @index in the radix tree @root.* This function can be called under rcu_read_lock, however the caller
1679  _read_unlock() - marks the end of an RCU read-side critical section.* In most situations, rcu_read_unlock() is immune from deadlock.* However, in kernels built with CONFIG_RCU_BOOST, rcu_read_unlock()
1680  BUG_ON(!vb)
1682  vunmap_page_range((unsignedlong)addr, (unsignedlong)addr + size)
1684  如果For use in fast paths after init_debug_pagealloc() has run, or when a* false negative result is not harmful when called too early.flush_tlb_kernel_range((unsignedlong)addr, (unsignedlong)addr + size)
1688  加自旋锁
1691  dirty_min等于两数取小(dirty_min, offset)
1692  < dirty range 等于两数取大(< dirty range , offset + (1UL << order))
1694  dirty加等于1UL左移order
1695  如果dirty恒等于VMAP_BBMAP_BITS
1696  BUG_ON(free)
1697  自旋锁解锁
1698  free_vmap_block(vb)
1699  否则自旋锁解锁
调用者
名称描述
vm_unmap_ramvm_unmap_ram - unmap linear kernel address space set up by vm_map_ram*@mem: the pointer returned by vm_map_ram*@count: the count passed to that vm_map_ram call (cannot unmap partial)