1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
Marat540 [252]
3 years ago
7

Memory Question!

Engineering
1 answer:
mafiozo [28]3 years ago
7 0

Answer:

Demand Paging

The basic idea behind demand paging is that when a process is swapped in, its pages are not swapped in all at once. Rather they are swapped in only when the process needs them. ( on demand. ) This is termed a lazy swapper, although a pager is a more accurate term.

Figure 9.4 - Transfer of a paged memory to contiguous disk space

9.2.1 Basic Concepts

The basic idea behind paging is that when a process is swapped in, the pager only loads into memory those pages that it expects the process to need ( right away. )

Pages that are not loaded into memory are marked as invalid in the page table, using the invalid bit. ( The rest of the page table entry may either be blank or contain information about where to find the swapped-out page on the hard drive. )

If the process only ever accesses pages that are loaded in memory ( memory resident pages ), then the process runs exactly as if all the pages were loaded in to memory.

Figure 9.5 - Page table when some pages are not in main memory.

On the other hand, if a page is needed that was not originally loaded up, then a page fault trap is generated, which must be handled in a series of steps:

The memory address requested is first checked, to make sure it was a valid memory request.

If the reference was invalid, the process is terminated. Otherwise, the page must be paged in.

A free frame is located, possibly from a free-frame list.

A disk operation is scheduled to bring in the necessary page from disk. ( This will usually block the process on an I/O wait, allowing some other process to use the CPU in the meantime. )

When the I/O operation is complete, the process's page table is updated with the new frame number, and the invalid bit is changed to indicate that this is now a valid page reference.

The instruction that caused the page fault must now be restarted from the beginning, ( as soon as this process gets another turn on the CPU. )

Figure 9.6 - Steps in handling a page fault

In an extreme case, NO pages are swapped in for a process until they are requested by page faults. This is known as pure demand paging.

In theory each instruction could generate multiple page faults. In practice this is very rare, due to locality of reference, covered in section 9.6.1.

The hardware necessary to support virtual memory is the same as for paging and swapping: A page table and secondary memory. ( Swap space, whose allocation is discussed in chapter 12. )

A crucial part of the process is that the instruction must be restarted from scratch once the desired page has been made available in memory. For most simple instructions this is not a major difficulty. However there are some architectures that allow a single instruction to modify a fairly large block of data, ( which may span a page boundary ), and if some of the data gets modified before the page fault occurs, this could cause problems. One solution is to access both ends of the block before executing the instruction, guaranteeing that the necessary pages get paged in before the instruction begins.

9.2.2 Performance of Demand Paging

Obviously there is some slowdown and performance hit whenever a page fault occurs and the system has to go get it from memory, but just how big a hit is it exactly?

There are many steps that occur when servicing a page fault ( see book for full details ), and some of the steps are optional or variable. But just for the sake of discussion, suppose that a normal memory access requires 200 nanoseconds, and that servicing a page fault takes 8 milliseconds. ( 8,000,000 nanoseconds, or 40,000 times a normal memory access. ) With a page fault rate of p, ( on a scale from 0 to 1 ), the effective access time is now:

( 1 - p ) * ( 200 ) + p * 8000000

= 200 + 7,999,800 * p

which clearly depends heavily on p! Even if only one access in 1000 causes a page fault, the effective access time drops from 200 nanoseconds to 8.2 microseconds, a slowdown of a factor of 40 times. In order to keep the slowdown less than 10%, the page fault rate must be less than 0.0000025, or one in 399,990 accesses.

A subtlety is that swap space is faster to access than the regular file system, because it does not have to go through the whole directory structure. For this reason some systems will transfer an entire process from the file system to swap space before starting up the process, so that future paging all occurs from the ( relatively ) faster swap space.

Some systems use demand paging directly from the file system for binary code ( which never changes and hence does not have to be stored on a page operation ), and to reserve the swap space for data segments that must be stored. This approach is used by both Solaris and BSD Unix

You might be interested in
A cylindrical specimen of a metal alloy 45.8 mm long and 9.72 mm in diameter is stressed in tension. A true stress of 378 MPa ca
Sliva [168]

Answer:

390.242 MPa

Explanation:

Attached is the full solution.

8 0
2 years ago
When the Moon is in the position shown, how would the Moon look to an observer on the North Pole?
kirill115 [55]

Answer:

cant see the moon sorry dude

5 0
3 years ago
A remote village on an island was devastated by a typhoon. Farmland was flooded and the crops
insens350 [35]

