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=-5.2 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SIGNED_OFF_BY,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 584BDC432C0 for ; Wed, 27 Nov 2019 13:13:44 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id C83F8206F0 for ; Wed, 27 Nov 2019 13:13:43 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org C83F8206F0 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=huawei.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 23C2C6B03A1; Wed, 27 Nov 2019 08:13:43 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 1ED9E6B03AB; Wed, 27 Nov 2019 08:13:43 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 12AD56B03B4; Wed, 27 Nov 2019 08:13:43 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0049.hostedemail.com [216.40.44.49]) by kanga.kvack.org (Postfix) with ESMTP id F11F66B03A1 for ; Wed, 27 Nov 2019 08:13:42 -0500 (EST) Received: from smtpin21.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay05.hostedemail.com (Postfix) with SMTP id BC6FA181AEF15 for ; Wed, 27 Nov 2019 13:13:42 +0000 (UTC) X-FDA: 76202099484.21.drum65_3d4ba83f71057 X-HE-Tag: drum65_3d4ba83f71057 X-Filterd-Recvd-Size: 3456 Received: from huawei.com (szxga06-in.huawei.com [45.249.212.32]) by imf46.hostedemail.com (Postfix) with ESMTP for ; Wed, 27 Nov 2019 13:13:41 +0000 (UTC) Received: from DGGEMS411-HUB.china.huawei.com (unknown [172.30.72.58]) by Forcepoint Email with ESMTP id 6DB4BCCA6179D43FF609; Wed, 27 Nov 2019 21:13:11 +0800 (CST) Received: from [127.0.0.1] (10.133.217.137) by DGGEMS411-HUB.china.huawei.com (10.3.19.211) with Microsoft SMTP Server id 14.3.439.0; Wed, 27 Nov 2019 21:13:01 +0800 Subject: Re: [RFC PATCH] mm, page_alloc: avoid page_to_pfn() in move_freepages() To: Michal Hocko CC: , Andrew Morton , "Vlastimil Babka" , wangkefeng wang References: <20191127102800.51526-1-wangkefeng.wang@huawei.com> <20191127114750.GP20912@dhcp22.suse.cz> From: Kefeng Wang Message-ID: <5d11a679-d822-1c41-8798-1dbb285d3bf6@huawei.com> Date: Wed, 27 Nov 2019 21:13:00 +0800 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:60.0) Gecko/20100101 Thunderbird/60.7.0 MIME-Version: 1.0 In-Reply-To: <20191127114750.GP20912@dhcp22.suse.cz> Content-Type: text/plain; charset="utf-8" Content-Language: en-US Content-Transfer-Encoding: 7bit X-Originating-IP: [10.133.217.137] X-CFilter-Loop: Reflected 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 2019/11/27 19:47, Michal Hocko wrote: > On Wed 27-11-19 18:28:00, Kefeng Wang wrote: >> The start_pfn and end_pfn are already available in move_freepages_block(), >> pfn_valid_within() should validate pfn first before touching the page, >> or we might access an unitialized page with CONFIG_HOLES_IN_ZONE configs. >> >> Cc: Andrew Morton >> Cc: Michal Hocko >> Cc: Vlastimil Babka >> Signed-off-by: Kefeng Wang >> --- >> >> Here is an oops in 4.4(arm64 enabled CONFIG_HOLES_IN_ZONE), > > Is this reproducible with the current upstream kernel? There were large > changes in this aread since 4.4 Our inner tester found this oops twice, but couldn't be reproduced for now, even in 4.4 kernel, still trying... But the page_to_pfn() shouldn't be used in move_freepages(), right? ; ) > > Btw. the below should be part of the changelog. Ok, will resend. > >> Unable to handle kernel NULL pointer dereference at virtual address 00000000 >> pgd = ffffff8008f7e000 >> [00000000] *pgd=0000000017ffe003, *pud=0000000017ffe003, *pmd=0000000000000000 >> Internal error: Oops: 96000007 [#1] SMP >> CPU: 0 PID: 0 Comm: swapper/0 Tainted: G W O 4.4.185 #1 >> >> PC is at move_freepages+0x80/0x10c >> LR is at move_freepages_block+0xd4/0xf4 >> pc : [] lr : [] pstate: 80000085 >> [...] >> [] move_freepages+0x80/0x10c >> [] move_freepages_block+0xd4/0xf4 >> [] __rmqueue+0x2bc/0x44c >> [] get_page_from_freelist+0x268/0x600 >> [] __alloc_pages_nodemask+0x184/0x88c >> [] new_slab+0xd0/0x494 >> [] ___slab_alloc.constprop.29+0x1c8/0x2e8 >> [] __slab_alloc.constprop.28+0x54/0x84 >> [] kmem_cache_alloc+0x64/0x198 >> [] __build_skb+0x44/0xa4 >> [] __netdev_alloc_skb+0xe4/0x134 >> \