Without paging only 1 memory reference is required

  • Thread starter Thread starter prashantgolu
  • Start date Start date
  • Tags Tags
    Memory Reference
Click For Summary

Discussion Overview

The discussion revolves around the memory reference requirements for instruction execution in systems with and without paging. It explores the mechanics of memory access in x86 architecture, particularly focusing on the number of memory references needed when paging is involved compared to a non-paging scenario.

Discussion Character

  • Technical explanation
  • Conceptual clarification
  • Debate/contested

Main Points Raised

  • One participant states that without paging, only one memory reference is needed to fetch an instruction, while with paging, three references are required due to the need to access page tables.
  • Another participant explains that in x86 architecture, accessing memory with paging involves retrieving the address of the Page Directory (PD) from the control register (cr3), then obtaining the address of the Page Table (PT) from the PD, followed by accessing the actual data in the page.
  • Several participants seek clarification on the terms PD, cr3, and PT, questioning how only one memory reference is needed without paging.
  • It is noted that in some environments, only two memory references might be needed instead of three if the Translation Lookaside Buffer (TLB) contains the necessary virtual to physical address mapping.
  • Further complexity is introduced with the mention of segmentation, which can also affect memory reference requirements.

Areas of Agreement / Disagreement

Participants express varying levels of understanding regarding the memory reference requirements, with some agreeing on the basic mechanics of paging while others highlight exceptions and additional factors that can influence the number of references needed. The discussion remains unresolved regarding the exact conditions under which different memory reference counts apply.

Contextual Notes

Participants mention that the number of memory references can depend on the specific CPU architecture and operating system, and that the presence of a flat real address space can eliminate the need for address translation altogether.

Who May Find This Useful

This discussion may be useful for individuals interested in computer architecture, operating systems, and memory management techniques, particularly in the context of x86 architecture.

prashantgolu
Messages
50
Reaction score
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


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.
 


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


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.
 

Similar threads

Replies
15
Views
3K
  • · Replies 3 ·
Replies
3
Views
2K
Replies
1
Views
1K
Replies
19
Views
3K
Replies
6
Views
4K
  • · Replies 3 ·
Replies
3
Views
2K
  • · Replies 18 ·
Replies
18
Views
2K
  • · Replies 19 ·
Replies
19
Views
6K
  • · Replies 40 ·
2
Replies
40
Views
5K
  • · Replies 3 ·
Replies
3
Views
1K