Presentation is loading. Please wait.

Presentation is loading. Please wait.

Tru64 UNIX Internals IIProcess Address Space1 - 1 Representing a Process’s Address Space Chapter One.

Similar presentations


Presentation on theme: "Tru64 UNIX Internals IIProcess Address Space1 - 1 Representing a Process’s Address Space Chapter One."— Presentation transcript:

1 Tru64 UNIX Internals IIProcess Address Space1 - 1 Representing a Process’s Address Space Chapter One

2 Tru64 UNIX Internals IIProcess Address Space1 - 2 While Compaq believes the information included in this presentation is correct as of the date produced, it is subject to change without notice. All rights reserved. Compaq, the Compaq logo, DIGITAL and the DIGITAL logo are trademarks of Compaq Computer Corporation. IBM is a registered trademark of International Business Machines. Microsoft is a registered trademark of Microsoft Corporation.

3 Tru64 UNIX Internals IIProcess Address Space1 - 3 Topics q Introduction F What a Process Expects F Different Regions in an Address Space q Process Virtual Memory Maps q Operations on Process Virtual Memory Maps

4 Tru64 UNIX Internals IIProcess Address Space1 - 4 What a process sees STACK TEXT DATA HEAP Shared Libraries 3 - 8K Pages Virtual Address Space 2^42 bytes 0 TEXT DATA MMAP and SYSV Segments

5 Tru64 UNIX Internals IIProcess Address Space1 - 5 What the VM System is Doing Virtual Address Space STACK TEXT DATA HEAP TEXT DATA 2^42 bytes 0 Physical MemorySwap Partition File System Partition ZFOD TEXT pages MMAP SHARED pages INITIALIZED DATA and MMAP PRIVATE pages STACK, UNINITIALIZED DATA, and HEAPpages

6 Tru64 UNIX Internals IIProcess Address Space1 - 6 Task VAS Map vm_ map Memory Objects vm_objects Virtual Address Space (VAS) Stack Text Data Heap III AAA BBB CCC DDD EEE FFF GGG HHH Mapped Data Virtual Memory Components Swap PartitionFile System 000 AAA rwx BBB HHH rwx III CCC r-x DDD DDD rwx EEE FFF rwx GGG vm_map_entry structures pmap

7 Tru64 UNIX Internals IIProcess Address Space1 - 7 Objectifying VM - Operations Vectors 1 1fff 8000 1 2000 0000 rwx 1 2000 0000 1 2000 4000 r-x 1 4000 0000 1 4000 2000 rwx 1 4000 2000 1 4000 c000 rwx 3ff 8003 c000 3ff 8080 c000 r-x 10 000 - 400 0000 0000 pmap Task vm_map.map vm_pmap stack text init data bss shared library page list page list page list page list vm_objects vm_map_entries generic part type specific part Swap info vnode info Swap info vnode info type specific operations vector type specific operations vector type specific operations vector

8 Tru64 UNIX Internals IIProcess Address Space1 - 8 VM Skiplists (1) q Prior to V5.0 F vm_map_entries were an ordered circular link list where the beginning and end elements were set to it’s vm_map F in order by the start of the vm address the map entry represented F the vm_map and each vm_map_entry contained the vm_map_links data structure: q struct vm_map_links { struct vm_map_entry *prev;/* previous entry */ struct vm_map_entry *next;/* next entry */ vm_offset_t start;/* start address */ vm_offset_t end;/* end address */ };

9 Tru64 UNIX Internals IIProcess Address Space1 - 9 VM Skiplists (2) q Skip lists were introduced in V5.0 F Optimize vm_map_entry management in large address spaces F Each vm_map_entry contains the vm_map_links data structure: q struct vm_map_links { struct vm_map_entry *vml_prev;/* previous entry */ vm_offset_t vml_start;/* start address */ vm_offset_t vml_end;/* end address */ struct vm_map_entry *vml_sl_next[MESL_NLEVELS]; }; q vm_map_entries are still an ordered circular link list along vml_sl_next[0] q Other levels (vml_sl_next[1-3]) are randomly assigned when the number of vm_map_entries reach or exceed MESL_THRESHOLD (16)

