lkml.org 
[lkml]   [2019]   [Jan]   [14]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
SubjectRe: [RFC PATCH] mm: align anon mmap for THP
Date
Michal Hocko <mhocko@kernel.org> wrote:

<>
> What does prevent you from mapping a larger area and MAP_FIXED,
> PROT_NONE over it to get the protection?

Yes Thanks I will try. That's good.

>> > For THP, I believe, kernel already does The Right Thing™ for most users.
>> > User still may want to get speific range as THP (to avoid false sharing or
>> > something).
>>
>> I'm an OK Kernel programmer. But I was not able to create a HugePage mapping
>> against /dev/shm/ in a reliable way. I think it only worked on Fedora 28/29
>> but not on any other distro/version. (MMAP_HUGE)
>
> Are you mixing hugetlb rather than THP?

Probably. I was looking for the easiest way to get my mmap based memory allocations
to be 2M based instead of 4k. to get better IO characteristics across the Kernel.
But I kept getting the 4k pointers. (Can't really remember all the things I tried.)

>> We run with our own compiled Kernel on various distros, THP is configured
>> in but mmap against /dev/shm/ never gives me Huge pages. Does it only
>> work with unanimous mmap ? (I think it is mount dependent which is not
>> in the application control)
>
> If you are talking about THP then you have to enable huge pages for the
> mapping AFAIR.

This is exactly what I was looking to achieve but was not able to do. Most probably
a stupid omission on my part, but just to show that it is not that trivial and strait
out-of-the-man-page way to do it. (Would love a code snippet if you ever wrote one?)

> --
> Michal Hocko
> SUSE Labs

Thanks man
Boaz

\
 
 \ /
  Last update: 2019-01-14 17:54    [W:0.095 / U:0.036 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site