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: <415a2266-868c-b0d8-b45c-d92eaf02611c@suse.cz>
Date:   Tue, 30 May 2023 09:59:14 +0200
From:   Vlastimil Babka <vbabka@...e.cz>
To:     Baolin Wang <baolin.wang@...ux.alibaba.com>,
        akpm@...ux-foundation.org
Cc:     mgorman@...hsingularity.net, linux-mm@...ck.org,
        linux-kernel@...r.kernel.org
Subject: Re: [PATCH 3/6] mm: compaction: skip more fully scanned pageblock

On 5/25/23 14:53, Baolin Wang wrote:
> In fast_isolate_around(), it assumes the pageblock is fully scanned if
> cc->nr_freepages < cc->nr_migratepages after trying to isolate some free
> pages, and will set skip flag to avoid scanning in future. However this
> can miss setting the skip flag for a fully scanned pageblock (returned
> 'start_pfn' is equal to 'end_pfn') in the case where cc->nr_freepages
> is larger than cc->nr_migratepages.
> 
> So using the returned 'start_pfn' from isolate_freepages_block() and
> 'end_pfn' to decide if a pageblock is fully scanned makes more sense.
> It can also cover the case where cc->nr_freepages < cc->nr_migratepages,
> which means the 'start_pfn' is usually equal to 'end_pfn' except some
> uncommon fatal error occurs after non-strict mode isolation.
> 
> Signed-off-by: Baolin Wang <baolin.wang@...ux.alibaba.com>

Acked-by: Vlastimil Babka <vbabka@...e.cz>

> ---
>  mm/compaction.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/mm/compaction.c b/mm/compaction.c
> index 3737c6591bfb..1e5183f39ca9 100644
> --- a/mm/compaction.c
> +++ b/mm/compaction.c
> @@ -1411,7 +1411,7 @@ fast_isolate_around(struct compact_control *cc, unsigned long pfn)
>  	isolate_freepages_block(cc, &start_pfn, end_pfn, &cc->freepages, 1, false);
>  
>  	/* Skip this pageblock in the future as it's full or nearly full */
> -	if (cc->nr_freepages < cc->nr_migratepages)
> +	if (start_pfn == end_pfn)
>  		set_pageblock_skip(page);
>  
>  	return;

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