From: Vlastimil Babka <vbabka@suse.cz>
To: Joonsoo Kim <iamjoonsoo.kim@lge.com>
Cc: linux-mm@kvack.org, linux-kernel@vger.kernel.org,
Andrew Morton <akpm@linux-foundation.org>,
David Rientjes <rientjes@google.com>,
Christoph Lameter <cl@linux.com>, Mel Gorman <mgorman@suse.de>,
Michal Nazarewicz <mina86@mina86.com>,
Minchan Kim <minchan@kernel.org>,
Naoya Horiguchi <n-horiguchi@ah.jp.nec.com>,
Rik van Riel <riel@redhat.com>
Subject: Re: [RFC PATCH 0/5] compaction: changing initial position of scanners
Date: Tue, 03 Feb 2015 10:05:12 +0100 [thread overview]
Message-ID: <54D08F48.5030909@suse.cz> (raw)
In-Reply-To: <20150203064941.GA9822@js1304-P5Q-DELUXE>
On 02/03/2015 07:49 AM, Joonsoo Kim wrote:
> On Mon, Jan 19, 2015 at 11:05:15AM +0100, Vlastimil Babka wrote:
>
> Hello,
>
> I don't have any elegant idea, but, have some humble opinion.
>
> The point is that migrate scanner should scan whole zone.
> Although your pivot approach makes some sense and it can scan whole zone,
> it could cause back and forth migration in a very short term whenever
> both scanners get toward and passed each other.
I don't understand the scenario you suggest? The scanners don't overlap in any
single run, that doesn't change. If they meet, compaction terminates. They can
"overlap" if you compare the current run with previous run, after pivot change.
The it's true that e.g. migration scanner will operate on pageblocks where the
free scanner has operated on previously. But pivot changes are only done after
the full defer cycle, which is not short term.
> I think that if we permit
> overlap of scanner, we don't need to adhere to reverse linear scanning
> in freepage scanner since reverse liner scan doesn't prevent back and
> forth migration from now on.
I believe that we still don't permit overlap, but anyway...
> There are two solutions on this problem.
> One is that free scanner scans pfn in same direction where migrate scanner
> goes with having proper interval.
>
> |=========================|
> MMM==> <Interval> FFF==>
>
> Enough interval guarantees to prevent back and forth migration,
> at least, in a very short period.
That would depend on the termination criteria and what to do after restart.
You would have to terminate as soon as one scanner approaches the position where
the other started. Otherwise you overlap and migrate back in a single run. So
you terminate and that will typically mean one of the scanners did not finish
its part fully, so there are pageblocks scanned by neither one. You could adjust
the interval to find the optimal one. But you shouldn't do it immediately next
run, as that would overlap the previous run too soon. Or maybe adjust it only a
little... I don't know if that's simpler than my approach, it seems more quirky.
> Or, we could make free scanner totally different with linear scan.
> Linear scanning to get freepage wastes much time if system memory
> is really big and most of it is used. If we takes freepage from the
> buddy, we can eliminate this scanning overhead. With additional
> logic, that is, comparing position of freepage with migrate scanner
> and selectively taking it, we can avoid back and forth migration
> in a very short period.
I think the metric we should be looking is the ration between free pages scanned
and migrate pages scanned. It's true that after this series in the
allocate-as-thp scenario, it was more than 10 in the first run after reboot.
So maybe it could be more efficient to search the buddy lists. But then again,
when to terminate in this case? The free lists are changing continuously. And to
compare position, you also need to predict how much the migrate scanner will
progress in the single run, because you don't want to take pages from there.
> Thanks.
>
--
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-02-03 9:05 UTC|newest]
Thread overview: 22+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-01-19 10:05 Vlastimil Babka
2015-01-19 10:05 ` [PATCH 1/5] mm, compaction: more robust check for scanners meeting Vlastimil Babka
2015-01-20 13:26 ` Zhang Yanfei
2015-01-19 10:05 ` [PATCH 2/5] mm, compaction: simplify handling restart position in free pages scanner Vlastimil Babka
2015-01-20 13:27 ` Zhang Yanfei
2015-01-20 13:31 ` Vlastimil Babka
2015-01-19 10:05 ` [PATCH 3/5] mm, compaction: encapsulate resetting cached scanner positions Vlastimil Babka
2015-01-20 13:30 ` Zhang Yanfei
2015-01-22 15:22 ` Vlastimil Babka
2015-01-19 10:05 ` [RFC PATCH 4/5] mm, compaction: allow scanners to start at any pfn within the zone Vlastimil Babka
2015-01-20 15:18 ` Zhang Yanfei
2015-01-22 15:24 ` Vlastimil Babka
2015-01-19 10:05 ` [RFC PATCH 5/5] mm, compaction: set pivot pfn to the pfn when scanners met last time Vlastimil Babka
2015-01-19 10:10 ` [RFC PATCH 0/5] compaction: changing initial position of scanners Vlastimil Babka
2015-01-20 9:02 ` Vlastimil Babka
2015-02-03 6:49 ` Joonsoo Kim
2015-02-03 9:05 ` Vlastimil Babka [this message]
2015-02-03 15:00 ` Joonsoo Kim
2015-02-03 15:51 ` Vlastimil Babka
2015-02-03 17:07 ` Joonsoo Kim
2015-02-04 14:39 ` Vlastimil Babka
2015-02-10 8:54 ` Joonsoo 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=54D08F48.5030909@suse.cz \
--to=vbabka@suse.cz \
--cc=akpm@linux-foundation.org \
--cc=cl@linux.com \
--cc=iamjoonsoo.kim@lge.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=mgorman@suse.de \
--cc=mina86@mina86.com \
--cc=minchan@kernel.org \
--cc=n-horiguchi@ah.jp.nec.com \
--cc=riel@redhat.com \
--cc=rientjes@google.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