Answer:

A flood happens when water overflows or soaks land that is normally dry. flooding, happens when a large storm or tsunami causes the sea to They soon fell ill and died from cholera, which is spread by  Rice, wheat, and corn crops were destroyed.  Excess water overflows and runs on top of the land.

Explanation:

hope this helps

6 0
3 years ago
Steam flows steadily through an adiabatic turbine. The inlet conditions of the steam are 10 MPa, 450°C, and 80 m/s, and the exit
8090 [49]

Answer:

a) The change in Kinetic energy, KE = -1.95 kJ

b) Power output, W = 10221.72 kW

c) Turbine inlet area, A_1 = 0.0044 m^2

Explanation:

a) Change in Kinetic Energy

For an adiabatic steady state flow of steam:

KE = \frac{V_2^2 - V_1^2}{2} \\.........(1)

Where Inlet velocity,  V₁ = 80 m/s

Outlet velocity, V₂ = 50 m/s

Substitute these values into equation (1)

KE = \frac{50^2 - 80^2}{2} \\

KE = -1950 m²/s²

To convert this to kJ/kg, divide by 1000

KE = -1950/1000

KE = -1.95 kJ/kg

b) The power output, w

The equation below is used to represent a  steady state flow.

q - w = h_2 - h_1 + KE + g(z_2 - z_1)

For an adiabatic process, the rate of heat transfer, q = 0

z₂ = z₁

The equation thus reduces to :

w = h₁ - h₂ - KE...........(2)

Where Power output, W = \dot{m}w..........(3)

Mass flow rate, \dot{m} = 12 kg/s

To get the specific enthalpy at the inlet, h₁

At P₁ = 10 MPa, T₁ = 450°C,

h₁ = 3242.4 kJ/kg,

Specific volume, v₁ = 0.029782 m³/kg

At P₂ = 10 kPa, h_f = 191.81 kJ/kg, h_{fg} = 2392.1 kJ/kg, x₂ = 0.92

specific enthalpy at the outlet, h₂ = h_1 + x_2 h_{fg}

h₂ = 3242.4 + 0.92(2392.1)

h₂ = 2392.54 kJ/kg

Substitute these values into equation (2)

w = 3242.4 - 2392.54 - (-1.95)

w = 851.81 kJ/kg

To get the power output, put the value of w into equation (3)

W = 12 * 851.81

W = 10221.72 kW

c) The turbine inlet area

A_1V_1 = \dot{m}v_1\\\\A_1 * 80 = 12 * 0.029782\\\\80A_1 = 0.357\\\\A_1 = 0.357/80\\\\A_1 = 0.0044 m^2

3 0
3 years ago
A cruise missile under test is moving horizontally at Ma =2 in the atmosphere at an elevation of 2000 m (Air temperature is 2 °C
telo118 [61]

Answer: the half-angle "alpha" of the Mach cone = 30⁰

Explanation:

To calculate the  half-angle "alpha" of the Mach cone.

we say ;

Sin∝ = 1 / Ma

given that Ma = 2

now we substitute

Sin∝ = 1 / 2

Sin∝ = 0.5

∝ = Sin⁻¹ 0.5

∝ = 30⁰

Therefore, the half-angle "alpha" of the Mach cone is 30⁰

3 0
3 years ago
Other questions:
  • An aluminium alloy bar of diameter 12.5 mm and length 27 m loaded in uniaxial tension to a force of 3 kN. Determine the length o
    15·1 answer
  • # 17
    13·2 answers
  • If these components have weights WA = 50000 lb , WB=8000lb, and WC=6000lb, determine the normal reactions of the wheels D, E, an
    14·1 answer
  • When an emergency vehicle approaches you from in front or behind you, what should you do?
    14·1 answer
  • The following median grain size data were obtained during isothermal liquid phase sintering of an 82W-8Mo-8Ni-2Fe alloy. What is
    15·1 answer
  • 8.28 Water is the working fluid in an ideal Rankine cycle with superheat and reheat. Steam enters the first-stage turbine at 140
    13·1 answer
  • What document should you have from the engine manufacturer when working on an engine
    8·1 answer
  • An astronomer of 65 kg of mass hikes from the beach to the observatory atop the mountain in Mauna Kea, Hawaii (altitude of 4205
    15·1 answer
  • I just wanted to say thanks you to Brainly. This website is a huge help!
    12·1 answer
  • Is there a project idea, or invention that would be good for<br> my class.
    6·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!