linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Kemeng Shi <shikemeng@huaweicloud.com>
To: Mel Gorman <mgorman@techsingularity.net>
Cc: linux-mm@kvack.org, linux-kernel@vger.kernel.org,
	akpm@linux-foundation.org, baolin.wang@linux.alibaba.com,
	david@redhat.com, willy@infradead.org
Subject: Re: [PATCH v2 4/7] mm/compaction: simplify pfn iteration in isolate_freepages_range
Date: Wed, 30 Aug 2023 15:02:19 +0800	[thread overview]
Message-ID: <fd145323-6418-2a8a-484b-20f83f42e2d1@huaweicloud.com> (raw)
In-Reply-To: <20230829150153.j4lw36s7yx5be7al@techsingularity.net>



on 8/29/2023 11:01 PM, Mel Gorman wrote:
> On Sat, Aug 26, 2023 at 11:36:14PM +0800, Kemeng Shi wrote:
>> We call isolate_freepages_block in strict mode, continuous pages in
>> pageblock will be isolated if isolate_freepages_block successed.
>> Then pfn + isolated will point to start of next pageblock to scan
>> no matter how many pageblocks are isolated in isolate_freepages_block.
>> Use pfn + isolated as start of next pageblock to scan to simplify the
>> iteration.
>>
>> The pfn + isolated always points to start of next pageblock as:
>> In case isolated buddy page has order higher than pageblock:
>> 1. page in buddy page is aligned with it's order
>> 2. order of page is higher than pageblock order
>> Then page is aligned with pageblock order. So pfn of page and isolated
>> pages count are both aligned pageblock order. So pfn + isolated is
>> pageblock order aligned.
>>
>> In case isolated buddy page has order lower than pageblock:
>> Buddy page with order N contains two order N - 1 pages as following:
>> |        order N        |
>> |order N - 1|order N - 1|
>> So buddy pages with order N - 1 will never cross boudary of order N.
>> Similar, buddy pages with order N - 2 will never cross boudary of order
>> N - 1 and so on. Then any pages with order less than pageblock order
>> will never crosa boudary of pageblock.
>>
>> Signed-off-by: Kemeng Shi <shikemeng@huaweicloud.com>
>> Reviewed-by: Baolin Wang <baolin.wang@linux.alibaba.com>
> 
> While I don't think the patch is wrong, I also don't think it
> meaningfully simplifies the code or optimises enough to be justified.
> Even though a branch is eliminated, the whole path is not cheap.
> 
OK, I will drop this in next version if you insistant.



  reply	other threads:[~2023-08-30  7:02 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-08-26 15:36 [PATCH v2 0/7] Fixes and cleanups to compaction Kemeng Shi
2023-08-26 15:36 ` [PATCH v2 1/7] mm/compaction: use correct list in move_freelist_{head}/{tail} Kemeng Shi
2023-08-29  9:03   ` Mel Gorman
2023-08-26 15:36 ` [PATCH v2 2/7] mm/compaction: call list_is_{first}/{last} more intuitively " Kemeng Shi
2023-08-29  9:18   ` Mel Gorman
2023-08-26 15:36 ` [PATCH v2 7/7] mm/compaction: factor out code to test if we should run compaction for target order Kemeng Shi
2023-08-29  3:48   ` Baolin Wang
2023-08-30  6:28     ` Kemeng Shi
2023-08-29  3:54   ` Matthew Wilcox
2023-08-30  6:45     ` Kemeng Shi
     [not found] ` <20230826153617.4019189-4-shikemeng@huaweicloud.com>
2023-08-29  3:27   ` [PATCH v2 3/7] mm/compaction: correctly return failure with bogus compound_order in strict mode Baolin Wang
2023-08-29  9:39   ` Mel Gorman
2023-08-30  6:50     ` Kemeng Shi
     [not found] ` <20230826153617.4019189-5-shikemeng@huaweicloud.com>
2023-08-29 15:01   ` [PATCH v2 4/7] mm/compaction: simplify pfn iteration in isolate_freepages_range Mel Gorman
2023-08-30  7:02     ` Kemeng Shi [this message]
     [not found] ` <20230826153617.4019189-6-shikemeng@huaweicloud.com>
2023-08-29 15:05   ` [PATCH v2 5/7] mm/compaction: remove repeat compact_blockskip_flush check in reset_isolation_suitable Mel Gorman
2023-08-30  7:07     ` Kemeng Shi
     [not found] ` <20230826153617.4019189-7-shikemeng@huaweicloud.com>
2023-08-29  3:28   ` [PATCH v2 6/7] mm/compaction: improve comment of is_via_compact_memory Baolin Wang
2023-08-29 15:06   ` 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=fd145323-6418-2a8a-484b-20f83f42e2d1@huaweicloud.com \
    --to=shikemeng@huaweicloud.com \
    --cc=akpm@linux-foundation.org \
    --cc=baolin.wang@linux.alibaba.com \
    --cc=david@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=mgorman@techsingularity.net \
    --cc=willy@infradead.org \
    /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