diff mbox series

[2/3] mm, page_alloc: Disable watermark boosting if THP is disabled at boot

Message ID 20200225141534.5044-3-mgorman@techsingularity.net (mailing list archive)
State New, archived
Headers show
Series Limit runaway reclaim due to watermark boosting | expand

Commit Message

Mel Gorman Feb. 25, 2020, 2:15 p.m. UTC
Watermark boosting is intended to increase the success rate and reduce
latency of high-order allocations, particularly THP. If THP is disabled
at boot, then it makes sense to disable watermark boosting as well. While
there are other high-order allocations that potentially benefit, they
are relatively rare.

Signed-off-by: Mel Gorman <mgorman@techsingularity.net>
---
 mm/huge_memory.c | 1 +
 1 file changed, 1 insertion(+)

Comments

David Rientjes Feb. 26, 2020, 1:32 a.m. UTC | #1
On Tue, 25 Feb 2020, Mel Gorman wrote:

> Watermark boosting is intended to increase the success rate and reduce
> latency of high-order allocations, particularly THP. If THP is disabled
> at boot, then it makes sense to disable watermark boosting as well. While
> there are other high-order allocations that potentially benefit, they
> are relatively rare.
> 
> Signed-off-by: Mel Gorman <mgorman@techsingularity.net>
> ---
>  mm/huge_memory.c | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/mm/huge_memory.c b/mm/huge_memory.c
> index b08b199f9a11..565bb9973ff8 100644
> --- a/mm/huge_memory.c
> +++ b/mm/huge_memory.c
> @@ -472,6 +472,7 @@ static int __init setup_transparent_hugepage(char *str)
>  			  &transparent_hugepage_flags);
>  		clear_bit(TRANSPARENT_HUGEPAGE_REQ_MADV_FLAG,
>  			  &transparent_hugepage_flags);
> +		disable_watermark_boosting();
>  		ret = 1;
>  	}
>  out:

Seems like watermark boosting can help prevent fragmentation so it 
benefits all hugepage sized allocations for the long term and that would 
include dynamic provisioning of hugetlb memory or hugetlb overcommit?
Mel Gorman Feb. 26, 2020, 8:07 a.m. UTC | #2
On Tue, Feb 25, 2020 at 05:32:24PM -0800, David Rientjes wrote:
> On Tue, 25 Feb 2020, Mel Gorman wrote:
> 
> > Watermark boosting is intended to increase the success rate and reduce
> > latency of high-order allocations, particularly THP. If THP is disabled
> > at boot, then it makes sense to disable watermark boosting as well. While
> > there are other high-order allocations that potentially benefit, they
> > are relatively rare.
> > 
> > Signed-off-by: Mel Gorman <mgorman@techsingularity.net>
> > ---
> >  mm/huge_memory.c | 1 +
> >  1 file changed, 1 insertion(+)
> > 
> > diff --git a/mm/huge_memory.c b/mm/huge_memory.c
> > index b08b199f9a11..565bb9973ff8 100644
> > --- a/mm/huge_memory.c
> > +++ b/mm/huge_memory.c
> > @@ -472,6 +472,7 @@ static int __init setup_transparent_hugepage(char *str)
> >  			  &transparent_hugepage_flags);
> >  		clear_bit(TRANSPARENT_HUGEPAGE_REQ_MADV_FLAG,
> >  			  &transparent_hugepage_flags);
> > +		disable_watermark_boosting();
> >  		ret = 1;
> >  	}
> >  out:
> 
> Seems like watermark boosting can help prevent fragmentation so it 
> benefits all hugepage sized allocations for the long term and that would 
> include dynamic provisioning of hugetlb memory or hugetlb overcommit?

Yes but it's very rare to hear of cases where hugetlb is dynamically
provisioned or overcommitted once THP existed and stopped stalling the
system excessively. I'm happy enough to drop this patch because I'm not
relying on it in the context of this bug.
diff mbox series

Patch

diff --git a/mm/huge_memory.c b/mm/huge_memory.c
index b08b199f9a11..565bb9973ff8 100644
--- a/mm/huge_memory.c
+++ b/mm/huge_memory.c
@@ -472,6 +472,7 @@  static int __init setup_transparent_hugepage(char *str)
 			  &transparent_hugepage_flags);
 		clear_bit(TRANSPARENT_HUGEPAGE_REQ_MADV_FLAG,
 			  &transparent_hugepage_flags);
+		disable_watermark_boosting();
 		ret = 1;
 	}
 out: