linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Rei Yamamoto <yamamoto.rei@jp.fujitsu.com>
To: linmiaohe@huawei.com
Cc: akpm@linux-foundation.org, aquini@redhat.com, ddutile@redhat.com,
	linux-kernel@vger.kernel.org, linux-mm@kvack.org,
	mgorman@techsingularity.net, vvghjk1234@gmail.com,
	yamamoto.rei@jp.fujitsu.com
Subject: Re: [PATCH] mm, compaction: fast_find_migrateblock() should return pfn in the target zone
Date: Wed, 11 May 2022 16:07:10 +0900	[thread overview]
Message-ID: <20220511070710.5576-1-yamamoto.rei@jp.fujitsu.com> (raw)
In-Reply-To: <2c2900eb-886a-5bbe-f7c7-9d74a6399893@huawei.com>

On Wed, 11 May 2022 14:25:34 Miaohe Lin wrote:
> On 2022/5/11 12:43, Rei Yamamoto wrote:
>> Prevent returning a pfn outside the target zone in case that not
>> aligned with pageblock boundary.
>> Otherwise isolate_migratepages_block() would handle pages not in
>> the target zone.
>> 
>
> IIUC, the sole caller isolate_migratepages will ensure the pfn won't outside
> the target zone. So the below code change might not be necessary. Or am I miss
> something ?

While block_start_pfn is ensured, this variable is not used as the argument for 
isolate_migratepages_block():
  -----
  static isolate_migrate_t isolate_migratepages(struct compact_control *cc)
  {
  :
          low_pfn = fast_find_migrateblock(cc);
          block_start_pfn = pageblock_start_pfn(low_pfn);
          if (block_start_pfn < cc->zone->zone_start_pfn)
                  block_start_pfn = cc->zone->zone_start_pfn;  <--- block_start_pfn is ensured not outside 
                                                                    the target zone
  :
          block_end_pfn = pageblock_end_pfn(low_pfn);
  :
          for (; block_end_pfn <= cc->free_pfn;
                          fast_find_block = false,
                          cc->migrate_pfn = low_pfn = block_end_pfn,
                          block_start_pfn = block_end_pfn,
                          block_end_pfn += pageblock_nr_pages) {
  :
                  if (isolate_migratepages_block(cc, low_pfn, block_end_pfn,  <--- low_pfn is passed as 
                                                                                   the argument
                                                  isolate_mode))
                          return ISOLATE_ABORT;
  -----

So, the low_pfn passed to isolate_migratepages_block() can be outside the target zone.

Thanks,
Rei


  reply	other threads:[~2022-05-11  7:28 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-05-11  4:43 Rei Yamamoto
2022-05-11  6:25 ` Miaohe Lin
2022-05-11  7:07   ` Rei Yamamoto [this message]
2022-05-11  9:26     ` Miaohe Lin
2022-05-12  1:47       ` Rei Yamamoto
2022-05-12  2:20         ` Andrew Morton
2022-05-12  2:27         ` Miaohe Lin
2022-05-12  4:27           ` Rei Yamamoto
2022-05-12 20:49             ` Andrew Morton
2022-05-13  4:11               ` Rei Yamamoto
2022-05-13 21:01                 ` Andrew Morton
2022-05-16  2:41                   ` Rei Yamamoto
2022-05-12  9:04 ` Mel Gorman
2022-05-13  7:54 ` Oscar Salvador

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=20220511070710.5576-1-yamamoto.rei@jp.fujitsu.com \
    --to=yamamoto.rei@jp.fujitsu.com \
    --cc=akpm@linux-foundation.org \
    --cc=aquini@redhat.com \
    --cc=ddutile@redhat.com \
    --cc=linmiaohe@huawei.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=mgorman@techsingularity.net \
    --cc=vvghjk1234@gmail.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