From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-10.3 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_SANE_1 autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 4A3A2C433DB for ; Mon, 18 Jan 2021 09:42:24 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 86CA32245C for ; Mon, 18 Jan 2021 09:42:23 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 86CA32245C Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=techsingularity.net Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 7DB268D000C; Mon, 18 Jan 2021 04:42:22 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 78B988D0002; Mon, 18 Jan 2021 04:42:22 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 6A14F8D000C; Mon, 18 Jan 2021 04:42:22 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0021.hostedemail.com [216.40.44.21]) by kanga.kvack.org (Postfix) with ESMTP id 5438A8D0002 for ; Mon, 18 Jan 2021 04:42:22 -0500 (EST) Received: from smtpin30.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay05.hostedemail.com (Postfix) with ESMTP id F0FC9181AF5C7 for ; Mon, 18 Jan 2021 09:42:21 +0000 (UTC) X-FDA: 77718405282.30.chin73_34124f027548 Received: from filter.hostedemail.com (10.5.16.251.rfc1918.com [10.5.16.251]) by smtpin30.hostedemail.com (Postfix) with ESMTP id CEB44180B3AB8 for ; Mon, 18 Jan 2021 09:42:21 +0000 (UTC) X-HE-Tag: chin73_34124f027548 X-Filterd-Recvd-Size: 3553 Received: from outbound-smtp07.blacknight.com (outbound-smtp07.blacknight.com [46.22.139.12]) by imf13.hostedemail.com (Postfix) with ESMTP for ; Mon, 18 Jan 2021 09:42:21 +0000 (UTC) Received: from mail.blacknight.com (pemlinmail01.blacknight.ie [81.17.254.10]) by outbound-smtp07.blacknight.com (Postfix) with ESMTPS id 77F6F1C5886 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) X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: 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