Re: PROBLEM: Remapping hugepages mappings causes kernel to return EINVAL

From: Michal Hocko
Date: Mon Oct 23 2017 - 14:02:38 EST


On Mon 23-10-17 19:52:27, C.Wehrmeyer wrote:
[...]
> > or you can mmap a larger block and
> > munmap the initial unaligned part.
>
> And how is that supposed to be transparent? When I hear "transparent" I
> think of a mechanism which I can put under a system so that it benefits from
> it, while the system does not notice or at least does not need to be aware
> of it. The system also does not need to be changed for it.

How do you expect to get a huge page when the mapping itself is not
properly aligned? Sure if you have a large mapping then you probably do
not care about first and last chunk being not 2MB aligned but in order
to get a THP you really need a 2MB aligned address.
--
Michal Hocko
SUSE Labs