10 Tru64 UNIX Internals IIProcess Address Space1 - 10 VM Skiplists (3) q the vm_map F Also contains the vm_map_links data structure: q struct vm_map_links { struct vm_map_entry *vml_prev;/* previous entry */ vm_offset_t vml_start;/* start address */ vm_offset_t vml_end;/* end address */ struct vm_map_entry *vml_sl_next[MESL_NLEVELS]; }; q Where n vml_prev points to the last vm_map_entry n vml_start is the value of the smallest vm address in this task n vml_end is the value of the greatest allowable vm address for this task n vm_sl_next[0] points to the first vm_map_entry n vm_sl_next[1-3] are only randomly used if the number of vm_map_entries is greater than MESL_THRESHOLD (16)  vm_mesl_hilevel is set to the maximum active level used in the skip lists (0 if not used)

11 Tru64 UNIX Internals IIProcess Address Space1 - 11 VM Skiplists - an illustration vml_prev vml_sl_next[0] vml_sl_next[1] vml_sl_next[2] vml_sl_next[3] vml_prev vml_sl_next[0] vml_sl_next[1] vml_sl_next[2] vml_sl_next[3] vm_mesl_hilevel=2 Task vm_map.map vm_map_entries... vml_prev vml_sl_next[0] vml_sl_next[1] vml_sl_next[2] vml_sl_next[3] vml_prev vml_sl_next[0] vml_sl_next[1] vml_sl_next[2] vml_sl_next[3] vml_prev vml_sl_next[0] vml_sl_next[1] vml_sl_next[2] vml_sl_next[3] vml_start 1 1fff 8000 vml_end 1 2000 0000 vml_start 1 2000 0000 vml_end 1 2000 4000 vml_start 1 4000 0000 vml_end 1 4000 2000 vml_start 3ff 8003 c000 vml_end 3ff 8080 c000 vml_start 10 000 - vml_end 400 0000 0000

12 Tru64 UNIX Internals IIProcess Address Space1 - 12 Special Case: Kernel Map Submaps pmap Kernel Task vm_map_entrys vm_map vm_object.submap vm_map_entrys vme_uobject.vm_object page lists vm_objects page lists vm_objects vme_uobject.vm_object vm_links.next vm_links.prev "kernel map" vm_map vm_pmap

13 Tru64 UNIX Internals IIProcess Address Space1 - 13 Memory Objects can be Shared & Backed by Objects vm_map pmap task A vm_pmap vm_links.next vm_links.prev vm_map_entrys vm_object ref_cnt=2 vm_objects ob_memq page lists vm_map pmap task B vm_map_entrys ob_ops backing object vm_anon_object

14 Tru64 UNIX Internals IIProcess Address Space1 - 14 VM Data Structures (1) StructureFunction vm_mapActs as head of a doubly linked circular list of vm_map_entry structures vm_map_opsContains pointers to specific functions that perform operations on address maps pmapMachine-dependent structure describing VA to PA mapping vm_map_entryDescribes a contiguous region of virtual address space within the task address space with common attributes vm_map_entry_opsPointers to specific functions that perform operations on memory

15 Tru64 UNIX Internals IIProcess Address Space1 - 15 VM Data Structures (2) StructureFunction vm_objectMaintains information about resident and non-resident memory pages to resolve requests for them. There are several types of objects: - File system shared vnode - mmapped vnode - Anonymous memory - Swap object - Memory managed device vm_object_opsContains pointers to specific functions that perform operations on memory objects

