linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Joonsoo Kim <iamjoonsoo.kim@lge.com>
To: Michal Hocko <mhocko@kernel.org>
Cc: Vlastimil Babka <vbabka@suse.cz>,
	Andrew Morton <akpm@linux-foundation.org>,
	Christoph Lameter <cl@linux.com>,
	Pekka Enberg <penberg@kernel.org>,
	David Rientjes <rientjes@google.com>,
	linux-mm@kvack.org, linux-kernel@vger.kernel.org,
	Mel Gorman <mgorman@techsingularity.net>
Subject: Re: [PATCH 2/2] mm/slub: don't use reserved highatomic pageblock for optimistic try
Date: Thu, 31 Aug 2017 10:42:41 +0900	[thread overview]
Message-ID: <20170831014241.GB24271@js1304-P5Q-DELUXE> (raw)
In-Reply-To: <20170829003344.GB14489@js1304-P5Q-DELUXE>

On Tue, Aug 29, 2017 at 09:33:44AM +0900, Joonsoo Kim wrote:
> On Mon, Aug 28, 2017 at 03:08:29PM +0200, Michal Hocko wrote:
> > On Mon 28-08-17 13:29:29, Vlastimil Babka wrote:
> > > On 08/28/2017 03:11 AM, js1304@gmail.com wrote:
> > > > From: Joonsoo Kim <iamjoonsoo.kim@lge.com>
> > > > 
> > > > High-order atomic allocation is difficult to succeed since we cannot
> > > > reclaim anything in this context. So, we reserves the pageblock for
> > > > this kind of request.
> > > > 
> > > > In slub, we try to allocate higher-order page more than it actually
> > > > needs in order to get the best performance. If this optimistic try is
> > > > used with GFP_ATOMIC, alloc_flags will be set as ALLOC_HARDER and
> > > > the pageblock reserved for high-order atomic allocation would be used.
> > > > Moreover, this request would reserve the MIGRATE_HIGHATOMIC pageblock
> > > > ,if succeed, to prepare further request. It would not be good to use
> > > > MIGRATE_HIGHATOMIC pageblock in terms of fragmentation management
> > > > since it unconditionally set a migratetype to request's migratetype
> > > > when unreserving the pageblock without considering the migratetype of
> > > > used pages in the pageblock.
> > > > 
> > > > This is not what we don't intend so fix it by unconditionally setting
> > > > __GFP_NOMEMALLOC in order to not set ALLOC_HARDER.
> > > 
> > > I wonder if it would be more robust to strip GFP_ATOMIC from alloc_gfp.
> > > E.g. __GFP_NOMEMALLOC does seem to prevent ALLOC_HARDER, but not
> > > ALLOC_HIGH. Or maybe we should adjust __GFP_NOMEMALLOC implementation
> > > and document it more thoroughly? CC Michal Hocko
> > 
> > Yeah, __GFP_NOMEMALLOC is rather inconsistent. It has been added to
> > override __GFP_MEMALLOC resp. PF_MEMALLOC AFAIK. In this particular
> > case I would agree that dropping __GFP_HIGH and __GFP_ATOMIC would
> > be more precise. I am not sure we want to touch the existing semantic of
> > __GFP_NOMEMALLOC though. This would require auditing all the existing
> > users (something tells me that quite some of those will be incorrect...)
> 
> Hmm... now I realize that there is another reason that we need to use
> __GFP_NOMEMALLOC. Even if this allocation comes from PF_MEMALLOC user,
> this optimistic try should not use the reserved memory below the
> watermark. That is, it should not use ALLOC_NO_WATERMARKS. It can
> only be accomplished by using __GFP_NOMEMALLOC.

Michal, Vlastimil, Any thought?

Thanks.

  reply	other threads:[~2017-08-31  1:41 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-08-28  1:11 [PATCH 1/2] mm/slub: wake up kswapd for initial high order allocation js1304
2017-08-28  1:11 ` [PATCH 2/2] mm/slub: don't use reserved highatomic pageblock for optimistic try js1304
2017-08-28 11:29   ` Vlastimil Babka
2017-08-28 13:08     ` Michal Hocko
2017-08-29  0:33       ` Joonsoo Kim
2017-08-31  1:42         ` Joonsoo Kim [this message]
2017-08-31  5:21           ` Michal Hocko
2017-08-28 10:04 ` [PATCH 1/2] mm/slub: wake up kswapd for initial high order allocation Vlastimil Babka
2017-08-29  0:22   ` Joonsoo Kim
2017-08-29  7:14     ` Vlastimil Babka

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=20170831014241.GB24271@js1304-P5Q-DELUXE \
    --to=iamjoonsoo.kim@lge.com \
    --cc=akpm@linux-foundation.org \
    --cc=cl@linux.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=mgorman@techsingularity.net \
    --cc=mhocko@kernel.org \
    --cc=penberg@kernel.org \
    --cc=rientjes@google.com \
    --cc=vbabka@suse.cz \
    /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).