简体   繁体   English

linux kernel vfree()如何同步主内核页表和进程的页表?

[英]linux kernel vfree() how to synchronize master kernel page table and process's page table?

I know how vmalloc() does。 When a process(in kernel space) want to access the memory that belongs to vmalloc(),a page fault happens and does the synchronization。 我知道vmalloc()的工作方式。当一个进程(在内核空间中)要访问属于vmalloc()的内存时,将发生页面错误并进行同步。

But when it invokes the vfree(), how the process update its page table to sync with the master kernel page table? Or I have some understandings with it. 但是当它调用vfree()时,进程如何更新其页表以与主内核页表同步?或者我对此有一些了解。

Thanks. 谢谢。

your understanding of memory allocation is seems to be incorrect. 您对内存分配的理解似乎不正确。 No memory belongs to vmalloc. 没有内存属于vmalloc。 A fixed virtual address (of kernel space) is assigned to vmalloc at boot up time. 在启动时,将(内核空间的)固定虚拟地址分配给vmalloc。 Later when vmalloc is called then virtual addresses are picked from fix allocated range and physical memory pages are allocated from buddy system. 稍后,当调用vmalloc时,将从固定分配的范围中选择虚拟地址,并从伙伴系统分配物理内存页。

Virtual addresses and physical pages are mapped one to one. 虚拟地址和物理页面是一对一映射的。

when vfree() is called, the virtual address range is freed again , so does the physical pages are return to buddy system. 调用vfree()时,将再次释放虚拟地址范围,物理页面也将返回到伙伴系统。

Hope this correct your understanding. 希望这能纠正您的理解。

I suggest you go through some online tutorial about kernel memory as also reading them now. 我建议您同时阅读一些有关内核内存的在线教程。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM