zone_watermark_fast & highatomic reserve
I am trying to understand the comment in zone_watermark_fast() that for the case of an order-0 allocation, it is ok to return true without considering zone->nr_reserved_highatomic.
Suppose that:
1)CONFIG_CMA = n
2)zone_page_state(z, NR_FREE_PAGES) > zone->watermark[WMARK_MIN] 3)There is only one page which is MIGRATE_MOVABLE; all others are MIGRATE_HIGHATOMIC. 4)There is one zone, so zone->lowmem_reserve = 0
For an order 0 GFP_KERNEL allocation:zone_watermark_fast() returns true due to not considering the amount of highatomic memory. rmqueue() finds the page in the MIGRATE_MOVEABLE freelist and returns it.
But I was expecting that the last available pages in the system would be reserved for allocations with ALLOC_HARDER/ALLOC_HIGH set. For example, order-0 atomic allocations.
What am I getting wrong here?
Regarding assumption 2&3)-
For an device with 2Gb memory:
the table above init_per_zone_wmark_min() shows that min_free_kbytes = 5792k. This would be ~1448 pages.reserve_highatomic_pageblock() caps highatomic pages at 1% of zone. This would be 2^31/(2^12 * 100) ~= 5242 pages.
--Patrick
Signature · 8 lines
The Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum, a Linux Foundation Collaborative Project -- To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to [email protected]. For more info on Linux MM, see: http://www.linux-mm.org/ . Don't email: <a href=mailto:"[email protected]"> [email protected] </a>