16 Tru64 UNIX Internals IIProcess Address Space1 - 16 struct vm_map (1) struct vm_map { struct vm_map_links vm_links;/*Links to vm_map_entrys */ unsigned int vm_nentries;/*Number of vme entries */ unsigned int vm_is_mainmap :1,/*Main or submap */ vm_copy_map:1,/*Kernel copy submap */ vm_entries_pageable:1, /*Kernel map entries */ vm_wait_for_space:1,/*Wait for space */ vm_umap:1,/*User space map */ vm_lazy_map:1,/*Map swapped lazily? */ :20,/*Filler */ vm_mesl_hilevel:6; /*Skip list, max active level*/ struct mesl_pathvm_mesl_path;/*mesl search path (default 4 levels)*/ vm_map_entry_t vm_hint;/*Hint for quick lookups*/ decl_simple_lock_data(,vm_hint_lock)/*lock for vm_hint*/ struct vm_map_ops*vm_ops; /*Operations on address space*/ lock_data_t vm_lock;/*Lock for map data */...

17 Tru64 UNIX Internals IIProcess Address Space1 - 17 struct vm_map (2) … vm_size_t vm_size;/*Task's virtual size*/ struct pmap *vm_pmap;/*Pointer to physical map (page tables) */ decl_simple_lock_data(,vm_ref_lock)/*vm_ref_count lock*/ vm_map_entry_t vm_first_free;/*First free space hint*/ vm_offset_t vm_private;/*Map private information*/ int vm_ref_count; /*Reference count*/ int vm_res_count; /*Map resident count*/ unsigned int vm_fault_rate; /*Pagefaults over time*/ int vm_pagefaults;/*Accumulated pagefault*/ unsigned int vm_faultrate_time;/*Last time updated fault rate*/ unsigned short vm_color[2]; /*Color buckets*/ };

18 Tru64 UNIX Internals IIProcess Address Space1 - 18 Operations on Maps  vm_xxx_map() calls are actually macros to invoke map operation instances, e.g.: #define vm_deallocate_mapvm_ops->mo_deallocate q Three instances of map ops are used:  User Maps vm_umap.c  Kernel Maps vm_kmap.c  Copy Maps vm_cmap.c q represents memory copied from an address map (copy on write) q used for inter-map copy operations to support copyin() and copy out() functions q act like a subset of the fork() operation

19 Tru64 UNIX Internals IIProcess Address Space1 - 19 Operations on Address Maps (1) OperationFunction mo_deallocate Dereferences a map, deleting it if no references remain mo_fault Handles a page fault mo_wire Wires pages in a range mo_allocate Allocates an address space mo_map_enter Allocates a range in the specified map mo_protect Sets protection attribute on a range mo_inherit Sets inheritance attribute on a range: inheritance affects how the map will be shared with child maps mo_keep_on_exec Sets keep-on-exec state of address range mo_exec Supports exec() system call; deallocates range not marked keep-on-exec

20 Tru64 UNIX Internals IIProcess Address Space1 - 20 Operations on Address Maps (2) OperationFunction mo_delete Deletes address space mo_check_protection Checks protection attribute against specified protection mo_copy_overwrite Copies and overwrites an address space mo_copyout Copies an address space (copies map) mo_copyin Creates a copy map mo_fork Supports fork () system call; return a duplicate of the given map

21 Tru64 UNIX Internals IIProcess Address Space1 - 21 struct vm_map_entry (1) struct vm_map_entry { struct vm_map_links vme_links; /*Links to other entries*/ struct vm_map *vme_map; /*Map which owns us*/ union vm_map_object vme_uobject;/*Object or submap*/ /* typedef union vm_map_object { struct vm_object *vm_object; struct vm_map *sub_map; } vm_map_object_t; */ union { vm_offset_ttvme_offset; /*Offset into object*/ struct vm_seg*tvme_seg; /*Points to segment map*/ } vmet; struct vm_map_entry_ops *vme_ops; /*Map entry operations*/ struct vpage vme_vpage; /*Virtual page reference used during faults*/ decl_simple_lock_data(, vme_faultlock) /*Fault locking*/ unsigned int vme_faults; /*Active faults*/ …/* continued on next page*/

22 Tru64 UNIX Internals IIProcess Address Space1 - 22 struct vm_map_entry (2) … /*struct vm_map_entry continued from previous page*/ union { struct { unsigned int /*User map entry info*/ uvme_faultwait : 1, uvme_keep_on_exec: 1, uvme_inheritance : 2, uvme_maxprot : 3; } uvme; struct { unsigned int /*Kernel map entry info*/ kvme_faultwait: 1, kvme_is_submap: 1, kvme_copymap : 1; } kvme; } vmeu; vm_offset_t vme_private;/*Private data for map storage specific to map entry type*/ };

