Commit c63e78a2 authored by Minchan Kim's avatar Minchan Kim Committed by Richard Chang
Browse files

ANDROID: mm: lru_cache_disable skips lru cache drainnig



lru_cache_disable is not trivial cost since it should run work
from every cores in the system. Thus, repeated call of the
function whenever alloc_contig_range in the cma's allocation loop
is called is expensive.

This patch makes the lru_cache_disable smarter in that it will
not run __lru_add_drain_all since it knows the cache was already
disabled by someone else.
With that, user of alloc_contig_range can disable the lru cache
in advance in their context so that subsequent alloc_contig_range
for user's operation will avoid the costly function call.

This patch moves lru_cache APIs from swap.h to swap.c and export
it for vendor users.

Bug: 192475091
Signed-off-by: default avatarMinchan Kim <minchan@google.com>
Change-Id: I23da8599c55db49dc80226285972e4cd80dedcff
Signed-off-by: default avatarRichard Chang <richardycc@google.com>
(cherry picked from commit c8578a3e)
parent b74eeef4
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment