I found that physical memory is divided into ranking as follows (memory rotation):
rank0: [0-512KB] [2048KB-2560KB] [4096KB-4608KB] ... rank1: [512KB-1024KB] [2560KB-3072KB] [4608KB-5120KB] ... rank2: [1024KB-1536KB] [3072KB-3584KB] [5120KB-... rank3: [1536KB-2048KB] [3584KB-4096KB] ...
The Linux kernel receives this striped memory. Thus, the physical memory visible by the Linux kernel is not continuous. Correct me if I am wrong.
I studied the source code of the Linux kernel for my work.
When creating sysfs (/ sys / devices / system / memory), the linux kernel creates partitions (memory0, memory1, ...) of a certain size (128 MB on my system) from this available physical memory. Using state files in these directories, I can make sections offline / online. ( Hotplug memory )
Thus, the physical memory represented by these sections is scattered. So, if I do any of the partitions offline that will make this scattered memory, it indicates inaccessibility.
I want these sections to reference continuous memory. something like that:
memory0 : 0-128 MB memory1 : 128-256 MB ....
So, when I do some kind of partition offline, the adjacent physical memory associated with this sector becomes inaccessible. So, can I make the linux kernel see physical memory as contiguous rather than striped?
Correct me if I am wrong about this.
Thanks.
source share