ANDROID: mm: cma: disable LRU cache early
CMA is supposed to work with multiple retrial in case of seeing -EBUSY. During the trials, it's not desirable to enable LRU pagevec caching because it needs to keep LRU draining in alloc_contig_range API, which is expensive when CPUs are busy. Bug: 196012565 Signed-off-by: Minchan Kim <minchan@google.com> Change-Id: I869461bf645fa81bbb3363a210f620e4b5c9bb29
This commit is contained in:
5
mm/cma.c
5
mm/cma.c
@@ -42,6 +42,9 @@
|
||||
|
||||
#include "cma.h"
|
||||
|
||||
extern void lru_cache_disable(void);
|
||||
extern void lru_cache_enable(void);
|
||||
|
||||
struct cma cma_areas[MAX_CMA_AREAS];
|
||||
unsigned cma_area_count;
|
||||
|
||||
@@ -466,6 +469,7 @@ struct page *cma_alloc(struct cma *cma, size_t count, unsigned int align,
|
||||
if (bitmap_count > bitmap_maxno)
|
||||
goto out;
|
||||
|
||||
lru_cache_disable();
|
||||
for (;;) {
|
||||
struct acr_info info = {0};
|
||||
|
||||
@@ -545,6 +549,7 @@ struct page *cma_alloc(struct cma *cma, size_t count, unsigned int align,
|
||||
}
|
||||
}
|
||||
|
||||
lru_cache_enable();
|
||||
trace_cma_alloc_finish(cma->name, pfn, page, count, align);
|
||||
trace_cma_alloc_info(cma->name, page, count, align, &cma_info);
|
||||
|
||||
|
Reference in New Issue
Block a user