ANDROID: dma-buf: heaps: fix dma-buf heap pool pages stat

this critical region should be protected by pool->mutex.

Bug: 207658347
Fixes: e7dac4c323 ("ANDROID: dma-buf: heaps: Add a shrinker controlled page pool")
Signed-off-by: liuhailong <liuhailong@oppo.com>
Signed-off-by: xieliujie <xieliujie@oppo.com>
Change-Id: I6f129926c96176258a965964c24602fc647db61e
This commit is contained in:
xieliujie
2021-11-25 10:04:33 +08:00
committed by Hridya Valsaraju
parent 851990cc99
commit 3ed40fb65a

View File

@@ -44,9 +44,9 @@ static void dmabuf_page_pool_add(struct dmabuf_page_pool *pool, struct page *pag
mutex_lock(&pool->mutex); mutex_lock(&pool->mutex);
list_add_tail(&page->lru, &pool->items[index]); list_add_tail(&page->lru, &pool->items[index]);
pool->count[index]++; pool->count[index]++;
mutex_unlock(&pool->mutex);
mod_node_page_state(page_pgdat(page), NR_KERNEL_MISC_RECLAIMABLE, mod_node_page_state(page_pgdat(page), NR_KERNEL_MISC_RECLAIMABLE,
1 << pool->order); 1 << pool->order);
mutex_unlock(&pool->mutex);
} }
static struct page *dmabuf_page_pool_remove(struct dmabuf_page_pool *pool, int index) static struct page *dmabuf_page_pool_remove(struct dmabuf_page_pool *pool, int index)