Without paging only 1 memory reference is required

In summary, with paging in x86, 3 memory references are needed to access data: one to get the address of the PD from cr3, one to get the address of the PT from the PD, and one to get the address of the page from the PT. This is because the CPU must go through multiple layers of translation to access the data in the page. However, without paging, only 1 memory reference is needed because the addresses are already in physical form and can be used directly. PD, cr3, and PT are components of the Intel X86 CPU that are used in the translation process. The use of paging and segmentation depends on the CPU and operating system being used. Some environments may only require 2 memory
  • #1
prashantgolu
50
0
"suppose there is an instruction to copy one register contents to another...
now,
without paging only 1 memory reference is required to fetch the instruction...but with paging..we need 3 memory reference (as page tables are to be accesed)..."

please explain why 3...?
 
Technology news on Phys.org
  • #2


In x86, to access memory with paging, the CPU must get the address of the PD from cr3, then get the address of the PT from the PD, then get the address of the page from the PT, and then access the referenced data in that page.
 
  • #3


whats PD,cr3 and PT...
without paging how come only 1 time memory to be referenced...?
 
  • #4


prashantgolu said:
whats PD,cr3 and PT ... without paging how come only 1 time memory to be referenced...
Those are Intel X86 cpu components. How paging and segementation are used depends on CPU and the OS. Some environments would only need 2 memory references instead of 3. For the X86, if the TLB (translation look aside buffer) contains the virtual to physical address in it's memory, then only 2 memory references are needed. If the multi-level paging scheme is used and there isn't an entry in the TLB, then 3 memory references are needed, plus a 4 reference to update the TLB.

http://en.wikipedia.org/wiki/Page_table

http://en.wikipedia.org/wiki/Translation_lookaside_buffer

Complicating matter is that segmentation could also be used:
http://en.wikipedia.org/wiki/X86_memory_segmentation
http://en.wikipedia.org/wiki/Physical_Address_Extension

If a system has a flat real address space (no virtual memory), then all addresses or offsets are physical and can be used without translation.
 
  • #5


Without paging, the instruction to copy one register contents to another would require only one memory reference because the entire physical memory space is directly accessible. However, with paging, the memory space is divided into smaller units called pages, and the mapping between logical and physical addresses is stored in a data structure called the page table.

In order to fetch the instruction, the processor needs to first access the page table to determine the physical address of the instruction. This requires one memory reference. Then, the processor needs to access the actual page containing the instruction, which requires a second memory reference. Finally, the instruction can be fetched from the page, requiring a third memory reference. Therefore, with paging, a total of three memory references are needed to fetch the instruction.

This additional overhead of accessing the page table and multiple memory references is necessary in order to implement paging, which allows for efficient use of physical memory and better memory management.
 

What does "without paging only 1 memory reference is required" mean?

Without paging, it means that the computer's operating system can directly access any physical location in memory with just one memory reference, instead of having to go through a translation process.

Why is only 1 memory reference required without paging?

Without paging, the operating system has a direct mapping of physical memory addresses, eliminating the need for a translation process. This allows for faster access to memory, reducing the number of memory references needed.

What are the benefits of using paging instead of direct memory access?

Using paging allows for virtual memory, which allows programs to use more memory than physically available. It also allows for better memory management and protection, as each program has its own virtual address space.

Are there any downsides to using paging instead of direct memory access?

Paging can result in slower access to memory due to the translation process. It also requires additional overhead and resources, as the operating system needs to manage and maintain the page tables.

How does the use of paging affect the overall performance of a computer system?

The use of paging can impact the performance of a computer system, as it adds an extra layer of complexity and overhead. However, it also allows for better memory management and protection, which can improve overall system stability.

Similar threads

  • Programming and Computer Science
Replies
15
Views
2K
  • Programming and Computer Science
Replies
3
Views
1K
  • Programming and Computer Science
Replies
6
Views
3K
Replies
1
Views
1K
  • Programming and Computer Science
Replies
3
Views
1K
  • Computing and Technology
Replies
18
Views
1K
  • Engineering and Comp Sci Homework Help
Replies
3
Views
668
  • Programming and Computer Science
Replies
19
Views
2K
  • Programming and Computer Science
2
Replies
40
Views
2K
Back
Top