3 ms·
> Interestingly, the subdirectories are not memory0 to memory127, but memory0 to memory20 and memory32 to memory138. There must be some explanation for the 11-b
by cesarb 6y ago
> Interestingly, the subdirectories are not memory0 to memory127, but memory0 to memory20 and memory32 to memory138. There must be some explanation for the 11-block hole in the numbers, but I don't know what it is.
The obvious explanation is the PCI window. Looking at the memoryN/valid_zones file, I can see on my machine that the ones below memory32 have DMA32, while the ones above have Normal; DMA32 is the zone with memory below 4G, while Normal is the zone with memory above 4G. There's a window at the top of the 32-bit physical address space where most PCI devices are mapped; you can see these mappings by looking at /proc/iomem (as root, since the addresses are masked otherwise).
That is, the physical memory which should be at that hole was instead remapped to somewhere else (otherwise it would have been wasted); the directories above memory127 probably correspond to that remapped memory.
- hansendc 6y agoYes, this is probably it. More specifically, any 128MB areas in the physical address space that do not have "System RAM" will not get a memoryN directory. You can view all the "System RAM" areas in /proc/iomem (if root, otherwise they're all 0's). The most relevant kernel code is here: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/drivers/base/memory.c https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/lin... I am one of the original authors listed at the top of that file.