Re: [PATCH v5] mm: Proactive compaction
From: Nitin Gupta
Date: Thu May 28 2020 - 13:39:13 EST
On Thu, May 28, 2020 at 2:50 AM Vlastimil Babka <vbabka@xxxxxxx> wrote:
>
> On 5/28/20 11:15 AM, Holger HoffstÃtte wrote:
> >
> > On 5/18/20 8:14 PM, Nitin Gupta wrote:
> > [patch v5 :)]
> >
> > I've been successfully using this in my tree and it works great, but a friend
> > who also uses my tree just found a bug (actually an improvement ;) due to the
> > change from HUGETLB_PAGE_ORDER to HPAGE_PMD_ORDER in v5.
> >
> > When building with CONFIG_TRANSPARENT_HUGEPAGE=n (for some reason it was off)
> > HPAGE_PMD_SHIFT expands to BUILD_BUG() and compilation fails like this:
>
> Oops, I forgot about this. Still I believe HPAGE_PMD_ORDER is the best choice as
> long as THP's are enabled. I guess fallback to HUGETLB_PAGE_ORDER would be
> possible if THPS are not enabled, but AFAICS some architectures don't define
> that. Such architectures perhaps won't benefit from proactive compaction anyway?
>
I am not sure about such architectures but in such cases, we would end
up calculating
"fragmentation score" based on a page size which does not match the
architecture's
view of the "default hugepage size" which is not a terrible thing in
itself as compaction
can still be done in the background, after all.
Since we always need a target order to calculate the fragmentation score, how
about this fallack scheme:
HPAGE_PMD_ORDER -> HUGETLB_PAGE_ORDER -> PMD_ORDER
Thanks,
Nitin