From: David Rientjes <rientjes@google.com>
To: Vlastimil Babka <vbabka@suse.cz>
Cc: linux-mm@kvack.org, linux-kernel@vger.kernel.org,
Andrew Morton <akpm@linux-foundation.org>,
Hugh Dickins <hughd@google.com>,
Andrea Arcangeli <aarcange@redhat.com>,
"Kirill A. Shutemov" <kirill.shutemov@linux.intel.com>,
Rik van Riel <riel@redhat.com>, Mel Gorman <mgorman@suse.de>,
Joonsoo Kim <iamjoonsoo.kim@lge.com>
Subject: Re: [RFC 1/4] mm, compaction: introduce kcompactd
Date: Tue, 21 Jul 2015 16:07:02 -0700 (PDT) [thread overview]
Message-ID: <alpine.DEB.2.10.1507211549380.3833@chino.kir.corp.google.com> (raw)
In-Reply-To: <55AE0AFE.8070200@suse.cz>
On Tue, 21 Jul 2015, Vlastimil Babka wrote:
> > Khugepaged benefits from the periodic memory compaction being done
> > immediately before it attempts to compact memory, and that may be lost
> > with a de-coupled approach like this.
>
Meant to say "before it attempts to allocate a hugepage", but it seems you
understood that :)
> That could be helped with waking up khugepaged after kcompactd is successful
> in making a hugepage available.
I don't think the criteria for waking up khugepaged should become any more
complex beyond its current state, which is impacted by two different
tunables, and whether it actually has memory to scan. During this
additional wakeup, you'd also need to pass kcompactd's node and only do
local khugepaged scanning since there's no guarantee khugepaged can
allocate on all nodes when one kcompactd defragments memory. I think
coupling these two would be too complex and not worth it.
> Also in your rfc you propose the compaction
> period to be 15 minutes, while khugepaged wakes up each 10 (or 30) seconds by
> default for the scanning and collapsing, so only fraction of the work is
> attempted right after the compaction anyway?
>
The rfc actually proposes the compaction period to be 0, meaning it's
disabled, but suggests in the changelog that we have seen a reproducible
benefit with the period of 15m.
I'm not concerned about scan_sleep_millisecs here, if khugepaged was able
to successfully allocate in its last scan. I'm only concerned with
alloc_sleep_millisecs which defaults to 60000. I think it would be
unfortunate if kcompactd were to free a pageblock, and then khugepaged
waits for 60s before allocating.
> Hm reports of even not-so-high-order allocation failures occur from time to
> time. Some might be from atomic context, but some are because compaction just
> can't help due to the unmovable fragmentation. That's mostly a guess, since
> such detailed information isn't there, but I think Joonsoo did some
> experiments that confirmed this.
>
If it's unmovable fragmentation, then any periodic synchronous memory
compaction isn't going to help either. The page allocator already does
MIGRATE_SYNC_LIGHT compaction on its second pass and that will terminate
when a high-order page is available. If it is currently failing, then I
don't see the benefit of synchronous memory compaction over all memory
that would substantially help this case.
> Also effects on the fragmentation are evaluated when making changes to
> compaction, see e.g. http://marc.info/?l=linux-mm&m=143634369227134&w=2
> In the past it has prevented changes that would improve latency of direct
> compaction. They might be possible if there was a reliable source of more
> thorough periodic compaction to counter the not-so-thorough direct compaction.
>
Hmm, I don't think we have to select one to the excusion of the other. I
don't think that because khugepaged may do periodic synchronous memory
compaction (to eventually remove direct compaction entirely from the page
fault path, since we have checks in the page allocator that specifically
do that) that we can't do background memory compaction elsewhere. I think
it would be trivial to schedule a workqueue in the page allocator when
MIGRATE_ASYNC compaction fails for a high-order allocation on a node and
to have that local compaction done in the background.
--
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:[~2015-07-21 23:07 UTC|newest]
Thread overview: 25+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-07-02 8:46 [RFC v2 0/4] Outsourcing compaction for THP allocations to kcompactd Vlastimil Babka
2015-07-02 8:46 ` [RFC 1/4] mm, compaction: introduce kcompactd Vlastimil Babka
2015-07-09 21:53 ` David Rientjes
2015-07-21 9:03 ` Vlastimil Babka
2015-07-21 23:07 ` David Rientjes [this message]
2015-07-22 15:23 ` Vlastimil Babka
2015-07-22 22:36 ` David Rientjes
2015-07-23 9:18 ` Vlastimil Babka
2015-07-23 21:21 ` David Rientjes
2015-07-24 6:16 ` Joonsoo Kim
2015-07-24 6:45 ` Vlastimil Babka
2015-07-29 0:33 ` David Rientjes
2015-07-29 6:34 ` Vlastimil Babka
2015-07-29 21:54 ` David Rientjes
2015-07-29 23:57 ` Dave Chinner
2015-07-23 6:03 ` Joonsoo Kim
2015-07-23 20:58 ` David Rientjes
2015-07-24 5:33 ` Joonsoo Kim
2015-07-30 10:58 ` Mel Gorman
2015-07-31 21:17 ` David Rientjes
2015-07-02 8:46 ` [RFC 2/4] mm, thp: stop preallocating hugepages in khugepaged Vlastimil Babka
2015-07-02 8:46 ` [RFC 3/4] mm, thp: check for hugepage availability " Vlastimil Babka
2015-07-02 8:46 ` [RFC 4/4] mm, thp: check hugepage availability for fault allocations Vlastimil Babka
2015-07-24 14:22 ` [RFC v2 0/4] Outsourcing compaction for THP allocations to kcompactd Rik van Riel
2015-07-27 9:30 ` 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=alpine.DEB.2.10.1507211549380.3833@chino.kir.corp.google.com \
--to=rientjes@google.com \
--cc=aarcange@redhat.com \
--cc=akpm@linux-foundation.org \
--cc=hughd@google.com \
--cc=iamjoonsoo.kim@lge.com \
--cc=kirill.shutemov@linux.intel.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=mgorman@suse.de \
--cc=riel@redhat.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