mm: cma: retry only on EBUSY
Retry the cma alloc only when alloc_contig_range returns -EBUSY. This avoids unnecessary retries when the heap is full. Change-Id: If4626f0a0bc14e4b3a500283eb5a4c33b78fb6f2 Signed-off-by: Vinayak Menon <vinmenon@codeaurora.org>
This commit is contained in:
parent
b4cda12a24
commit
098250a4cb
1 changed files with 2 additions and 1 deletions
3
mm/cma.c
3
mm/cma.c
|
@ -467,7 +467,8 @@ struct page *cma_alloc(struct cma *cma, size_t count, unsigned int align,
|
|||
bitmap_maxno, start, bitmap_count, mask,
|
||||
offset);
|
||||
if (bitmap_no >= bitmap_maxno) {
|
||||
if (retry_after_sleep < max_retries) {
|
||||
if ((retry_after_sleep < max_retries) &&
|
||||
(ret == -EBUSY)) {
|
||||
start = 0;
|
||||
/*
|
||||
* update max retries if available free regions
|
||||
|
|
Loading…
Reference in a new issue