linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: pdaly@codeaurora.org
To: linux-mm@kvack.org
Subject: [Question] zone_watermark_fast & highatomic reserve
Date: Thu, 08 Feb 2018 17:54:27 -0800	[thread overview]
Message-ID: <93189939f16287f89a64691cf31a74fa@codeaurora.org> (raw)

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>

                 reply	other threads:[~2018-02-09  1:54 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=93189939f16287f89a64691cf31a74fa@codeaurora.org \
    --to=pdaly@codeaurora.org \
    --cc=linux-mm@kvack.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).