Reputation: 116
I am allocating a huge page of size 1 GB on a Linux system. When I convert the base address of that hugepage (using pagemap API of Linux), the physical base address returned is 0x200000000 --> 34th bit is set which makes this 16GB. However, I have 8 GB RAM inserted to my system. So I expect the returned physical address to be in range of 0-33th bit set. How can the physical address exceed my physical RAM inserted on the system?
Upvotes: 1
Views: 215
Reputation: 17067
How can the physical address exceed my physical RAM inserted on the system?
You are (incorrectly) assuming that the start of the main memory is located at physical address 0 and/or is contiguous. That is not necessarily true (especially on non-x86 systems such as ARM).
Check the /proc/iomem file on your Linux system for information on how physical memory addresses are used.
Upvotes: 2