Process Address Space

  • Upload
    avadcs

  • View
    215

  • Download
    0

Embed Size (px)

Citation preview

  • 7/29/2019 Process Address Space

    1/2

    Process Address Space

    1. What is a process address space?a. Address space is the view of memory given to each user space process on the

    system.

    2. Linux is virtual memory OS, memory is virtualized among the processes on the system.3. Process can dynamicallyadd or removememory to its address space through kernel4. What is a segmentation fault?

    a. If a process accesses a address not in its valid address area or if it accesses a validarea in an invalid manner, then the kernel kills the process and returns with message

    calledsegmentation fault.

    5. What is a memory descriptor?a. Kernel represents address space with a data structure called memory descriptori. Process address space is defined in struct mm_struct

    6. Allocating a memory descriptor?a. Memory descriptor associated with a given task is stored in mm field

    7. Destroying a memory descriptor?a. When the process associated with address space exits, the exit_mm () function

    8. Kernel threads?a. Kernel threads do not have a process address space and do not have an associated

    memory descriptor. Its mm filed is NULL.

    9. What are page tables?a. Processors directly operate on physical addresses. Hence when applications access

    virtual memory address, it must be converted into physical address before the

    processor can resolve the request. Lookup of physical address is done using page

    tables. Page tables split virtual address space into chunks. Each chunk is used as an

    index into a table. The entry in this table either points to another table or the

    associated physical page.

    10.What is hierarchy of page tables in linux?a. Linux uses three levels of hierarchy in page tables PGD, PMD and PTE

    11.What is PGD?a. Process global directory (PGD) is top level page table. It consists of an array of pgd_t

    types. In PGD pgd_t points to entries in PMD.

    12.What is PMD?a. Process middle directory (PMD) is second level page table. It consists of array of

    pmd_t types. IN PMD, pmd_t points to entry in PTE table.

    13.What is PTE?a. Page table entry (PTE) is third level page table. It consists of page table entries of

    type pte_t,. Page table entries point to physical page.

    14.What is TLB?a. Process of resolving virtual address to physical address is aided by buffer called

    translation lookaside buffer (TLB). It is implemented in hardware cache. It caches

  • 7/29/2019 Process Address Space

    2/2

    virtual to physical mappings. When accessing virtual address, the processor will

    check if the mapping is cached in TLB. If it is a hit, it immediately returned. If it is a

    miss, page tables are constructed for corresponding physical address.