Re: [RFC] mm, THP: Map read-only text segments using large THP pages

From: William Kucharski
Date: Thu May 17 2018 - 09:38:19 EST




> On May 17, 2018, at 1:57 AM, Michal Hocko <mhocko@xxxxxxxxxx> wrote:
>
> [CCing Kirill and fs-devel]
>
> On Mon 14-05-18 07:12:13, William Kucharski wrote:
>> One of the downsides of THP as currently implemented is that it only supports
>> large page mappings for anonymous pages.
>
> There is a support for shmem merged already. ext4 was next on the plan
> AFAIR but I haven't seen any patches and Kirill was busy with other
> stuff IIRC.

I couldn't find anything that would specifically map text pages with large pages,
so perhaps this could be integrated with that or I may have simply missed changes
that would ultimately provide that functionality.

>
>> I embarked upon this prototype on the theory that it would be advantageous to
>> be able to map large ranges of read-only text pages using THP as well.
>
> Can the fs really support THP only for read mappings? What if those
> pages are to be shared in a writable mapping as well? In other words
> can this all work without a full THP support for a particular fs?

The integration with the page cache would indeed require filesystem support.

The end result I'd like to see is full R/W support for large THP pages; I
thought the RO text mapping proof of concept worthwhile to see what kind of
results we might see and what the thoughts of the community were.

Thanks for the feedback.

-- Bill