23 Tru64 UNIX Internals IIProcess Address Space1 - 23 VM Map Entry Operations (1) q Kernel Map Entries F Currently invalid regionsk_mape_inv.c F IO space mappings k_mape_io.c F Normal kernel virtualk_mape_mem.c q User Map Entries F Anonymous memory u_mape_anon.c F Memory mapped device u_mape_dev.c F Segment address space u_mape_seg.c F Shared segment space u_mape_ssm.c F System V shared memory u_mape_shm.c F File System vnode u_mape_vp.c

24 Tru64 UNIX Internals IIProcess Address Space1 - 24 VM Map Entry Operations (2) OperationFunction me_fault Satisfies fault request me_dup Duplicates a map entry me_unmap Deletes virtual space within the map entry me_msync Supports msync() system call for mapped character devices (only on some platforms) me_lockup Locks virtual space me_swap Swaps out map entry state (not supported) me_core Handles sparse user core files me_control Manages various functions me_protect Sets protection of virtual space me_check_protect Checks protection settings me_klusterC allback for object managers to support bringing in multiple pages on a page fault me_copyC allback mechanism for Mach copy release me_grow Grow map entry memory up or down

25 Tru64 UNIX Internals IIProcess Address Space1 - 25 struct vm_object struct vm_object { struct vm_page *ob_memq; /* Resident memory */ decl_simple_lock_data(,ob_lock) struct vm_object_ops *ob_ops; /* Object Operations*/ struct vm_object *ob_aux_obj; /* Auxiliary object */ int ob_ref_count; /* Number of references */ int ob_res_count; /* Object resident count*/ vm_size_t ob_size; /* Size of object */ int ob_resident_pages; /* Pages in ob_memq list*/ ushort ob_flags; /* Flags */ ushort ob_type; /* Object type */ }; Implementation-specific Object Information

26 Tru64 UNIX Internals IIProcess Address Space1 - 26 VM Object Types ( ob_type ) (1) ob_typeStructureWhere Used 0OT_NULLnkernel_objectKernel memory allocators and buffer cache 1OT_UBCvm_ubc_objectFile system shared vnode used by UBC 2OT_ANONvm_anon_objectAnonymous memory 3OT_SWAPvm_swap_objectSwap object 4OT_DEVMAPu_dev_objectMemory mapped device 5OT_KERNELkernel_objectNon-paged kernel memory vm_submap_objectPlaceholder for submap operations 6OT_PKERNELpkernel_objectPageable kernel memory 7OT_SHMvm_shm_objectSystem V shared memory 8OT_SEGvm_seg_objectText segment shared address

27 Tru64 UNIX Internals IIProcess Address Space1 - 27 VM Object Types ( ob_type ) (2) ob_type StructureWhere Used 0x09 OT_RM_K_RCV -layered product-Reflective memory, kernel receive 0x0a OT_RM_K_TRANS -layered product-RM kernel transmit 0x0b OT_RM_U_RCV -layered product-RM user receive 0x0c OT_RM_U_TRANS -layered product-RM user transmit 0x0d OT_RM_U_DUAL -layered product- RM user dual window 0x0e OT_RM_K_DUAL -layered product-RM kernel dual window 0x0f OT_SSM vm_ssm_object System V shared memory, segmented 0x10 OT_STACK vm_stack_objectThread Stack region 0x11 OT_ZKERNEL zkernel_objectKernel ZFOD memory 0x12 OT_LASTMaximum

28 Tru64 UNIX Internals IIProcess Address Space1 - 28 VM Object Flags ( vm_flags ) ob_flags MnemonicDescription 0x0001 OB_SWAPONObject swapping enabled 0x0002 OB_SWAPObject is being swapped 0x0004 OB_SWAPWAITWaiting for swap to Complete 0x0008 OB_CHANGEObject change taking place 0x0010 OB_CHANGEWAIT Waiting for change to complete 0x0020 OB_SEMWAITSemaphore wait 0x0040 OB_SEGALLOCA segment is being allocated 0x0080 OB_SEGWAITWaiting for seg allocation to complete 0x0100 OB_DO_NOT_COALSESDon't coalesce this object 0x0200 OB_UBCWAITWait for write completion in UBC 0x0400 OB_RM_EXISTINGA reflective memory object 0x0800 OB_GRANHINTA granularity hint object 0x8000 OB_FUNNELObject is funneled

29 Tru64 UNIX Internals IIProcess Address Space1 - 29 VM Object Operations (1) OperationFunction ops_lock_try Tries to lock an object ops_unlock Unlocks an object ops_reference References the object; increments the reference and resident counts ops_deallocate Deallocates the object and decrements the reference and resident counts; if not referenced, frees the object ops_pagein Pages in one or more pages ops_pageout Pages out one or more pages ops_swap Swaps out the object ops_control Performs various control functions ops_pagectl Performs various page control functions ops_pagesteal Steals a page ops_pagewrite Writes a page

30 Tru64 UNIX Internals IIProcess Address Space1 - 30 VM Object Operations (2) Wired kernel memory kernel_object_oopsk_mape_mem.c Pageable kernel memory pkernel_object_oopsk_mape_mem.c Anonymous memory u_anon_oops u_mape_anon.c Mmap device u_dev_oopsu_mape_dev.c Segment memory u_seg_oopsu_mape_seg.c SysV shared memory u_shm_oopsu_mape_shm.c Shared segment memory u_ssm_oopsu_mape_ssm.c Mapped file memory u_vp_oopsu_mape_vp.c

31 Tru64 UNIX Internals IIProcess Address Space1 - 31 Kernel Memory Objects F nkernel_object: OT_NULL q A kernel object for funny mappings like kernel memory allocators and the traditional buffer cache F kernel_object: OT_KERNEL q All wired-down kernel memory belongs to a single virtual memory object (kernel_object) to avoid wasting data structures F pkernel_object: OT_PKERNEL q All pageable kernel memory (thread stack_layout structures) that transition from a non-pageable object to a pageable one because of a unwiring belongs to a single object ("pkernel_object") F zkernel_object: OT_ZKERNEL q Kernel ZFOD memory

32 Tru64 UNIX Internals IIProcess Address Space1 - 32 Anonymous Memory Object (OT_ANON) void *ao_pshared struct vm_object ao_object unsigned int ao_flags unsigned int ao_ranon vm_offset_t ao_rbase struct vm_object *ao_bobject vm_offset_t ao_boffset struct vm_anon**ao_anons simple lock ao_lbitslock unsigned long *ao_albits unsigned long ao_wanted struct vm_page *ob_memq simple lock ob_lock struct vm_object_ops *ob_ops struct vm_object *ob_aux_obj int ob_ref_count int ob_res_count vm_size_t ob_size int ob_resident_pages ushort ob_flags ushort ob_type struct vm_object struct vm_anon_object

33 Tru64 UNIX Internals IIProcess Address Space1 - 33 Clustering with struct vm_anon struct vm_anon_object page list optional backing object struct vm_anon to struct vm_swap ob_memq ao_bobject an_un.an_page an_un.an_swap ao_object page list ao_anons

34 Tru64 UNIX Internals IIProcess Address Space1 - 34 Shared Memory Object (OT_SHM) struct vm_shm_object struct vm_anon_object so_anon_object struct shmid_internal *so_sp unsigned int so_wire_count struct vm_anon_object so_anon_object struct shmid_internal *so_sp unsigned int so_wire_count struct shmid_internal struct shmid_ds { struct ipc_perm shm_perm time_t shm_atime time_t shm_dtime time_t shm_ctime size_t shm_segsz pid_t shm_lpid pid_t shm_cpid shmatt_t shm_nattch secinfo_t *shm_secattr } s; struct vm_object *shm_object

