page-tables

Find which pages are no longer shared with copy-on-write

£可爱£侵袭症+ 提交于 2020-05-11 01:02:35
问题 Say I have a process in Linux from which I fork() another identical process. After fork ing, as the original process will start writing to memory, the Linux copy-on-write mechanism will give the process unique physical memory pages which are different from the one used by the forked process. How can I, at some point of execution, know which pages of the original process have been copied-on-write? I don't want to use SIGSEGV signal handler and give read only access to all the pages in the

Does page walk take advantage of shared tables?

半世苍凉 提交于 2020-01-15 07:53:22
问题 Suppose two address spaces share a largish lump of non-contiguous memory. The system might want to share physical page table(s) between them. These tables wouldn't use Global bits (even if supported), and would tie them to asid s if supported. There are immediate benefits since the data cache will be less polluted than by a copy, less pinned ram, etc. Does the page walk take explicit advantage of this in any known architecture? If so, does that imply the mmu is explicitly caching & sharing

How does the OS update the appropriate page table when it evicts a victim page?

本秂侑毒 提交于 2019-12-13 21:26:20
问题 In an OS that uses virtual memory, each process has a page table. Each page table maps a process's virtual memory pages to the system's physical memory pages and indicates whether a given page is currently valid (loaded in memory) or not. Suppose that memory is running low and the OS needs to choose a page to evict from physical memory. There are different algorithms for this. For example, FIFO, LRU. Once the OS chooses a page to evict, how does it invalidate any existing references to the

How does the page fault handler know where to get the 4K bytes?

…衆ロ難τιáo~ 提交于 2019-12-12 04:21:18
问题 I mean, which file and what's the offset into the file? The page fault handler need to copy 4K bytes from there into the physical RAM. ----------------------EDIT---------------------------- I found out that vm_file in vm_area_struct was just what I was looking for. 回答1: I found out that vm_file in vm_area_struct was just what I was looking for. – xiaokaoy 来源: https://stackoverflow.com/questions/38850533/how-does-the-page-fault-handler-know-where-to-get-the-4k-bytes

Arm64 Linux Page Table Walk

江枫思渺然 提交于 2019-12-06 14:32:15
问题 Currently I'm developing some research-related programs and I need to find the pte of some specific addresses. My development environment is Juno r1 board (CPUs are A53 and A57 ) and it's running arm64 Linux kernel. I use some typical page table walk codes like this: int find_physical_pte(void *addr) { pgd_t *pgd; pud_t *pud; pmd_t *pmd; pte_t *ptep; unsigned long long address; address = (unsigned long long)addr; pgd = pgd_offset(current->mm, address); printk(KERN_INFO "\npgd is: %p\n", (void

Arm64 Linux Page Table Walk

若如初见. 提交于 2019-12-04 20:33:35
Currently I'm developing some research-related programs and I need to find the pte of some specific addresses. My development environment is Juno r1 board (CPUs are A53 and A57 ) and it's running arm64 Linux kernel. I use some typical page table walk codes like this: int find_physical_pte(void *addr) { pgd_t *pgd; pud_t *pud; pmd_t *pmd; pte_t *ptep; unsigned long long address; address = (unsigned long long)addr; pgd = pgd_offset(current->mm, address); printk(KERN_INFO "\npgd is: %p\n", (void *)pgd); printk(KERN_INFO "pgd value: %llx\n", *pgd); if (pgd_none(*pgd) || pgd_bad(*pgd)) return -1;

Determine page table size for virtual memory

限于喜欢 提交于 2019-12-03 04:19:26
问题 Consider a virtual memory system with a 38-bit virtual byte address, 1KB pages and 512 MB of physical memory. What is the total size of the page table for each process on this machine, assuming that the valid, protection, dirty and use bits take a total of 4 bits, and that all the virtual pages are in use? (assume that disk addresses are not stored in the page table.) 回答1: Well, if the question is simply "what is the size of the page table?" irrespective of whether it will fit into physical

Determine page table size for virtual memory

假如想象 提交于 2019-12-02 17:36:43
Consider a virtual memory system with a 38-bit virtual byte address, 1KB pages and 512 MB of physical memory. What is the total size of the page table for each process on this machine, assuming that the valid, protection, dirty and use bits take a total of 4 bits, and that all the virtual pages are in use? (assume that disk addresses are not stored in the page table.) Well, if the question is simply "what is the size of the page table?" irrespective of whether it will fit into physical memory, the answer can be calculated thus: First physical memory. There are 512K pages of physical memory