Solución ejercicio 1 memoria virtual
De Wiki de Sistemas Operativos
Revisión del 11:16 7 jun 2011 de David (discusión | contribuciones) (→Sustitución por envejecimiento 1)
Contenido
FIFO
accesos a páginas ------------------------------------------------------------------------- | 1 | 1 | 1 | 2 | 3 | 4 | 5 | 3 | 1 | 2 | 3 | 4 | --------------------------------------------------------------------------------- | 1 | 1 | = | = | = | = | = | 5 | = | = | = | = | 4 | --------------------------------------------------------------------------------- marcos | 2 | | | | 2 | = | = | = | = | 1 | = | = | = | -------------------------------------------------------------------------------- | 3 | | | | | 3 | = | = | = | = | 2 | = | = | --------------------------------------------------------------------------------- | 4 | | | | | | 4 | = | = | = | = | 3 | = | --------------------------------------------------------------------------------- fallo | X | | | X | X | X | X | | X | X | X | X | página ------------------------------------------------------------------------- tiempo -> 9 talla de fallos de página = ------ = 0.75 12
NRU
En caso de empate, se emplea LRU.
accesos a páginas | r | r | w | r | r | r | r | w | w | w | r | r | ------------------------------------------------------------------------------------------------- | 1 | 1 | 1 | 2 | 3 | 4 | 5 | 3 | 1 | 2 | 3 | 4 | --------------------------------------------------------------------------------------------------------- | 1 | 1 | = | = | = | = | = | = | = | = | = | = | = | | |-------|-------|-------|-------|-------|-------|-------|-------|-------|-------|-------|-------| | R | M | 1 | 0 | = | = | 1 | 1 | = | = | = | = | = | = | = | = | = | = | = | = | = | = | = | = | = | = | --------------------------------------------------------------------------------------------------------- marcos | 2 | | | | 2 | = | = | 5 | = | = | = | = | 4 | | |-------|-------|-------|-------|-------|-------|-------|-------|-------|-------|-------|-------| | R | M | | | | | | | 1 | 0 | = | = | = | = | 1 | 0 | = | = | = | = | = | = | = | = | 1 | 0 | --------------------------------------------------------------------------------------------------------- | 3 | | | | | 3 | = | = | 3 | = | = | = | = | | |-------|-------|-------|-------|-------|-------|-------|-------|-------|-------|-------|-------| | R | M | | | | | | | | | 1 | 0 | = | = | = | = | 1 | 1 | = | = | = | = | = | = | = | = | --------------------------------------------------------------------------------------------------------- | 4 | | | | | | 4 | = | = | = | 2 | = | = | | |-------|-------|-------|-------|-------|-------|-------|-------|-------|-------|-------|-------| | R | M | | | | | | | | | | | 1 | 0 | = | = | = | = | = | = | 1 | 1 | = | = | = | = | --------------------------------------------------------------------------------------------------------- fallo | X | | | X | X | X | X | | | X | | X | página ------------------------------------------------------------------------------------------------- tiempo -> 7 talla de fallos de página = ------ = 0.583 12
NRU con 2º oportunidad
accesos a páginas | r | r | w | r | r | r | r | w | w | w | r | r | ------------------------------------------------------------------------------------------------- | 1 | 1 | 1 | 2 | 3 | 4 | 5 | 3 | 1 | 2 | 3 | 4 | --------------------------------------------------------------------------------------------------------- | 1 | 1 | = | = | = | = | = | 5 | = | = | = | = | 4 | | |-------|-------|-------|-------|-------|-------|-------|-------|-------|-------|-------|-------| | R | 1 | = | = | = | = | = | 1 | = | = | = | = | 1 | --------------------------------------------------------------------------------------------------------- marcos | 2 | | | | 2 | = | = | 2 | = | 1 | = | = | 1 | | |-------|-------|-------|-------|-------|-------|-------|-------|-------|-------|-------|-------| | R | | | | 1 | = | = | 0 | = | 1 | = | = | 0 | --------------------------------------------------------------------------------------------------------- | 3 | | | | | 3 | = | 3 | 3 | = | = | 3 | 3 | | |-------|-------|-------|-------|-------|-------|-------|-------|-------|-------|-------|-------| | R | | | | | 1 | = | 0 | 1 | = | = | 1 | 0 | --------------------------------------------------------------------------------------------------------- | 4 | | | | | | 4 | 4 | = | = | 2 | = | 2 | | |-------|-------|-------|-------|-------|-------|-------|-------|-------|-------|-------|-------| | R | | | | | | 1 | 0 | = | = | 1 | = | 0 | --------------------------------------------------------------------------------------------------------- fallo | X | | | X | X | X | X | | X | X | | X | página ------------------------------------------------------------------------------------------------- tiempo -> 8 talla de fallos de página = ------ 12
Creo que es asi, pero no me lo tomeis a pies juntillas que no estoy muy seguro.
LRU
accesos a páginas ------------------------------------------------------------------------- | 1 | 1 | 1 | 2 | 3 | 4 | 5 | 3 | 1 | 2 | 3 | 4 | --------------------------------------------------------------------------------- | 1 | 1 | = | = | = | = | = | 5 | = | = | = | = | 4 | --------------------------------------------------------------------------------- marcos | 2 | | | | 2 | = | = | = | = | 1 | = | = | = | -------------------------------------------------------------------------------- | 3 | | | | | 3 | = | = | = | = | = | = | = | --------------------------------------------------------------------------------- | 4 | | | | | | 4 | = | = | = | 2 | = | = | --------------------------------------------------------------------------------- fallo | X | | | X | X | X | X | | X | X | | X | página ------------------------------------------------------------------------- tiempo -> 8 talla de fallos de página = ------ 12
LFU
accesos a páginas | r | r | w | r | r | r | r | w | w | w | r | r | ------------------------------------------------------------------------------------------------- | 1 | 1 | 1 | 2 | 3 | 4 | 5 | 3 | 1 | 2 | 3 | 4 | --------------------------------------------------------------------------------------------------------- | 1 | 1 | 1 | 1 | = | = | = | = | = | 1 | = | = | 1 | | |-------|-------|-------|-------|-------|-------|-------|-------|-------|-------|-------|-------| | C | 1 | 2 | 3 | = | = | = | = | = | 4 | = | = | 4 | --------------------------------------------------------------------------------------------------------- marcos | 2 | | | | 2 | = | = | 5 | = | = | = | = | 4 | | |-------|-------|-------|-------|-------|-------|-------|-------|-------|-------|-------|-------| | C | | | | 1 | = | = | 1 | = | = | = | = | 1 | --------------------------------------------------------------------------------------------------------- | 3 | | | | | 3 | = | = | 3 | = | = | 3 | 3 | | |-------|-------|-------|-------|-------|-------|-------|-------|-------|-------|-------|-------| | C | | | | | 1 | = | = | 2 | = | = | 3 | 3 | --------------------------------------------------------------------------------------------------------- | 4 | | | | | | 4 | = | = | = | 2 | = | 2 | | |-------|-------|-------|-------|-------|-------|-------|-------|-------|-------|-------|-------| | C | | | | | | 1 | = | = | = | 1 | = | 1 | --------------------------------------------------------------------------------------------------------- fallo | X | | | X | X | X | X | | | X | | X | página ------------------------------------------------------------------------------------------------- tiempo -> 7 talla de fallos de página = ------ 12
Duda!! Al quitar un elemento, se resetea su contador? yo he tomado que no..alguien sabe si debe permanecer su valor anterior?
Debería resetearse, no vamos a tener una estructura para guardar el contador de todas las páginas borradas, es una locura. --Joscamsos 08:47 7 jun 2011 (UTC)
Sustitución por envejecimiento
Periodo de 4, registro R de 3 bits, desempate: FIFO
_________________accesos a página__________________ |_1_|_1_|_1_|_2_||_3_|_4_|_5_|_3_||_1_|_2_|_3_|_4_| ====================================================== 1 | 1 | = | = | = || 1 | = | 5 | 5 || 5 | = | = | = | |100| = | = | = ||010| = |100|100||010| = | = | = | m---|---|---|---|---||---|---|---|---||---|---|---|---| a 2 | | | | 2 || 2 | = | = | = || 1 | = | = | = | r | | | |100||010| = | = | = ||100| = | = | = | c---|---|---|---|---||---|---|---|---||---|---|---|---| o 3 | | | | || 3 | = | = | = || 3 | 2 | 3 | = | s | | | | ||100| = | = | = ||010|100|100| = | ---|---|---|---|---||---|---|---|---||---|---|---|---| 4 | | | | || | 4 | = | = || 4 | = | = | 4 | | | | | || |100| = | = ||010| = | = |110| --------------------------------------------------------> t x x x x x x x x 8 tasa fallos pág = ---- 13
Sustitución por envejecimiento 1
Periodo de 4, registro R de 3 bits, desempate: FIFO
_________________accesos a página__________________ |_1_|_1_|_1_|_2_||_3_|_4_|_5_|_3_||_1_|_2_|_3_|_4_| ====================================================== 1 | 1 | = | = | = || 1 | = | 5 | 5 || 5 | = | = | 4 | |100| = | = | = ||010| = |100|100||010| = | = |100| m---|---|---|---|---||---|---|---|---||---|---|---|---| a 2 | | | | 2 || 2 | = | = | = || 1 | = | = | = | r | | | |100||010| = | = | = ||100| = | = | = | c---|---|---|---|---||---|---|---|---||---|---|---|---| o 3 | | | | || 3 | = | = | = || 3 | 2 | = | = | s | | | | ||100| = | = | = ||010|100| = | = | ---|---|---|---|---||---|---|---|---||---|---|---|---| 4 | | | | || | 4 | = | = || 4 | = | 3 | = | | | | | || |100| = | = ||010| = |100| = | --------------------------------------------------------> t x x x x x x x x 9 tasa fallos pág = ---- 13
Creo que está solución es correcta, la victima es el menor R, y he aplicado FIFO en caso de empate. --Marmaclar 09:15 7 jun 2011 (UTC)
Estoy de acuerdo --Robertomartin 09:15 7 jun 2011 (UTC) Estoy de acuerdo con esta solución. --David 10:16 7 jun 2011 (UTC)