ANDROID: mthp: Fix movable zone check in gfp_zone()
TAO attempt to allocate from the LAST_VIRT_ZONE if __GFP_COMP is specified and: 1) There is no movable zone; or 2) __GFP_MOVABLE is also specified in the flags. No movable zone is currently being checked by !movable_core_enabled, however this does not account for a movable zone created by memory hotplugging with memhp_default_state=online_movable. This can lead to allocations from the movable zone with for __GFP_COMP. The second criteria, (__GFP_COMP | ___GFP_MOVABLE) allows for pages to be allocated from the movable zone without __GFP_HIGHMEM set; which is a requirement for allocations from ZONE_MOVABLE. Since the policy zones (virtual zones) inherit the properties of the first policy zone (ZONE_MOVABLE), only attempt to allocate from the LAST_VIRT_ZONE if the gfp flags evaluate to a ZONE_MOVABLE allocation. gfp_zone_order() ensures that only the appropriate orders can be allocated from ZONE_NOSPLIT and ZONE_NOMERGE, else the movable allocation falls back to ZONE_MOVABLE. Reported-by:Charan Teja Kalla <quic_charante@quicinc.com> Bug: 353906885 Bug: 313807618 Change-Id: I30ac33034f0ff697a4330ef752babf94d4e234f5 Signed-off-by:
Kalesh Singh <kaleshsingh@google.com>
Loading
Please sign in to comment