Q1 (a) (b) (c) (d) (e) (f) A (96 Mb) B(34 Mb) C(18 Mb) A leaves D

B(34 Mb). C(18 Mb). A leaves. D(48 Mb). E(8Mb). 96. 128. 96. 128. 96. 128. 128. 48. 128. 48. 128. The blocks that are not allocated. 128. 34. 128. 34. 128. 34.
92KB taille 1 téléchargements 382 vues
Q1 (a)

(b)

(c)

(d)

(e)

(f)

A (96 Mb)

B(34 Mb)

C(18 Mb)

A leaves

D(48 Mb)

E(8Mb)

96

96 34

128 128 128 128

96 34 18

128 128 128 128

128 128 128 128

48 34 18

128 128 128 128

34 18

0,61

F Rate A (96 Mb)

96

B(34 Mb) 16 32 64 128

34 96

C(18 Mb) 16 32 64 128

18 34 96

A leaves 16 32 64 128

18 34

48 34 18 8

128 128 128 128

D(48 Mb) 16 32 64 128

18 34 48

F Rate

The blocks that are not allocated are not considered in the fragmentation rate

128 128 128 128 0,70

F Rate E(8Mb) 8 18 34 48

16 32 64 128 0,35

F Rate

The blocks that are not allocated are not considered in the fragmentation rate

16 32 64 128

With best fit and inequal partitionning, the FRate is best Due to the block size constraints, best fit has no real impact here 0,39

Q2

t0

first fit P1 H P4 P5 H P2 H P3 P6

32 16 64 8 4 18 22 6 30

(a)

(b)

(c )

(d)

P7(8)

P2 leaves

P3 leaves

P8(22)

P1 P7 H P4 P5 H P2 H P3 P6

32 8 8 64 8 4 18 22 6 30

P1 P7 H P4 P5 H P3 P6

32 8 8 64 8 44 6 30

P1 P7 H P4 P5 H P6

32 8 8 64 8 50 30

P1 P7 H P4 P5 P8 H P6

32 8 8 64 8 22 28 30

F Rate t0

next fit P1 H P4 P5 H P2 H P3 P6

P7(8) 32 16 64 8 4 18 22 6 30

P1 H P4 P5 H P2 P7 H P3 P6

P2 leaves 32 16 64 8 4 18 8 14 6 30

P1 H P4 P5 H P7 H P3 P6

32 16 64 8 22 8 14 6 30

P3 leaves P1 H P4 P5 H P7 H P6

32 16 64 8 22 8 20 30

0,22

P8(22) P1 H P4 P5 P8 P7 H P6

32 16 64 8 22 8 20 30

surprisely, first fit performs best F Rate

0,44

Q3 c. a. 5 levels (256, 128, 64, 32 and 16 Mb) b. A, B, D, F and H on the fourth level (32 Mb) C, E, G, I, J on the fifth level (16 Mb) d, e.recursive searches are supposed to be in the [0 4] interval (tree deep) A 3 t0 A B C D E F G H I J B 0 256 1 C 2 128 1 1 1 1 1 D 0 64 1 1 1 1 E 0 32 2 2 3 3 3 5 4 6 6 6 F 2 16 2 2 2 2 4 4 4 4 G 1 256 256 256 256 256 256 256 256 256 256 256 H 1 I 0 J 1 max is 3 and obtained for A min is 0 and obtained for B, D, E, I f. A B C D E F G H I J Free

Allocated 18 28 9 24 11 19 4 29 7 13 F Rate

Q4 64 Kb = 2^16 then d = 16 4 Gb = 2^32 then m = 32 d = 16, m = 32 then p = 16 and we have 2^16 = 65536 frames / pages 1024 entries * 64 kb = 2^10 pages, with a page size of 2^16 we have 2^10 * 2^16 = 2 ^26 = 64 Mb In the best case 2^32 / 2^26 = 2^6 = 16, thus 1/16 of the memory can be loaded at a maximum in the TLB a.

A(140) = 3 pages B(96) = 2 pages C(220) = 4 pages D(205) = 4 pages E(550) = 9 pages

Hole 14 4 7 8 5 13 12 3 9 3 16 0,82

Buddy 32 32 16 32 16 32 16 32 16 16 The buddies that are not allocated are not considered for the frame rate

b.

(a) (b) A loaded B loaded 0 A0 A0 1 A1 A1 2 A2 A2 3 B0 4 B1 5 6 7 8 9 10 11 12

c.

(c ) C loaded A0 A1 A2 B0 B1 C0 C1 C2 C3

Page table - D 0 1 2 3

d. A C D

Process 140 220 205

(d) (e ) (f) B leaves D loaded A leaves A0 A0 A1 A1 A2 A2 D0 D0 D1 D1 C0 C0 C0 C1 C1 C1 C2 C2 C2 C3 C3 C3 D2 D2 D3 D3

Page table - E 0 1 2 3 4 5 6 7 8

3 4 9 10

Pages 192 256 256

Holes 52 36 51

At F Rate = 1- 52 / (52+36+51) = 0,62

e.

8F0F0 corresponds to p = 8 and d = F0F0 then it becomes CF0F0 with frame = C (i.e. 12)

0 1 2 5 6 7 8 11 12

(g) (h) C leaves E loaded E0 E1 E2 D0 D0 D1 D1 E3 E4 E5 E6 D2 D2 D3 D3 E7 E8