From: Vlastimil Babka <vbabka@suse.cz>
To: Joonsoo Kim <iamjoonsoo.kim@lge.com>,
linux-kernel@vger.kernel.org, akpm@linux-foundation.org
Cc: cl@linux.com, mgorman@suse.de, mina86@mina86.com,
minchan@kernel.org, n-horiguchi@ah.jp.nec.com, riel@redhat.com,
rientjes@google.com, zhangyanfei@cn.fujitsu.com,
mm-commits@vger.kernel.org
Subject: Re: + mm-compaction-avoid-premature-range-skip-in-isolate_migratepages_range.patch added to -mm tree
Date: Thu, 23 Oct 2014 10:39:45 +0200 [thread overview]
Message-ID: <5448BED1.40909@suse.cz> (raw)
In-Reply-To: <20141023081543.GB7598@js1304-P5Q-DELUXE>
On 10/23/2014 10:15 AM, Joonsoo Kim wrote:
> On Tue, Oct 14, 2014 at 01:53:44PM -0700, akpm@linux-foundation.org wrote:
>>
>> The patch titled
>> Subject: mm/compaction.c: avoid premature range skip in isolate_migratepages_range
>> has been added to the -mm tree. Its filename is
>> mm-compaction-avoid-premature-range-skip-in-isolate_migratepages_range.patch
>>
>> This patch should soon appear at
>> http://ozlabs.org/~akpm/mmots/broken-out/mm-compaction-avoid-premature-range-skip-in-isolate_migratepages_range.patch
>> and later at
>> http://ozlabs.org/~akpm/mmotm/broken-out/mm-compaction-avoid-premature-range-skip-in-isolate_migratepages_range.patch
>>
>> Before you just go and hit "reply", please:
>> a) Consider who else should be cc'ed
>> b) Prefer to cc a suitable mailing list as well
>> c) Ideally: find the original patch on the mailing list and do a
>> reply-to-all to that, adding suitable additional cc's
>>
>> *** Remember to use Documentation/SubmitChecklist when testing your code ***
>>
>> The -mm tree is included into linux-next and is updated
>> there every 3-4 working days
>>
>> ------------------------------------------------------
>> From: Joonsoo Kim <iamjoonsoo.kim@lge.com>
>> Subject: mm/compaction.c: avoid premature range skip in isolate_migratepages_range
>>
>> commit edc2ca612496 ("mm, compaction: move pageblock checks up from
>> isolate_migratepages_range()") commonizes isolate_migratepages variants
>> and make them use isolate_migratepages_block().
>>
>> isolate_migratepages_block() could stop the execution when enough pages
>> are isolated, but, there is no code in isolate_migratepages_range() to
>> handle this case. In the result, even if isolate_migratepages_block()
>> returns prematurely without checking all pages in the range,
>>
>> isolate_migratepages_block() is called repeately on the following
>> pageblock and some pages in the previous range are skipped to check.
>> Then, CMA is failed frequently due to this fact.
>>
>> To fix this problem, this patch let isolate_migratepages_range() know the
>> situation that enough pages are isolated and stop the isolation in that
>> case.
>>
>> Note that isolate_migratepages() has no such problem, because, it always
>> stops the isolation after just one call of isolate_migratepages_block().
>>
>> Signed-off-by: Joonsoo Kim <iamjoonsoo.kim@lge.com>
>> Cc: Vlastimil Babka <vbabka@suse.cz>
>> Cc: David Rientjes <rientjes@google.com>
>> Cc: Minchan Kim <minchan@kernel.org>
>> Cc: Michal Nazarewicz <mina86@mina86.com>
>> Cc: Naoya Horiguchi <n-horiguchi@ah.jp.nec.com>
>> Cc: Christoph Lameter <cl@linux.com>
>> Cc: Rik van Riel <riel@redhat.com>
>> Cc: Mel Gorman <mgorman@suse.de>
>> Cc: Zhang Yanfei <zhangyanfei@cn.fujitsu.com>
>> Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Acked-by: Vlastimil Babka <vbabka@suse.cz>
Sorry for the trouble. But I think a more robust and future-proof fix
would be a check such as: if (pfn < block_end_pfn) break;
This should catch any reason where isolate_migratepages_block() did not
finish whole pageblock, and which was not fatal enough to return pfn==0.
However currently this seems to happen only due to isolating too much,
so your patch should work.
So it's up to you if you want to make the check more generic now, or
later after this bug is fixed for 3.18.
Vlastimil
> Hello, Andrew.
>
> I forgot to mention that this should be merged for v3.18. :)
>
> Thanks.
>
next prev parent reply other threads:[~2014-10-23 8:39 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <543d8d58.g9K7YpzF5ZOXeQqj%akpm@linux-foundation.org>
2014-10-23 8:15 ` + mm-compaction-avoid-premature-range-skip-in-isolate_migratepages_range.patch added to -mm tree Joonsoo Kim
2014-10-23 8:39 ` Vlastimil Babka [this message]
2014-10-24 3:00 ` Joonsoo Kim
2014-10-29 14:04 ` 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=5448BED1.40909@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=mgorman@suse.de \
--cc=mina86@mina86.com \
--cc=minchan@kernel.org \
--cc=mm-commits@vger.kernel.org \
--cc=n-horiguchi@ah.jp.nec.com \
--cc=riel@redhat.com \
--cc=rientjes@google.com \
--cc=zhangyanfei@cn.fujitsu.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