From: Michal Hocko <mhocko@kernel.org>
To: Mel Gorman <mgorman@techsingularity.net>
Cc: David Rientjes <rientjes@google.com>,
Andrew Morton <akpm@linux-foundation.org>,
Jonathan Corbet <corbet@lwn.net>,
"Kirill A. Shutemov" <kirill.shutemov@linux.intel.com>,
Vlastimil Babka <vbabka@suse.cz>,
linux-kernel@vger.kernel.org, linux-mm@kvack.org
Subject: Re: [patch] mm, thp: add new background defrag option
Date: Thu, 5 Jan 2017 11:33:04 +0100 [thread overview]
Message-ID: <20170105103303.GI21618@dhcp22.suse.cz> (raw)
In-Reply-To: <20170105101330.bvhuglbbeudubgqb@techsingularity.net>
On Thu 05-01-17 10:13:30, Mel Gorman wrote:
> On Wed, Jan 04, 2017 at 03:41:59PM -0800, David Rientjes wrote:
> > There is no thp defrag option that currently allows MADV_HUGEPAGE regions
> > to do direct compaction and reclaim while all other thp allocations simply
> > trigger kswapd and kcompactd in the background and fail immediately.
> >
> > The "defer" setting simply triggers background reclaim and compaction for
> > all regions, regardless of MADV_HUGEPAGE, which makes it unusable for our
> > userspace where MADV_HUGEPAGE is being used to indicate the application is
> > willing to wait for work for thp memory to be available.
> >
> > The "madvise" setting will do direct compaction and reclaim for these
> > MADV_HUGEPAGE regions, but does not trigger kswapd and kcompactd in the
> > background for anybody else.
> >
> > For reasonable usage, there needs to be a mesh between the two options.
> > This patch introduces a fifth mode, "background", that will do direct
> > reclaim and compaction for MADV_HUGEPAGE regions and trigger background
> > reclaim and compaction for everybody else so that hugepages may be
> > available in the near future.
> >
> > A proposal to allow direct reclaim and compaction for MADV_HUGEPAGE
> > regions as part of the "defer" mode, making it a very powerful setting and
> > avoids breaking userspace, was offered:
> > http://marc.info/?t=148236612700003. This additional mode is a
> > compromise.
> >
> > This patch also cleans up the helper function for storing to "enabled"
> > and "defrag" since the former supports three modes while the latter
> > supports five and triple_flag_store() was getting unnecessarily messy.
> >
> > Signed-off-by: David Rientjes <rientjes@google.com>
> > ---
> > I don't understand Mel's suggestion of "defer-fault" as option naming.
> >
>
> defer-fault was intended to reflect "defer faults but not anything else"
> with the only sensible alternative being madvise requests. While not a
> major fan of the background name, I don't have a better suggestion either
> other than defer-fault.
>
> There are likely to be objections based on how this should be specified
> and investigating alternative proposals such as fine-grained control of
> how background compaction should be done but I hadn't proposed them and
> hadn't intended to work on such patches. This patch appears to give the
> semantics you want and I said I would ack such a configuration option so;
Yes, I would really like to see that we have exhausted all the proposed
options before we go with a new tunable value. I personally do not have
strong objection to this patch as long as all other options are
considered not viable. The naming is really confusing because defer and
background sonds just too similar and background suggests that no
expensive operation will happen in the direct (fault) context. From that
POV, Mel's defer-fault was more clear to me. I would even like to see
madvise in the name. Something like madvise-with-defer?
--
Michal Hocko
SUSE Labs
--
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>
next prev parent reply other threads:[~2017-01-05 10:33 UTC|newest]
Thread overview: 21+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-01-04 23:41 David Rientjes
2017-01-05 10:13 ` Mel Gorman
2017-01-05 10:33 ` Michal Hocko [this message]
2017-01-05 13:58 ` Vlastimil Babka
2017-01-05 15:50 ` Michal Hocko
2017-01-05 22:54 ` David Rientjes
2017-01-06 8:41 ` Vlastimil Babka
2017-01-06 14:01 ` Michal Hocko
2017-01-06 22:20 ` David Rientjes
2017-01-09 10:04 ` Vlastimil Babka
2017-01-09 12:06 ` Vlastimil Babka
2017-01-10 2:19 ` David Rientjes
2017-01-10 3:38 ` Hugh Dickins
2017-01-10 8:44 ` Vlastimil Babka
2017-01-10 23:52 ` David Rientjes
2017-01-10 13:01 ` Michal Hocko
2017-01-11 0:15 ` [patch v2] mm, thp: add new defer+madvise " David Rientjes
2017-01-11 7:35 ` Vlastimil Babka
2017-01-12 8:01 ` Michal Hocko
2017-01-11 8:56 ` Mel Gorman
2017-01-12 0:16 ` Andrew Morton
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=20170105103303.GI21618@dhcp22.suse.cz \
--to=mhocko@kernel.org \
--cc=akpm@linux-foundation.org \
--cc=corbet@lwn.net \
--cc=kirill.shutemov@linux.intel.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=mgorman@techsingularity.net \
--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