From: pierre kuo <vichy.kuo@gmail.com>
To: Michal Hocko <mhocko@kernel.org>
Cc: linux-mm@kvack.org
Subject: Re: [PATCH 1/1] mm: allocate order 0 page from pcb before zone_watermark_ok
Date: Tue, 5 Jul 2016 09:39:28 +0800 [thread overview]
Message-ID: <CAOVJa8FF-1Gc=j52KePWOfe3WMFZ9De5BA4wDEJu0F5Nmehh+A@mail.gmail.com> (raw)
In-Reply-To: <20160630123443.GA18789@dhcp22.suse.cz>
hi Michal
2016-06-30 20:35 GMT+08:00 Michal Hocko <mhocko@kernel.org>:
> On Wed 29-06-16 22:44:19, vichy wrote:
>> hi all:
>> In normal case, the allocation of any order page started after
>> zone_watermark_ok. But if so far pcp->count of this zone is not 0,
>> why don't we just let order-0-page allocation before zone_watermark_ok.
>> That mean the order-0-page will be successfully allocated even
>> free_pages is beneath zone->watermark.
>
> The watermark check has a good reason. It protects the memory reserves
> which are used for important users or emergency situations. The mere
> fact that there are pages available for the pcp usage doesn't mean that
> we should break this protection. Note that those emergency users might
> want order 0 pages as well.
Got it.
And due to your friendly reminder I found the "emergency users" you
mean, the cases in gfp_to_alloc_flags that will return with
ALLOC_NO_WATERMARKS as below
if (likely(!(gfp_mask & __GFP_NOMEMALLOC))) {
if (gfp_mask & __GFP_MEMALLOC)
alloc_flags |= ALLOC_NO_WATERMARKS;
else if (in_serving_softirq() && (current->flags & PF_MEMALLOC))
alloc_flags |= ALLOC_NO_WATERMARKS;
else if (!in_interrupt() &&
((current->flags & PF_MEMALLOC) ||
unlikely(test_thread_flag(TIF_MEMDIE))))
alloc_flags |= ALLOC_NO_WATERMARKS;
}
Appreciate your kind review,
--
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>
prev parent reply other threads:[~2016-07-05 1:39 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-06-29 14:44 vichy
2016-06-30 12:35 ` Michal Hocko
2016-07-05 1:39 ` pierre kuo [this message]
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='CAOVJa8FF-1Gc=j52KePWOfe3WMFZ9De5BA4wDEJu0F5Nmehh+A@mail.gmail.com' \
--to=vichy.kuo@gmail.com \
--cc=linux-mm@kvack.org \
--cc=mhocko@kernel.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