ANDROID: Add vendor hook for cma adjusting
CMA was originally designed to be fallback of GFP_MOVABLE when it is
worked as second client(alloc_pages). However, it is working more like
reserved memory for anon&swap pages that hard binded with _GFP_CMA now,
which has bellowing negative impactions:
1. Permanantyly use MIGRATE_CMA first under any scenario which could introduce
large numbers of migration when cma_alloc() happens.
2. normal GFP_MOVABLE has no opportunity to fallback to CMA which could lead to
abnormal reclaiming as bellowing scenario etc.
alloc_pages(GFP_MOVABLE)
zone_watermark_ok() == false(MIGRATE_CMA is not available)
wakeup_kswapd
kswapd can't work(large number of CMA pages make free over watermark_high)
I would like to introduce the fallback way back when __rmqueue fail. Kernel could
work in original way as it is desired to with this commit and other
xxx_cma_adjust_vendor_hooks which could remove __GFP_CMA.
Bug: 291695746
Test: build pass
Change-Id: I479ac1ca68fe02eb7ffc8c09e29805b0ec158391
Signed-off-by:
zhaoyang.huang <zhaoyang.huang@unisoc.com>
Loading
Please sign in to comment