26
4P13 Week 7 Talking Points 1

4P13 Week 7 Talking Points 1. 2 3 4 Memory Mgmt Data Structs 5

Embed Size (px)

DESCRIPTION

3

Citation preview

Page 1: 4P13 Week 7 Talking Points 1. 2 3 4 Memory Mgmt Data Structs 5

1

4P13Week 7

Talking Points

Page 2: 4P13 Week 7 Talking Points 1. 2 3 4 Memory Mgmt Data Structs 5

2

Page 3: 4P13 Week 7 Talking Points 1. 2 3 4 Memory Mgmt Data Structs 5

3

Page 4: 4P13 Week 7 Talking Points 1. 2 3 4 Memory Mgmt Data Structs 5

4

Page 5: 4P13 Week 7 Talking Points 1. 2 3 4 Memory Mgmt Data Structs 5

5

Memory Mgmt Data Structs

Page 6: 4P13 Week 7 Talking Points 1. 2 3 4 Memory Mgmt Data Structs 5

6

Page 7: 4P13 Week 7 Talking Points 1. 2 3 4 Memory Mgmt Data Structs 5

7

Page 8: 4P13 Week 7 Talking Points 1. 2 3 4 Memory Mgmt Data Structs 5

8

Page 9: 4P13 Week 7 Talking Points 1. 2 3 4 Memory Mgmt Data Structs 5

9

Page 10: 4P13 Week 7 Talking Points 1. 2 3 4 Memory Mgmt Data Structs 5

10

Segment Allocation Policies• VM_BESTFIT: Search for the smallest segment on freelist[n] that can

satisfy the allocation. If none are found, search for the smallest segment on freelist[n + 1] that can satisfy the allocation.

• VM_INSTANTFIT: If the size is exactly 2n, take the first segment on freelist[n]. Otherwise, take the first segment on freelist[n+1]. Any segment on this freelist is necessarily large enough to satisfy the allocation, yielding constant-time performance with a reasonably good fit. Instant fit is the default in FreeBSD because it guarantees constant-time performance, provides low fragmentation in practice, and is easy to implement.

• VM_NEXTFIT: Ignore the freelists altogether and search the arena for the next free segment after the one previously allocated. This option is not supported in FreeBSD 10. The vmem in Solaris supports it for allocating resources like process identifiers.

Page 11: 4P13 Week 7 Talking Points 1. 2 3 4 Memory Mgmt Data Structs 5

11

Page 12: 4P13 Week 7 Talking Points 1. 2 3 4 Memory Mgmt Data Structs 5

12

Page 13: 4P13 Week 7 Talking Points 1. 2 3 4 Memory Mgmt Data Structs 5

13

Page 14: 4P13 Week 7 Talking Points 1. 2 3 4 Memory Mgmt Data Structs 5

14

Vm_object Stores• A collection of the pages for that vm_object that are currently resident

in main memory; a page may be mapped into multiple address spaces, but it is always claimed by exactly one vm_object

• A count of the number of vm_map_entry structures or other vm_objects that reference the vm_object

• The size of the file or anonymous area described by the vm_object• The number of memory-resident pages held by the vm_object• For shadow objects, a pointer to the next vm_object in the chain

(shadow objects are described in Section 6.5)• The type of pager for the vm_object; the pager is responsible for

providing the data to fill a page and for providing a place to store the page when it has been modified (pagers are covered in Section 6.10)

Page 15: 4P13 Week 7 Talking Points 1. 2 3 4 Memory Mgmt Data Structs 5

15

Page 16: 4P13 Week 7 Talking Points 1. 2 3 4 Memory Mgmt Data Structs 5

16

Page 17: 4P13 Week 7 Talking Points 1. 2 3 4 Memory Mgmt Data Structs 5

17

Page 18: 4P13 Week 7 Talking Points 1. 2 3 4 Memory Mgmt Data Structs 5

18

Page 19: 4P13 Week 7 Talking Points 1. 2 3 4 Memory Mgmt Data Structs 5

19

Page 20: 4P13 Week 7 Talking Points 1. 2 3 4 Memory Mgmt Data Structs 5

20

Page 21: 4P13 Week 7 Talking Points 1. 2 3 4 Memory Mgmt Data Structs 5

21

Page 22: 4P13 Week 7 Talking Points 1. 2 3 4 Memory Mgmt Data Structs 5

22

Page 23: 4P13 Week 7 Talking Points 1. 2 3 4 Memory Mgmt Data Structs 5

23

Page 24: 4P13 Week 7 Talking Points 1. 2 3 4 Memory Mgmt Data Structs 5

24

Page 25: 4P13 Week 7 Talking Points 1. 2 3 4 Memory Mgmt Data Structs 5

25

Page 26: 4P13 Week 7 Talking Points 1. 2 3 4 Memory Mgmt Data Structs 5

26