From: Andrew Morton <akpm@linux-foundation.org>
To: NARIBAYASHI Akira <a.naribayashi@fujitsu.com>
Cc: vbabka@suse.cz, mgorman@techsingularity.net, rientjes@google.com,
linux-mm@kvack.org, linux-kernel@vger.kernel.org,
stable@vger.kernel.org
Subject: Re: [PATCH] mm, compaction: fix fast_isolate_around() to stay within boundaries
Date: Thu, 27 Oct 2022 13:25:57 -0700 [thread overview]
Message-ID: <20221027132557.5f724149bd5753036f41512a@linux-foundation.org> (raw)
In-Reply-To: <20221026112438.236336-1-a.naribayashi@fujitsu.com>
On Wed, 26 Oct 2022 20:24:38 +0900 NARIBAYASHI Akira <a.naribayashi@fujitsu.com> wrote:
> Depending on the memory configuration, isolate_freepages_block() may
> scan pages out of the target range and causes panic.
>
> The problem is that pfn as argument of fast_isolate_around() could
> be out of the target range. Therefore we should consider the case
> where pfn < start_pfn, and also the case where end_pfn < pfn.
>
> This problem should have been addressd by the commit 6e2b7044c199
> ("mm, compaction: make fast_isolate_freepages() stay within zone")
> but there was an oversight.
>
> Case1: pfn < start_pfn
>
> <at memory compaction for node Y>
> | node X's zone | node Y's zone
> +-----------------+------------------------------...
> pageblock ^ ^ ^
> +-----------+-----------+-----------+-----------+...
> ^ ^ ^
> ^ ^ end_pfn
> ^ start_pfn = cc->zone->zone_start_pfn
> pfn
> <---------> scanned range by "Scan After"
>
> Case2: end_pfn < pfn
>
> <at memory compaction for node X>
> | node X's zone | node Y's zone
> +-----------------+------------------------------...
> pageblock ^ ^ ^
> +-----------+-----------+-----------+-----------+...
> ^ ^ ^
> ^ ^ pfn
> ^ end_pfn
> start_pfn
> <---------> scanned range by "Scan Before"
>
> It seems that there is no good reason to skip nr_isolated pages
> just after given pfn. So let perform simple scan from start to end
> instead of dividing the scan into "Before" and "After".
Under what circumstances will this panic occur? I assume those
circumstnces are pretty rare, give that 6e2b7044c1992 was nearly two
years ago.
Did you consider the desirability of backporting this fix into earlier
kernels?
next parent reply other threads:[~2022-10-27 20:26 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <20221026112438.236336-1-a.naribayashi@fujitsu.com>
2022-10-27 20:25 ` Andrew Morton [this message]
2022-11-04 11:45 ` [PATCH] mm, compaction: fix fast_isolate_around() to stay within boundaries Mel Gorman
[not found] ` <20221031073559.36021-1-a.naribayashi@fujitsu.com>
2022-11-07 12:32 ` Akira Naribayashi (Fujitsu)
2022-11-07 15:43 ` Mel Gorman
2022-11-09 5:41 ` Akira Naribayashi (Fujitsu)
2022-11-23 10:25 ` Mel Gorman
2022-12-09 9:19 ` Akira Naribayashi (Fujitsu)
2022-12-16 10:24 ` Mel Gorman
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=20221027132557.5f724149bd5753036f41512a@linux-foundation.org \
--to=akpm@linux-foundation.org \
--cc=a.naribayashi@fujitsu.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=mgorman@techsingularity.net \
--cc=rientjes@google.com \
--cc=stable@vger.kernel.org \
--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).