VMA操作问题
有谁知道 struct vm_operations_struct (linux/mm.h) 的 close 函数指针何时被调用?是在指定区域调用munmap的时候吗?
如果是这样,这是否是同步的,意味着从 munmap 返回后应该调用 close ?
Does anyone know when the close function pointer of the struct vm_operations_struct (linux/mm.h) is called? Is it when munmap is called for the specified region?
If so is this synchronous, meaning that the close should have been called after returning from munmap?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
如果我没记错的话,它在 munmap 中,它不一定是同步的,但它确实需要关键部分的一些锁/信号量,以便 get_user_pages 和 access 无法从 munmap'ed 区域错误地读取。如果同步意味着关闭发生在 munmap 中(您的意思是串行),那么是的,vma 区域将从链表中删除,然后交回内核以便为其他进程分配(物理地址)。
If I remember correctly it is in the munmap, It is not necessarily synchronous but it does require some locks/semaphores for the critical sections so that get_user_pages and access cannot read from an munmap'ed area incorrectly. If by synchronous you mean that the close happens in the munmap (by which you mean serially) then yes the vma area is removed from the linked list and then handed back to the kernel for allocating for other processes (the physical addresses).