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]
4 years ago
7

Memory Question!

Engineering
1 answer:
mafiozo [28]4 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 metal plate of 400 mm in length, 200mm in width and 30 mm in depth is to be machined by orthogonal cutting using a tool of wid
dmitriy555 [2]

Complete Question:

A metal plate of 400 mm in length, 200mm in width and 30 mm in depth is to be machined by orthogonal cutting using a tool of width 5mm and a depth of cut of 0.5 mm. Estimate the minimum time required to reduce the depth of the plate by 20 mm if the tool moves at 400 mm per second.

Answer:

T_{min} = 26 mins 40 secs

Explanation:

Reduction in depth, Δd = 20 mm

Depth of cut, d_c = 0.5 mm

Number of passes necessary for this reduction, n = \frac{\triangle d}{d_c}

n = 20/0.5

n = 40 passes

Tool width, w = 5 mm

Width of metal plate, W = 200 mm

For a reduction in the depth per pass, tool will travel W/w = 200/5 = 40 times

Speed of tool, v = 100 mm/s

Time/pass = \frac{40*400}{400} \\Time/pass = 40 sec

minimum time required to reduce the depth of the plate by 20 mm:

T_{min} = number of passes * Time/pass

T_{min} = n * Time/pass

T_{min} = 40 * 40

T_{min} =  1600 = 26 mins 40 secs

3 0
4 years ago
Read 2 more answers
the employer must comply with an employees or employee representative request to examine and copy abatement documents within
frez [133]
The employer must inform employees and their representatives of their right to examine and copy all abatement documents submitted to the Agency. ... The employer must comply with an employee's or employee representative's request to examine and copy abatement documents within 5 working days of receiving the request.
3 0
3 years ago
A liquid-liquid extraction process consists of two units, a mixer and a separator. One inlet stream to the mixer consists of two
vesna_86 [32]

Answer:

One inlet stream to the mixer flows at 100.0 kg/hr and is 35wt% species-A and 65wt% species-B.

Explanation:

8 0
4 years ago
Answer pleaseeeee quick​
mojhsa [17]
Bending effect!! Whenever the orientation of the diffracting planes changes when the diffracting planes bend, the contrast changes
7 0
3 years ago
A 600 MW coal-fired power plant has an overall thermal efficiency of 38%. It is burning coal that has a heating value of 12,000
velikii [3]

Answer:

See step by step explanations for answer.

Explanation:

600 megawatts =

568 690.272 btu / second

thermal eficiency=work done/Heat supllied

0.38=568690.272/Heat supplied

Heat supplied=1496553.35btu /s

heat emmitted to the atmosphere=heat supplied -work done=(1496553.35-568690.272)=927863.1 btu/s

feed rate=(1496553.35)/12000=124.71 lb/s =10775184.1056 lb/day=5 387.472 ton / day

sulphur content released=(0.03*124.71)/(1.496553)=2.5 lb SO2/million Btu of heat input

so

the degree (%) of sulfur dioxide control needed to meet an emission standard=(2.5/0.15)*100=1666.67 %

the CO2 emission rate=220*(1.496553) =329.241 lb/s =12 903.0802 metric ton / day

5 0
3 years ago
Other questions:
  • Which of the following is NOT a breach of Netiquette?
    7·1 answer
  • The three resistors in the circuit shown have values of 4ohms 4ohms and 2ohms. The battery has a value of 12 volts. What is the
    11·1 answer
  • Implement
    14·1 answer
  • Think about all the things we have investigated in class so far this semester. Identify three examples of climate-related aspect
    7·1 answer
  • In the High Low Logic Index low levels are bearish and high levels are bullish, generally True False
    13·1 answer
  • The article provides information by using a list. What does it list? A. Thanksgiving food B. places where clams can be found C.
    11·1 answer
  • Multiple Select
    12·1 answer
  • Consider an ideal turbojet at flight conditions: To =220 K, PO = 20 kPa, and Mo= 0.8. Calculate and plot: 1) the specific thrust
    7·1 answer
  • The dc machine of Problem 7.4 is to be operated as a motor supplied by a constant armature terminal voltage of 250 V. If saturat
    13·1 answer
  • What part connect to the tie rod that helps the brake chamber out that deals with slack adjuster
    7·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!