linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
* [Question] zone_watermark_fast & highatomic reserve
@ 2018-02-09  1:54 pdaly
  0 siblings, 0 replies; only message in thread
From: pdaly @ 2018-02-09  1:54 UTC (permalink / raw)
  To: linux-mm

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

-- 
  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 majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2018-02-09  1:54 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-02-09  1:54 [Question] zone_watermark_fast & highatomic reserve pdaly

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).