I think this could increase the OOM rate significantly when ARM64 servers are used with filesystems that support large folios.. Should there be an upper limit for pagecache? If so, it would either be a new sysfs entry (which I dont like :( ) or just try and reuse the existing entries with something like thp_highest_allowable_order? >> + >> +static unsigned long min_thp_pageblock_nr_pages(void) > > Reading the function name, I have no idea what this function is supposed to do. > > Yeah sorry about that. I knew even before sending the RFC that this was a bad name :( I think an issue is that pageblock_nr_pages is not really 1 << PAGE_BLOCK_ORDER but is 1 << min(HPAGE_PMD_ORDER, PAGE_BLOCK_ORDER) when THP is enabled. I wanted to highlight with the name that it will use the minimum of the max THP order that is enabled and PAGE_BLOCK_ORDER when calculating the number of pages..