The way it works on iSeries is the HV provides a 64MB physicaly
contiguous load area. The kernel & working storage, including the
logical->physical (or absolute in our terms) must fit in this space.
Even with a 256KB chunk size and a simple array for translation, the
memory consumption is not excessive. Each array entry is 32bits,
allowing a 32+12(page offset) = 44b of physical addessability and a 1MB
array allows 32GB of translations.
We don't need the reverse translation on iSeries as the kernel never
knows about the actual hardware address, other than when putting an
entry in the hardware page tables (processor and I/O). One other thing
to not is that Linux _always_ runs with relocation enabled on iSeries so
there is never a point, other than way I mention above, when the
hardware address matters.
> We ought to have some clue about the maximum number of physical memory
> chunks available to us. I doubt *every* partition is going to be
> provided 256 GB of memory. In fact, the real amount we need will be
> considerably less, and the phys_to_logical table will be smaller than
> 16 MB, say, 1 MB. Just allocate the whole thing and be done with it.
...
>
> > How do you know what
> > the size of the table should be if the number of chunks varies
> > dramatically?
>
> The most obvious and practical approach is to have the boot loader tell
> us, we allocate the maximum size needed, and won't worry about that
> again.
>
Yes, we do know the maximum memory possible, both system wide, and more
importantly within a partition. In fact the way it works today, a
partition is defined to the hypervisor with a current memory size to use
and a max memory size. The max is required because the hardware page
table for PowerPC is allocated to the max size before the partition
boots. Becuase the page table must be physically contiguous, it is
allocated for the partition when the system boots. The size of the
Linux translation tables is a similar issue where the worst case should
just be considered and allocated at Linux boot time.
Dave Engebretsen
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/