> > What is going to remove this symlink if the memory goes away? Or do > > these never get removed? > > > > symlinks in sysfs created like this always worry me. What is going to > > use it? > > On top of that, we seem to be building a separate hierarchy here. > > /sys/devices/system/memory/ operates in memory block granularity. What defines the memory blocks? I'd initially assumed some connection to the ACPI SRAT table. But on my test system there are only three entries in SRAT that define non-zero sized memory blocks (two on socket/node 0 and one on socket/node 1), yet there are: memory0 .. memory32 directories in /sys/devices/system/memory. The phys_device and phys_index files aren't helping me figure out what each of them mean. > /sys/devices/system/node/nodeX/ links to memory blocks that belong to it. > > Why is the memory-block granularity insufficient, and why do we have to > squeeze in another range API here? If an MRRM range consists of some set of memory blocks (making sure that no memory block spans across MRRM range boundaries, then I could add the {local,remote}_region_id files into the memory block directories. This could work now while the region assignments are done by the BIOS. But in the future when OS gets the opportunity to change them it might be weird if an MRRM range consists of multiple memory block range, since the region_ids in each all update together. /sys/devices/system/memory seemed like a logical place for memory ranges. But should I jump up a level and make a new /sys/devices/system/memory_regions directory to expose these ranges? -Tony