35 Tru64 UNIX Internals IIProcess Address Space1 - 35 Thread Stack Object (OT_STACK) struct vm_stack_object struct vm_anon_object stk_aobj vm_size_t stk_rsize vm_size_t stk_ysize vm_size_t stk_incr unsigned long stk_node struct vm_anon_object stk_aobj vm_size_t stk_rsize vm_size_t stk_ysize vm_size_t stk_incr unsigned long stk_node

36 Tru64 UNIX Internals IIProcess Address Space1 - 36 UBC Memory Object (OT_UBC) struct vm_object struct vm_object vu_object struct vfs_ubcops *vu_ops union vfs_private { struct vnode *vp struct bfAccess *ap } vu_vfp; struct vm_page *vu_cleanpl struct vm_page *vu_cleanwpl struct vm_page *vu_dirtywpl int vu_wirecnt int vu_nsequential vm_offset_t vu_loffset unsigned int vu_stamp unsigned int vu_txtref simple lock vu_seglock struct vm_seg *vu_seglist void *vu_pshared vm_page_t cached_free_pages struct vm_ubc_object

37 Tru64 UNIX Internals IIProcess Address Space1 - 37 Swap Memory Object (OT_SWAP) struct vm_swap_object ob_ref_count ob_res_count ob_size ob_resident_pages ob_flags ob_memq ob_ops vm_object_ops ob_type vm_page sw_sp sw_object struct vm_object to struct vm_swap

38 Tru64 UNIX Internals IIProcess Address Space1 - 38 Segment Memory Object (OT_SEG) struct vm_seg_object struct vm_object struct vm_anon_object so_anon_object struct shmid_internal *so_sp unsigned int so_wire_count struct vm_anon_object so_anon_object struct shmid_internal *so_sp unsigned int so_wire_count struct shmid_internal struct shmid_ds { struct ipc_perm shm_perm time_t shm_atime time_t shm_dtime time_t shm_ctime size_t shm_segsz pid_t shm_lpid pid_t shm_cpid shmatt_t shm_nattch secinfo_t *shm_secattr } s; struct vm_object *shm_object

39 Tru64 UNIX Internals IIProcess Address Space1 - 39 Segment Memory Object (OT_SEG) struct vm_seg_object ob_ref_count ob_res_count ob_size ob_resident_pages ob_flags ob_memq ob_ops = u_anon_oop vm_object_ops ob_type vm_page sego_segbase sego_pmap sego_flags sego_cfl sego_cbl sego_nseg sego_object sego_seglist

40 Tru64 UNIX Internals IIProcess Address Space1 - 40 Process Actions That Affect VM q System Interfaces, e.g.: F fork() F exec() F brk(), sbrk(), mmap() F mlock() F shmget(), shmctl() F getrlimit()/setrlimit() q Exceptions, e.g.: F Page fault F Invalid Reference F Invalid Access

41 Tru64 UNIX Internals IIProcess Address Space1 - 41 Initial Process Virtual Memory ( fork() ) 1 1fff 8000 1 2000 0000 rwx 1 2000 0000 1 2000 4000 r-x 1 4000 0000 1 4000 2000 rwx 1 4000 2000 1 4000 c000 rwx 3ff 8003 c000 3ff 8080 c000 r-x 10 000 - 400 0000 0000 pmap Task vm_map.map vm_pmap stacktextinit databss shared library page list page list page list page list vm_objects vm_map_entries Child Parent COW r--

42 Tru64 UNIX Internals IIProcess Address Space1 - 42 Expanding Process Memory ( brk(),sbrk() ) 1 1fff 8000 1 2000 0000 rwx 1 2000 0000 1 2000 4000 r-x 1 4000 0000 1 4000 2000 rwx 1 4000 2000 1 4002 c000 rwx 3ff 8003 c000 3ff 8080 c000 r-x 10 000 - 400 0000 0000 pmap Task vm_map.map vm_pmap stacktextinit databss shared library page list page list page list page list vm_objects vm_map_entries

43 Tru64 UNIX Internals IIProcess Address Space1 - 43 Memory Management Faults Register Values Fault ConditionMMCSR-Value in a1 Translation not valid0 Access violation1 Fault on READ2 Fault on EXECUTE3 Fault on WRITE4 Fault ConditionCause Register-Value in a2 Instruction fetch-1 Load instruction 0 Store instruction 1

