lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <8b95b1c6-62a9-eff6-4c52-9112834e69a6@linux.alibaba.com>
Date:   Tue, 1 Aug 2023 10:35:02 +0800
From:   Baolin Wang <baolin.wang@...ux.alibaba.com>
To:     Kemeng Shi <shikemeng@...weicloud.com>, akpm@...ux-foundation.org,
        linux-mm@...ck.org, linux-kernel@...r.kernel.org,
        mgorman@...hsingularity.net, willy@...radead.org, david@...hat.com
Subject: Re: [PATCH 3/8] mm/compaction: skip page block marked skip in
 isolate_migratepages_block



On 7/29/2023 1:10 AM, Kemeng Shi wrote:
> Move migrate_pfn to page block end when block is marked skip to avoid
> unnecessary scan retry of that block from upper caller.
> For example, compact_zone may wrongly rescan skip page block with
> finish_pageblock set as following:
> 1. cc->migrate point to the start of page block
> 2. compact_zone record last_migrated_pfn to cc->migrate
> 3. compact_zone->isolate_migratepages->isolate_migratepages_block tries to
> scan the block. The low_pfn maybe moved forward to middle of block because
> of free pages at beginning of block.
> 4. we find first lru page could be isolated but block was exclusive marked
> skip.
> 5. abort isolate_migratepages_block and make cc->migrate_pfn point to
> found lru page at middle of block.
> 6. compact_zone find cc->migrate_pfn and last_migrated_pfn are in the same
> block and wrongly rescan the block with finish_pageblock set.

Good catch.
Reviewed-by: Baolin Wang <baolin.wang@...ux.alibaba.com>

> Signed-off-by: Kemeng Shi <shikemeng@...weicloud.com>
> ---
>   mm/compaction.c | 1 +
>   1 file changed, 1 insertion(+)
> 
> diff --git a/mm/compaction.c b/mm/compaction.c
> index fb250c6b2b6e..ad535f880c70 100644
> --- a/mm/compaction.c
> +++ b/mm/compaction.c
> @@ -1123,6 +1123,7 @@ isolate_migratepages_block(struct compact_control *cc, unsigned long low_pfn,
>   				skip_updated = true;
>   				if (test_and_set_skip(cc, valid_page) &&
>   				    !cc->finish_pageblock) {
> +					low_pfn = end_pfn;
>   					goto isolate_abort;
>   				}
>   			}

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