From: Mel Gorman <mgorman@techsingularity.net>
To: Baoquan He <bhe@redhat.com>
Cc: Jaewon Kim <jaewon31.kim@samsung.com>,
minchan@kernel.org, mgorman@suse.de, hannes@cmpxchg.org,
akpm@linux-foundation.org, linux-mm@kvack.org,
linux-kernel@vger.kernel.org, jaewon31.kim@gmail.com,
ytk.lee@samsung.com, cmlaika.kim@samsung.com
Subject: Re: [PATCH] page_alloc: consider highatomic reserve in wmartermark fast
Date: Tue, 9 Jun 2020 16:13:30 +0100 [thread overview]
Message-ID: <20200609151330.GL3127@techsingularity.net> (raw)
In-Reply-To: <20200609142747.GA3346@MiWiFi-R3L-srv>
On Tue, Jun 09, 2020 at 10:27:47PM +0800, Baoquan He wrote:
> > diff --git a/mm/page_alloc.c b/mm/page_alloc.c
> > index 13cc653122b7..00869378d387 100644
> > --- a/mm/page_alloc.c
> > +++ b/mm/page_alloc.c
> > @@ -3553,6 +3553,11 @@ static inline bool zone_watermark_fast(struct zone *z, unsigned int order,
> > {
> > long free_pages = zone_page_state(z, NR_FREE_PAGES);
> > long cma_pages = 0;
> > + long highatomic = 0;
> > + const bool alloc_harder = (alloc_flags & (ALLOC_HARDER|ALLOC_OOM));
> > +
> > + if (likely(!alloc_harder))
> > + highatomic = z->nr_reserved_highatomic;
> >
> > #ifdef CONFIG_CMA
> > /* If allocation can't use CMA areas don't use free CMA pages */
> > @@ -3567,8 +3572,12 @@ static inline bool zone_watermark_fast(struct zone *z, unsigned int order,
> > * the caller is !atomic then it'll uselessly search the free
> > * list. That corner case is then slower but it is harmless.
> > */
> > - if (!order && (free_pages - cma_pages) > mark + z->lowmem_reserve[classzone_idx])
> > - return true;
> > + if (!order) {
> > + long fast_free = free_pages - cma_pages - highatomic;
> > +
> > + if (fast_free > mark + z->lowmem_reserve[classzone_idx])
>
> This looks reasonable to me. However, this change may not be rebased on
> top of the latest mainline tree or mm tree. E.g in this commit 97a225e69a1f8
> ("mm/page_alloc: integrate classzone_idx and high_zoneidx"), classzone_idx
> has been changed to highest_zoneidx.
>
That's fine, I simply wanted to illustrate where I thought the check
should go to minimise the impact to the majority of allocations.
--
Mel Gorman
SUSE Labs
next prev parent reply other threads:[~2020-06-09 15:13 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <CGME20200609095139epcas1p17f9c213de6daf25fe848921bc70481c0@epcas1p1.samsung.com>
2020-06-09 9:51 ` [PATCH] page_alloc: consider highatomic reserve in wmartermark fast Jaewon Kim
2020-06-09 14:27 ` Baoquan He
2020-06-09 15:13 ` Mel Gorman [this message]
2020-06-11 1:43 ` Jaewon Kim
2020-06-11 15:11 ` Mel Gorman
2020-06-10 1:21 ` Minchan Kim
2020-06-11 8:54 ` Jaewon Kim
2020-06-12 6:55 ` Minchan Kim
2020-06-12 7:03 ` Jaewon Kim
2020-06-12 7:40 ` Minchan Kim
2020-06-12 7:55 ` Jaewon Kim
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=20200609151330.GL3127@techsingularity.net \
--to=mgorman@techsingularity.net \
--cc=akpm@linux-foundation.org \
--cc=bhe@redhat.com \
--cc=cmlaika.kim@samsung.com \
--cc=hannes@cmpxchg.org \
--cc=jaewon31.kim@gmail.com \
--cc=jaewon31.kim@samsung.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=mgorman@suse.de \
--cc=minchan@kernel.org \
--cc=ytk.lee@samsung.com \
/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).