vmalloc 分配器初始化问题
在 Vmalloc 分配器进行初始化时,遇到这个问题,源码如下:void __init vmalloc_init(void)
{
struct vmap_area *va;
struct vm_struct *tmp;
int i;
for_each_possible_cpu(i) {
struct vmap_block_queue *vbq;
vbq = &per_cpu(vmap_block_queue, i);
spin_lock_init(&vbq->lock);
INIT_LIST_HEAD(&vbq->free);
........
}
当内核在初始化 vmalloc 分配器的时候,请问 vmap_block_queue 是在何处定义? struct vmap_block_queue {
spinlock_t lock;
struct list_head free;
};mm/vmalloc.c 回复 2# hnwyllmm
谢谢,刚刚找到了,定义如下: vmalloc.c
/* Queue of free and dirty vmap blocks, for allocation and flushing purposes */
static DEFINE_PER_CPU(struct vmap_block_queue, vmap_block_queue);
页:
[1]