Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp1874755pxb; Mon, 18 Jan 2021 02:09:49 -0800 (PST) X-Google-Smtp-Source: ABdhPJxE7ray7t/AEvDGUL8ci6aN4aMVcbcsyUEqm2VjgEiERSg1CaKcQjnARln5C0cIOlkvbLpv X-Received: by 2002:a17:906:b244:: with SMTP id ce4mr11251845ejb.159.1610964588814; Mon, 18 Jan 2021 02:09:48 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1610964588; cv=none; d=google.com; s=arc-20160816; b=MSlXCni1UQuEczPfRRx//qCTnWnF8/66ahEhQCo8xJrBIXRhg3vtm6l0iTRMDN2u+k IShyoBiAi+j9uff2k4Nw2QjV261vop/bQRgxju8l8NrqGmp6GUPqj0q15rdNDpK68q2M rC8F4Ca573cLQ7eVKgB2MrPJgmF8mVoM0vn7fxB9r7//CHOWFo27VxsLWwk8iyyK1ZtW aOhAaTy6G2hliA6yItAyL3GXIZ5AXRf1OssTT2VwNkIRWoCe9xwzs/V7i0cP/rHT75JZ CvoXTR/meGRQBeWyrm+DIwvhRs7po1Va6lKMe+TAErRint59S3fR19EKaAymP06u2IqR SuTw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:user-agent:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date; bh=NlsmBuqSBiVtn+akPaRucH3fFS69ZfqZMNK2VzzFyH0=; b=A9M5Fyg+ubQ7Tjllq05WfEuCqetK89/0ugCTDlEWOB0VxPoAA3ZEZ60R73XwbIF4Qn WDMxctegabBJekG848Ir/BZ1ASNm8w/PDv9A/5jYQua4UaC+1+AibrxHm3qoqp/ITm46 hnXYQkBPuDQ4+4qPlq+XSBqmWYyFfVF6ORJHwDmQOUlN5wPWPEQvs594b0hjsVIGMdYA b6qh092izBeHoBCGi9sBf63gaUNFg5PFzyAMKqbrcEVNyRCP3ALy13pJwIpZw89V2/jw kM+s3NkjS/FQWxwm59ViQyjelmzbJuJFw1liNviEsb9X3urmZ39Dx76MZ0UYGmlZVk/S oZxA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id l11si7513408ejx.183.2021.01.18.02.09.25; Mon, 18 Jan 2021 02:09:48 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2388917AbhARJum (ORCPT + 99 others); Mon, 18 Jan 2021 04:50:42 -0500 Received: from outbound-smtp47.blacknight.com ([46.22.136.64]:40527 "EHLO outbound-smtp47.blacknight.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2389070AbhARJnM (ORCPT ); Mon, 18 Jan 2021 04:43:12 -0500 Received: from mail.blacknight.com (pemlinmail01.blacknight.ie [81.17.254.10]) by outbound-smtp47.blacknight.com (Postfix) with ESMTPS id 76CFFFBF03 for ; Mon, 18 Jan 2021 09:42:19 +0000 (GMT) Received: (qmail 26312 invoked from network); 18 Jan 2021 09:42:19 -0000 Received: from unknown (HELO techsingularity.net) (mgorman@techsingularity.net@[84.203.22.4]) by 81.17.254.9 with ESMTPSA (AES256-SHA encrypted, authenticated); 18 Jan 2021 09:42:19 -0000 Date: Mon, 18 Jan 2021 09:42:17 +0000 From: Mel Gorman To: Rokudo Yan Cc: akpm@linux-foundation.org, aarcange@redhat.com, haiwang.fu@tcl.com, linux-kernel@vger.kernel.org, linux-mm@kvack.org, rientjes@google.com, tang.ding@tcl.com, vbabka@suse.cz, xiushui.ye@tcl.com Subject: Re: [PATCH] mm, compaction: move high_pfn to the for loop scope. Message-ID: <20210118094217.GQ3592@techsingularity.net> References: <20210112142711.b82cf36abaa7ff04773e212f@linux-foundation.org> <20210118074126.1838139-1-wu-yan@tcl.com> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-15 Content-Disposition: inline In-Reply-To: <20210118074126.1838139-1-wu-yan@tcl.com> User-Agent: Mutt/1.10.1 (2018-07-13) Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Jan 18, 2021 at 03:41:26PM +0800, Rokudo Yan wrote: > In fast_isolate_freepages, high_pfn will be used if a prefered one(PFN >= low_fn) not found. But the high_pfn > is not reset before searching an free area, so when it was used as freepage, it may from another free area searched before. > And move_freelist_head(freelist, freepage) will have unexpected behavior(eg. corrupt the MOVABLE freelist) > > Unable to handle kernel paging request at virtual address dead000000000200 > Mem abort info: > ESR = 0x96000044 > Exception class = DABT (current EL), IL = 32 bits > SET = 0, FnV = 0 > EA = 0, S1PTW = 0 > Data abort info: > ISV = 0, ISS = 0x00000044 > CM = 0, WnR = 1 > [dead000000000200] address between user and kernel address ranges > > -000|list_cut_before(inline) > -000|move_freelist_head(inline) > -000|fast_isolate_freepages(inline) > -000|isolate_freepages(inline) > -000|compaction_alloc(?, ?) > -001|unmap_and_move(inline) > -001|migrate_pages([NSD:0xFFFFFF80088CBBD0] from = 0xFFFFFF80088CBD88, [NSD:0xFFFFFF80088CBBC8] get_new_p > -002|__read_once_size(inline) > -002|static_key_count(inline) > -002|static_key_false(inline) > -002|trace_mm_compaction_migratepages(inline) > -002|compact_zone(?, [NSD:0xFFFFFF80088CBCB0] capc = 0x0) > -003|kcompactd_do_work(inline) > -003|kcompactd([X19] p = 0xFFFFFF93227FBC40) > -004|kthread([X20] _create = 0xFFFFFFE1AFB26380) > -005|ret_from_fork(asm) > ---|end of frame > > The issue was reported on an smart phone product with 6GB ram and 3GB zram as swap device. > > This patch fixes the issue by reset high_pfn before searching each free area, which ensure > freepage and freelist match when call move_freelist_head in fast_isolate_freepages(). > > Fixes: 5a811889de10f1eb ("mm, compaction: use free lists to quickly locate a migration target") > > Signed-off-by: Rokudo Yan Other than a fixes line, I do not think this changed so my previous Ack still applies Acked-by: Mel Gorman -- Mel Gorman SUSE Labs