Re: [PATCH] hugetlbfs: add O_TMPFILE support

From: Mike Kravetz
Date: Mon Oct 21 2019 - 13:17:28 EST


On 10/15/19 4:37 PM, Mike Kravetz wrote:
> On 10/15/19 3:50 AM, Michal Hocko wrote:
>> On Tue 15-10-19 11:01:12, Piotr Sarna wrote:
>>> With hugetlbfs, a common pattern for mapping anonymous huge pages
>>> is to create a temporary file first.
>>
>> Really? I though that this is normally done by shmget(SHM_HUGETLB) or
>> mmap(MAP_HUGETLB). Or maybe I misunderstood your definition on anonymous
>> huge pages.
>>
>>> Currently libraries like
>>> libhugetlbfs and seastar create these with a standard mkstemp+unlink
>>> trick,
>
> I would guess that much of libhugetlbfs was writen before MAP_HUGETLB
> was implemented. So, that is why it does not make (more) use of that
> option.
>
> The implementation looks to be straight forward. However, I really do
> not want to add more functionality to hugetlbfs unless there is specific
> use case that needs it.

It was not my intention to shut down discussion on this patch. I was just
asking if there was a (new) use case for such a change. I am checking with
our DB team as I seem to remember them using the create/unlink approach for
hugetlbfs in one of their upcoming models.

Is there a new use case you were thinking about?
--
Mike Kravetz