44 Tru64 UNIX Internals IIProcess Address Space1 - 44 I-Stream Trap Code Flow in PAL ProgramHardwarePALcodeEntry to Kernel Istream Access Violation Switch stack to kernel * Allocate 6 quads on stack Save gp,pc,ps,a0,a1,a2 on kernel stack exc_addr stack pc kgpr29 Bad VAa0 MMCSRa1 cause codea2 XentMM exec_addr hw_rel _XentMM : (locore.s) Allocate 27 more quads on stack Save all remaining registers if (pmap_fault_on() == FAIL) then try trap() Restore registers from sack call_pal PAL_rtl Disable interrupts Enter pal mode ps is unchanged I-stream mapping off D-stream mapping on pc exc_addr pc pallbase + 7E0 * - only from user mode

45 Tru64 UNIX Internals IIProcess Address Space1 - 45 Locating Pages Task X vm_map_entrys vme_uobject.vm_object vm_links.next vm_links.prev vm_map 0 -1 ffff x 2 0000 - 24 ffff rw 25 0000 - 47 ffff rw 7e00 0000 - 7fff ffff rw pmap vm_pmap page table textstack access violation 20170 page lists vm_ops execution flow (*mo_fault)(...);

46 Tru64 UNIX Internals IIProcess Address Space1 - 46 Handling a Page Fault q Handling a Page Fault F If access is not allowed a signal is posted to the offending thread. F If access is allowed, the page-fault handler follows the pointer to the vm_object. Associated with the object is list of virtual pages belonging to the object: q If the desired page belongs to the object, its contents are fetched from the associated memory object.

47 Tru64 UNIX Internals IIProcess Address Space1 - 47 Source References (1 of 3) q src/kernel/sys/vm_map.h F definitions of vm_map, vm_map_entry and their ops q src/kernel/vm: implementations of Map Ops F vm_map.cgeneric map operations F vm_umap.cuser map operations F vm_kmap.ckernel map operations F vm_cmap.ccopy map operations q src/kernel/vmImplementation of Kernel Map Entry Ops F k_mape_inv.cinvalid kernel map entry operations F k_mape_io.ckernel io space map entry operations F k_mape_mem.c kernel memory map operations

48 Tru64 UNIX Internals IIProcess Address Space1 - 48 Source References (2 of 3) q src/kernel/vmImplementations of User Map Entry Ops F u_mape_anon.cuser anonymous map entry operations F u_mape_dev.cuser mapped device map entry operations F u_mape_seg.c user map text segment entry operations F u_mape_ssm.c user map shared text segment entry operations F u_mape_shm.cuser shared memory map entry operations F u_mape_vp.cuser map file map entry operations q src/kernel/vm/vm_object.h F vm_object and vm_object_ops definitions

49 Tru64 UNIX Internals IIProcess Address Space1 - 49 Source References (3 of 3) q src/kernel/vmDefinitions of Object Types F vm_object.cdefinition of nkernel, kernel and pkernel objects F vm_anon.hdefinition of vm_anon_object and vm_shm_objects F vm_swap.hdefinition of vm_swap_object F u_mape_seg.hdefinition of vm_seg_object F vm_ubc.hdefinition of vm_ubc_object q src/kernel/vmImplementations of Object Ops F k_mape_mem.cWired kernel memory kernel_object_oops F k_mape_mem.cPageable kernel memory pkernel_object_oops F u_mape_anon.cAnonymous memory u_anon_oops F u_mape_dev.cMmap device u_dev_oops F u_mape_seg.cSegment memory u_seg_oops F u_mape_shm.cSysV shared memory u_shm_oops F u_mape_ssm.cShared segment memory u_ssm_oops F u_mape_vp.cMapped file memory u_vp_oops

50 Compaq Computer Corporation © 1998


Download ppt "Tru64 UNIX Internals IIProcess Address Space1 - 1 Representing a Process’s Address Space Chapter One."

Similar presentations


Ads by Google