[1/2] mm,compaction,cma: add alloc_contig flag to compact_control
diff mbox series

Message ID c21c46cb76de2d991fd23164489f763bb385c152.1582321645.git.riel@surriel.com
State New
Headers show
Series
  • fix THP migration for CMA allocations
Related show

Commit Message

Rik van Riel Feb. 21, 2020, 9:53 p.m. UTC
Add information to struct compact_control to indicate that the allocator
would really like to clear out this specific part of memory, used by for
example CMA.

Signed-off-by: Rik van Riel <riel@surriel.com>
---
 mm/internal.h   | 1 +
 mm/page_alloc.c | 1 +
 2 files changed, 2 insertions(+)

Comments

Vlastimil Babka Feb. 24, 2020, 3:04 p.m. UTC | #1
On 2/21/20 10:53 PM, Rik van Riel wrote:
> Add information to struct compact_control to indicate that the allocator
> would really like to clear out this specific part of memory, used by for
> example CMA.
> 
> Signed-off-by: Rik van Riel <riel@surriel.com>

Reviewed-by: Vlastimil Babka <vbabka@suse.cz>

Could have been just squashed into patch 2, but no strong feelings.

> ---
>  mm/internal.h   | 1 +
>  mm/page_alloc.c | 1 +
>  2 files changed, 2 insertions(+)
> 
> diff --git a/mm/internal.h b/mm/internal.h
> index 3cf20ab3ca01..78492d9815b4 100644
> --- a/mm/internal.h
> +++ b/mm/internal.h
> @@ -206,6 +206,7 @@ struct compact_control {
>  	bool whole_zone;		/* Whole zone should/has been scanned */
>  	bool contended;			/* Signal lock or sched contention */
>  	bool rescan;			/* Rescanning the same pageblock */
> +	bool alloc_contig;		/* alloc_contig_range allocation */
>  };
>  
>  /*
> diff --git a/mm/page_alloc.c b/mm/page_alloc.c
> index 3c4eb750a199..a36736812596 100644
> --- a/mm/page_alloc.c
> +++ b/mm/page_alloc.c
> @@ -8402,6 +8402,7 @@ int alloc_contig_range(unsigned long start, unsigned long end,
>  		.ignore_skip_hint = true,
>  		.no_set_skip_hint = true,
>  		.gfp_mask = current_gfp_context(gfp_mask),
> +		.alloc_contig = true,
>  	};
>  	INIT_LIST_HEAD(&cc.migratepages);
>  
>

Patch
diff mbox series

diff --git a/mm/internal.h b/mm/internal.h
index 3cf20ab3ca01..78492d9815b4 100644
--- a/mm/internal.h
+++ b/mm/internal.h
@@ -206,6 +206,7 @@  struct compact_control {
 	bool whole_zone;		/* Whole zone should/has been scanned */
 	bool contended;			/* Signal lock or sched contention */
 	bool rescan;			/* Rescanning the same pageblock */
+	bool alloc_contig;		/* alloc_contig_range allocation */
 };
 
 /*
diff --git a/mm/page_alloc.c b/mm/page_alloc.c
index 3c4eb750a199..a36736812596 100644
--- a/mm/page_alloc.c
+++ b/mm/page_alloc.c
@@ -8402,6 +8402,7 @@  int alloc_contig_range(unsigned long start, unsigned long end,
 		.ignore_skip_hint = true,
 		.no_set_skip_hint = true,
 		.gfp_mask = current_gfp_context(gfp_mask),
+		.alloc_contig = true,
 	};
 	INIT_LIST_HEAD(&cc.migratepages);