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=-11.4 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,INCLUDES_PATCH,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS 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 06EC7C433ED for ; Tue, 18 May 2021 16:09:52 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id D2353611CE for ; Tue, 18 May 2021 16:09:51 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1350410AbhERQLJ (ORCPT ); Tue, 18 May 2021 12:11:09 -0400 Received: from mail.kernel.org ([198.145.29.99]:38442 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1344604AbhERQLI (ORCPT ); Tue, 18 May 2021 12:11:08 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 7AC69611AC; Tue, 18 May 2021 16:09:45 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1621354190; bh=qryFGREqLRRZQLKFaOIFkrGz8b/QRKaiyNq9FU8d52c=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=JWnj8jadWyIY4heJ96ftgfCxeqYRP1dxLHGsj+AKkdngR4J/hfRID4LcsnZnrInsc VBsZHqLtuCUsBfeWBVCKk+ZOzpYHGOs8Bo5PZJtNKD4wS5mtVc2WuaMG1H09wq7jhu ftkGYdCYyfkTR1MBoP23I7wO6cMr5OLGY0HtqDwSr0wtkQ+fD1jPH01Kyrf8C+TPqM at/V25Qc/l4SvBw/IpbDy/Z3kdPfmg0Fchfj/3jEO4BUZEOfOoDjSvodwwhwfsNeBa ju5N9xRKj2F6WqKrwGPQJoGOQ7iLP7LagH5pil0byD8Ah5CyF2y85mvWvCQNMJJ1LC aLrECFmDGe/fA== Date: Tue, 18 May 2021 19:09:40 +0300 From: Mike Rapoport To: Miles Chen Cc: Dave Young , Baoquan He , Vivek Goyal , Jonathan Corbet , Michael Ellerman , Benjamin Herrenschmidt , Paul Mackerras , Andrew Morton , kexec@lists.infradead.org, linux-doc@vger.kernel.org, linuxppc-dev@lists.ozlabs.org, linux-mm@kvack.org, linux-arm-kernel@lists.infradead.org, linux-mediatek@lists.infradead.org Subject: Re: [PATCH v2 0/2] mm: unify the allocation of pglist_data instances Message-ID: References: <20210518092446.16382-1-miles.chen@mediatek.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20210518092446.16382-1-miles.chen@mediatek.com> Precedence: bulk List-ID: X-Mailing-List: linux-doc@vger.kernel.org Hello Miles, On Tue, May 18, 2021 at 05:24:44PM +0800, Miles Chen wrote: > This patches is created to fix the __pa() warning messages when > CONFIG_DEBUG_VIRTUAL=y by unifying the allocation of pglist_data > instances. > > In current implementation of node_data, if CONFIG_NEED_MULTIPLE_NODES=y, > pglist_data is allocated by a memblock API. If CONFIG_NEED_MULTIPLE_NODES=n, > we use a global variable named "contig_page_data". > > If CONFIG_DEBUG_VIRTUAL is not enabled. __pa() can handle both > allocation and symbol cases. But if CONFIG_DEBUG_VIRTUAL is set, > we will have the "virt_to_phys used for non-linear address" warning > when booting. > > To fix the warning, always allocate pglist_data by memblock APIs and > remove the usage of contig_page_data. Somehow I was sure that we can allocate pglist_data before it is accessed in sparse_init() somewhere outside mm/sparse.c. It's really not the case and having two places that may allocated this structure is surely worth than your previous suggestion. Sorry about that. > Warning message: > [ 0.000000] ------------[ cut here ]------------ > [ 0.000000] virt_to_phys used for non-linear address: (____ptrval____) (contig_page_data+0x0/0x1c00) > [ 0.000000] WARNING: CPU: 0 PID: 0 at arch/arm64/mm/physaddr.c:15 __virt_to_phys+0x58/0x68 > [ 0.000000] Modules linked in: > [ 0.000000] CPU: 0 PID: 0 Comm: swapper Tainted: G W 5.13.0-rc1-00074-g1140ab592e2e #3 > [ 0.000000] Hardware name: linux,dummy-virt (DT) > [ 0.000000] pstate: 600000c5 (nZCv daIF -PAN -UAO -TCO BTYPE=--) > [ 0.000000] pc : __virt_to_phys+0x58/0x68 > [ 0.000000] lr : __virt_to_phys+0x54/0x68 > [ 0.000000] sp : ffff800011833e70 > [ 0.000000] x29: ffff800011833e70 x28: 00000000418a0018 x27: 0000000000000000 > [ 0.000000] x26: 000000000000000a x25: ffff800011b70000 x24: ffff800011b70000 > [ 0.000000] x23: fffffc0001c00000 x22: ffff800011b70000 x21: 0000000047ffffb0 > [ 0.000000] x20: 0000000000000008 x19: ffff800011b082c0 x18: ffffffffffffffff > [ 0.000000] x17: 0000000000000000 x16: ffff800011833bf9 x15: 0000000000000004 > [ 0.000000] x14: 0000000000000fff x13: ffff80001186a548 x12: 0000000000000000 > [ 0.000000] x11: 0000000000000000 x10: 00000000ffffffff x9 : 0000000000000000 > [ 0.000000] x8 : ffff8000115c9000 x7 : 737520737968705f x6 : ffff800011b62ef8 > [ 0.000000] x5 : 0000000000000000 x4 : 0000000000000001 x3 : 0000000000000000 > [ 0.000000] x2 : 0000000000000000 x1 : ffff80001159585e x0 : 0000000000000058 > [ 0.000000] Call trace: > [ 0.000000] __virt_to_phys+0x58/0x68 > [ 0.000000] check_usemap_section_nr+0x50/0xfc > [ 0.000000] sparse_init_nid+0x1ac/0x28c > [ 0.000000] sparse_init+0x1c4/0x1e0 > [ 0.000000] bootmem_init+0x60/0x90 > [ 0.000000] setup_arch+0x184/0x1f0 > [ 0.000000] start_kernel+0x78/0x488 > [ 0.000000] ---[ end trace f68728a0d3053b60 ]--- > > [1] https://lore.kernel.org/patchwork/patch/1425110/ > > Change since v1: > - use memblock_alloc() to create pglist_data when CONFIG_NUMA=n > > Miles Chen (2): > mm: introduce prepare_node_data > mm: replace contig_page_data with node_data > > Documentation/admin-guide/kdump/vmcoreinfo.rst | 13 ------------- > arch/powerpc/kexec/core.c | 5 ----- > include/linux/gfp.h | 3 --- > include/linux/mm.h | 2 ++ > include/linux/mmzone.h | 4 ++-- > kernel/crash_core.c | 1 - > mm/memblock.c | 3 +-- > mm/page_alloc.c | 16 ++++++++++++++++ > mm/sparse.c | 2 ++ > 9 files changed, 23 insertions(+), 26 deletions(-) > > > base-commit: 8ac91e6c6033ebc12c5c1e4aa171b81a662bd70f > -- > 2.18.0 > -- Sincerely yours, Mike. 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=-8.8 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=unavailable 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 28B60C433ED for ; Tue, 18 May 2021 16:10:29 +0000 (UTC) Received: from lists.ozlabs.org (lists.ozlabs.org [112.213.38.117]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 3CD69611CE for ; Tue, 18 May 2021 16:10:28 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 3CD69611CE Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=kernel.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=linuxppc-dev-bounces+linuxppc-dev=archiver.kernel.org@lists.ozlabs.org Received: from boromir.ozlabs.org (localhost [IPv6:::1]) by lists.ozlabs.org (Postfix) with ESMTP id 4Fl1Dx3Spnz30L4 for ; Wed, 19 May 2021 02:10:25 +1000 (AEST) Authentication-Results: lists.ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20201202 header.b=JWnj8jad; dkim-atps=neutral Authentication-Results: lists.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=kernel.org (client-ip=198.145.29.99; helo=mail.kernel.org; envelope-from=rppt@kernel.org; receiver=) Authentication-Results: lists.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20201202 header.b=JWnj8jad; dkim-atps=neutral Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 4Fl1DK5CJNz2xYZ for ; Wed, 19 May 2021 02:09:53 +1000 (AEST) Received: by mail.kernel.org (Postfix) with ESMTPSA id 7AC69611AC; Tue, 18 May 2021 16:09:45 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1621354190; bh=qryFGREqLRRZQLKFaOIFkrGz8b/QRKaiyNq9FU8d52c=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=JWnj8jadWyIY4heJ96ftgfCxeqYRP1dxLHGsj+AKkdngR4J/hfRID4LcsnZnrInsc VBsZHqLtuCUsBfeWBVCKk+ZOzpYHGOs8Bo5PZJtNKD4wS5mtVc2WuaMG1H09wq7jhu ftkGYdCYyfkTR1MBoP23I7wO6cMr5OLGY0HtqDwSr0wtkQ+fD1jPH01Kyrf8C+TPqM at/V25Qc/l4SvBw/IpbDy/Z3kdPfmg0Fchfj/3jEO4BUZEOfOoDjSvodwwhwfsNeBa ju5N9xRKj2F6WqKrwGPQJoGOQ7iLP7LagH5pil0byD8Ah5CyF2y85mvWvCQNMJJ1LC aLrECFmDGe/fA== Date: Tue, 18 May 2021 19:09:40 +0300 From: Mike Rapoport To: Miles Chen Subject: Re: [PATCH v2 0/2] mm: unify the allocation of pglist_data instances Message-ID: References: <20210518092446.16382-1-miles.chen@mediatek.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20210518092446.16382-1-miles.chen@mediatek.com> X-BeenThere: linuxppc-dev@lists.ozlabs.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Linux on PowerPC Developers Mail List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Baoquan He , Jonathan Corbet , linux-doc@vger.kernel.org, kexec@lists.infradead.org, linuxppc-dev@lists.ozlabs.org, linux-mm@kvack.org, Paul Mackerras , linux-arm-kernel@lists.infradead.org, linux-mediatek@lists.infradead.org, Andrew Morton , Dave Young , Vivek Goyal Errors-To: linuxppc-dev-bounces+linuxppc-dev=archiver.kernel.org@lists.ozlabs.org Sender: "Linuxppc-dev" Hello Miles, On Tue, May 18, 2021 at 05:24:44PM +0800, Miles Chen wrote: > This patches is created to fix the __pa() warning messages when > CONFIG_DEBUG_VIRTUAL=y by unifying the allocation of pglist_data > instances. > > In current implementation of node_data, if CONFIG_NEED_MULTIPLE_NODES=y, > pglist_data is allocated by a memblock API. If CONFIG_NEED_MULTIPLE_NODES=n, > we use a global variable named "contig_page_data". > > If CONFIG_DEBUG_VIRTUAL is not enabled. __pa() can handle both > allocation and symbol cases. But if CONFIG_DEBUG_VIRTUAL is set, > we will have the "virt_to_phys used for non-linear address" warning > when booting. > > To fix the warning, always allocate pglist_data by memblock APIs and > remove the usage of contig_page_data. Somehow I was sure that we can allocate pglist_data before it is accessed in sparse_init() somewhere outside mm/sparse.c. It's really not the case and having two places that may allocated this structure is surely worth than your previous suggestion. Sorry about that. > Warning message: > [ 0.000000] ------------[ cut here ]------------ > [ 0.000000] virt_to_phys used for non-linear address: (____ptrval____) (contig_page_data+0x0/0x1c00) > [ 0.000000] WARNING: CPU: 0 PID: 0 at arch/arm64/mm/physaddr.c:15 __virt_to_phys+0x58/0x68 > [ 0.000000] Modules linked in: > [ 0.000000] CPU: 0 PID: 0 Comm: swapper Tainted: G W 5.13.0-rc1-00074-g1140ab592e2e #3 > [ 0.000000] Hardware name: linux,dummy-virt (DT) > [ 0.000000] pstate: 600000c5 (nZCv daIF -PAN -UAO -TCO BTYPE=--) > [ 0.000000] pc : __virt_to_phys+0x58/0x68 > [ 0.000000] lr : __virt_to_phys+0x54/0x68 > [ 0.000000] sp : ffff800011833e70 > [ 0.000000] x29: ffff800011833e70 x28: 00000000418a0018 x27: 0000000000000000 > [ 0.000000] x26: 000000000000000a x25: ffff800011b70000 x24: ffff800011b70000 > [ 0.000000] x23: fffffc0001c00000 x22: ffff800011b70000 x21: 0000000047ffffb0 > [ 0.000000] x20: 0000000000000008 x19: ffff800011b082c0 x18: ffffffffffffffff > [ 0.000000] x17: 0000000000000000 x16: ffff800011833bf9 x15: 0000000000000004 > [ 0.000000] x14: 0000000000000fff x13: ffff80001186a548 x12: 0000000000000000 > [ 0.000000] x11: 0000000000000000 x10: 00000000ffffffff x9 : 0000000000000000 > [ 0.000000] x8 : ffff8000115c9000 x7 : 737520737968705f x6 : ffff800011b62ef8 > [ 0.000000] x5 : 0000000000000000 x4 : 0000000000000001 x3 : 0000000000000000 > [ 0.000000] x2 : 0000000000000000 x1 : ffff80001159585e x0 : 0000000000000058 > [ 0.000000] Call trace: > [ 0.000000] __virt_to_phys+0x58/0x68 > [ 0.000000] check_usemap_section_nr+0x50/0xfc > [ 0.000000] sparse_init_nid+0x1ac/0x28c > [ 0.000000] sparse_init+0x1c4/0x1e0 > [ 0.000000] bootmem_init+0x60/0x90 > [ 0.000000] setup_arch+0x184/0x1f0 > [ 0.000000] start_kernel+0x78/0x488 > [ 0.000000] ---[ end trace f68728a0d3053b60 ]--- > > [1] https://lore.kernel.org/patchwork/patch/1425110/ > > Change since v1: > - use memblock_alloc() to create pglist_data when CONFIG_NUMA=n > > Miles Chen (2): > mm: introduce prepare_node_data > mm: replace contig_page_data with node_data > > Documentation/admin-guide/kdump/vmcoreinfo.rst | 13 ------------- > arch/powerpc/kexec/core.c | 5 ----- > include/linux/gfp.h | 3 --- > include/linux/mm.h | 2 ++ > include/linux/mmzone.h | 4 ++-- > kernel/crash_core.c | 1 - > mm/memblock.c | 3 +-- > mm/page_alloc.c | 16 ++++++++++++++++ > mm/sparse.c | 2 ++ > 9 files changed, 23 insertions(+), 26 deletions(-) > > > base-commit: 8ac91e6c6033ebc12c5c1e4aa171b81a662bd70f > -- > 2.18.0 > -- Sincerely yours, Mike. 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=-9.4 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS autolearn=unavailable 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 315E5C433ED for ; Tue, 18 May 2021 16:10:24 +0000 (UTC) Received: from desiato.infradead.org (desiato.infradead.org [90.155.92.199]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 95A5A611EE for ; Tue, 18 May 2021 16:10:23 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 95A5A611EE Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=kernel.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-mediatek-bounces+linux-mediatek=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=desiato.20200630; h=Sender:Content-Transfer-Encoding :Content-Type:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References:Message-ID: Subject:Cc:To:From:Date:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=NGGHWofNrAB2lRm3MQJKEA4AbkFnU29yd/xrEm93GIk=; b=X7wQSxhQzKPCbDMgIjdqB0RGO UyIRH14a+fG67P+lM/Y9ZQ8BHmOwMH92OHCPWAICyve50cS4r9b0SNQZxXUzCr/xvqxdM1+H83PxU NNY6YlTThugTCF+VD3bG1vcXerVtKmuyxF6gostZPEdy35MVRQxxqVy0Fy24WLITy6eDxxI1k1L66 0lNEHmVZtMAXAjLVHMLeO9viFBhaH/YFIbGTn8MuKuTJqrgX7feamXKadiQssOZAuieRg2pLrcTch u3FELp6vDNeyN3RbUCyz4qtUuYIJH4nAbjdicgLKPekcwpHEhLJPnXIenC2R4hv1hKbq0MQuqB5a5 Sn/ZSp4tw==; Received: from localhost ([::1] helo=desiato.infradead.org) by desiato.infradead.org with esmtp (Exim 4.94 #2 (Red Hat Linux)) id 1lj2IM-001HVO-5e; Tue, 18 May 2021 16:10:10 +0000 Received: from bombadil.infradead.org ([2607:7c80:54:e::133]) by desiato.infradead.org with esmtps (Exim 4.94 #2 (Red Hat Linux)) id 1lj2I5-001HP4-D1; Tue, 18 May 2021 16:09:53 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20210309; h=In-Reply-To:Content-Type:MIME-Version :References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=/FSORVPZC8b/pjivQj2dMUrQN5HAuI8uAnEiPB3s1lo=; b=ZTmKX+n2UbjTw9OybbdYDPwFmz 2YebLb42k2qU47AW1NcZpaqE7jty2Adhwyzd9YkCvsa9EWL/M9cz5PM5SXMAu6sAcGOefoqfn4qXS AefE9rcasBgajrwH02izlzBOYYm327d3ZT0HrpNlNbkDLyMuc6pQb9cB1oUpztJxE8hFeGORxnRMk 24/9h7TWiPH+dYJfVpv7r2k5wrMsN9Qy36jUUeQ7c9b3C0lyNUtsFKXejGQKrWT+CdXQ3+nj6XzVJ an1jorh1pUVlxsfXkvmtjZe76DQ9xvwtKm18iexGS9nf1AGtfSp62Aj0D3wbBwSELujENlA2xtEhH FO3V//vg==; Received: from mail.kernel.org ([198.145.29.99]) by bombadil.infradead.org with esmtps (Exim 4.94 #2 (Red Hat Linux)) id 1lj2I2-00En1e-JJ; Tue, 18 May 2021 16:09:52 +0000 Received: by mail.kernel.org (Postfix) with ESMTPSA id 7AC69611AC; Tue, 18 May 2021 16:09:45 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1621354190; bh=qryFGREqLRRZQLKFaOIFkrGz8b/QRKaiyNq9FU8d52c=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=JWnj8jadWyIY4heJ96ftgfCxeqYRP1dxLHGsj+AKkdngR4J/hfRID4LcsnZnrInsc VBsZHqLtuCUsBfeWBVCKk+ZOzpYHGOs8Bo5PZJtNKD4wS5mtVc2WuaMG1H09wq7jhu ftkGYdCYyfkTR1MBoP23I7wO6cMr5OLGY0HtqDwSr0wtkQ+fD1jPH01Kyrf8C+TPqM at/V25Qc/l4SvBw/IpbDy/Z3kdPfmg0Fchfj/3jEO4BUZEOfOoDjSvodwwhwfsNeBa ju5N9xRKj2F6WqKrwGPQJoGOQ7iLP7LagH5pil0byD8Ah5CyF2y85mvWvCQNMJJ1LC aLrECFmDGe/fA== Date: Tue, 18 May 2021 19:09:40 +0300 From: Mike Rapoport To: Miles Chen Cc: Dave Young , Baoquan He , Vivek Goyal , Jonathan Corbet , Michael Ellerman , Benjamin Herrenschmidt , Paul Mackerras , Andrew Morton , kexec@lists.infradead.org, linux-doc@vger.kernel.org, linuxppc-dev@lists.ozlabs.org, linux-mm@kvack.org, linux-arm-kernel@lists.infradead.org, linux-mediatek@lists.infradead.org Subject: Re: [PATCH v2 0/2] mm: unify the allocation of pglist_data instances Message-ID: References: <20210518092446.16382-1-miles.chen@mediatek.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20210518092446.16382-1-miles.chen@mediatek.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210518_090950_700948_E93C8F92 X-CRM114-Status: GOOD ( 19.42 ) X-BeenThere: linux-mediatek@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "Linux-mediatek" Errors-To: linux-mediatek-bounces+linux-mediatek=archiver.kernel.org@lists.infradead.org Hello Miles, On Tue, May 18, 2021 at 05:24:44PM +0800, Miles Chen wrote: > This patches is created to fix the __pa() warning messages when > CONFIG_DEBUG_VIRTUAL=y by unifying the allocation of pglist_data > instances. > > In current implementation of node_data, if CONFIG_NEED_MULTIPLE_NODES=y, > pglist_data is allocated by a memblock API. If CONFIG_NEED_MULTIPLE_NODES=n, > we use a global variable named "contig_page_data". > > If CONFIG_DEBUG_VIRTUAL is not enabled. __pa() can handle both > allocation and symbol cases. But if CONFIG_DEBUG_VIRTUAL is set, > we will have the "virt_to_phys used for non-linear address" warning > when booting. > > To fix the warning, always allocate pglist_data by memblock APIs and > remove the usage of contig_page_data. Somehow I was sure that we can allocate pglist_data before it is accessed in sparse_init() somewhere outside mm/sparse.c. It's really not the case and having two places that may allocated this structure is surely worth than your previous suggestion. Sorry about that. > Warning message: > [ 0.000000] ------------[ cut here ]------------ > [ 0.000000] virt_to_phys used for non-linear address: (____ptrval____) (contig_page_data+0x0/0x1c00) > [ 0.000000] WARNING: CPU: 0 PID: 0 at arch/arm64/mm/physaddr.c:15 __virt_to_phys+0x58/0x68 > [ 0.000000] Modules linked in: > [ 0.000000] CPU: 0 PID: 0 Comm: swapper Tainted: G W 5.13.0-rc1-00074-g1140ab592e2e #3 > [ 0.000000] Hardware name: linux,dummy-virt (DT) > [ 0.000000] pstate: 600000c5 (nZCv daIF -PAN -UAO -TCO BTYPE=--) > [ 0.000000] pc : __virt_to_phys+0x58/0x68 > [ 0.000000] lr : __virt_to_phys+0x54/0x68 > [ 0.000000] sp : ffff800011833e70 > [ 0.000000] x29: ffff800011833e70 x28: 00000000418a0018 x27: 0000000000000000 > [ 0.000000] x26: 000000000000000a x25: ffff800011b70000 x24: ffff800011b70000 > [ 0.000000] x23: fffffc0001c00000 x22: ffff800011b70000 x21: 0000000047ffffb0 > [ 0.000000] x20: 0000000000000008 x19: ffff800011b082c0 x18: ffffffffffffffff > [ 0.000000] x17: 0000000000000000 x16: ffff800011833bf9 x15: 0000000000000004 > [ 0.000000] x14: 0000000000000fff x13: ffff80001186a548 x12: 0000000000000000 > [ 0.000000] x11: 0000000000000000 x10: 00000000ffffffff x9 : 0000000000000000 > [ 0.000000] x8 : ffff8000115c9000 x7 : 737520737968705f x6 : ffff800011b62ef8 > [ 0.000000] x5 : 0000000000000000 x4 : 0000000000000001 x3 : 0000000000000000 > [ 0.000000] x2 : 0000000000000000 x1 : ffff80001159585e x0 : 0000000000000058 > [ 0.000000] Call trace: > [ 0.000000] __virt_to_phys+0x58/0x68 > [ 0.000000] check_usemap_section_nr+0x50/0xfc > [ 0.000000] sparse_init_nid+0x1ac/0x28c > [ 0.000000] sparse_init+0x1c4/0x1e0 > [ 0.000000] bootmem_init+0x60/0x90 > [ 0.000000] setup_arch+0x184/0x1f0 > [ 0.000000] start_kernel+0x78/0x488 > [ 0.000000] ---[ end trace f68728a0d3053b60 ]--- > > [1] https://lore.kernel.org/patchwork/patch/1425110/ > > Change since v1: > - use memblock_alloc() to create pglist_data when CONFIG_NUMA=n > > Miles Chen (2): > mm: introduce prepare_node_data > mm: replace contig_page_data with node_data > > Documentation/admin-guide/kdump/vmcoreinfo.rst | 13 ------------- > arch/powerpc/kexec/core.c | 5 ----- > include/linux/gfp.h | 3 --- > include/linux/mm.h | 2 ++ > include/linux/mmzone.h | 4 ++-- > kernel/crash_core.c | 1 - > mm/memblock.c | 3 +-- > mm/page_alloc.c | 16 ++++++++++++++++ > mm/sparse.c | 2 ++ > 9 files changed, 23 insertions(+), 26 deletions(-) > > > base-commit: 8ac91e6c6033ebc12c5c1e4aa171b81a662bd70f > -- > 2.18.0 > -- Sincerely yours, Mike. _______________________________________________ Linux-mediatek mailing list Linux-mediatek@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-mediatek 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=-9.4 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS autolearn=unavailable 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 BF0A1C433B4 for ; Tue, 18 May 2021 16:11:38 +0000 (UTC) Received: from desiato.infradead.org (desiato.infradead.org [90.155.92.199]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 43D82610E9 for ; Tue, 18 May 2021 16:11:38 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 43D82610E9 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=kernel.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=desiato.20200630; h=Sender:Content-Transfer-Encoding :Content-Type:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References:Message-ID: Subject:Cc:To:From:Date:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=EKVDRBhBBgrEqkg9s9pB9fvv+wrlA11edXiECPWufJ8=; b=lcFEZFwhruOoWI/+4AwGb+4jl fTsr0Lp1VXCUFsYX00IYjum7pwPgfRcrSm8KD0MuP6vFzS0O57ln9N7Q655G8qjRjiIdcZQ8J1HrZ s8ADAKnbjSCH82iYahnRtu1XgctO294KS3yrmvUoHDq3veYeh8Va6hWMTEYljK3h1USdqOFXZ3CXw ox6ZTdJ3jmnzCvn/i350P76mGlFfRtXbqLHPyQiDnGRFNhwOKehMgi5P5dAeYTofs2U4Qbfra7JVW IyaoXGyD3o/eVC3vCwd1C+PPmrjIy2Z5+Zl0/G8Rt0tpXQKBUg2hM1u0aPHuIlhKwxYVZA42/OnYE /IwzFN9ZQ==; Received: from localhost ([::1] helo=desiato.infradead.org) by desiato.infradead.org with esmtp (Exim 4.94 #2 (Red Hat Linux)) id 1lj2IB-001HSY-QM; Tue, 18 May 2021 16:09:59 +0000 Received: from bombadil.infradead.org ([2607:7c80:54:e::133]) by desiato.infradead.org with esmtps (Exim 4.94 #2 (Red Hat Linux)) id 1lj2I5-001HP4-D1; Tue, 18 May 2021 16:09:53 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20210309; h=In-Reply-To:Content-Type:MIME-Version :References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=/FSORVPZC8b/pjivQj2dMUrQN5HAuI8uAnEiPB3s1lo=; b=ZTmKX+n2UbjTw9OybbdYDPwFmz 2YebLb42k2qU47AW1NcZpaqE7jty2Adhwyzd9YkCvsa9EWL/M9cz5PM5SXMAu6sAcGOefoqfn4qXS AefE9rcasBgajrwH02izlzBOYYm327d3ZT0HrpNlNbkDLyMuc6pQb9cB1oUpztJxE8hFeGORxnRMk 24/9h7TWiPH+dYJfVpv7r2k5wrMsN9Qy36jUUeQ7c9b3C0lyNUtsFKXejGQKrWT+CdXQ3+nj6XzVJ an1jorh1pUVlxsfXkvmtjZe76DQ9xvwtKm18iexGS9nf1AGtfSp62Aj0D3wbBwSELujENlA2xtEhH FO3V//vg==; Received: from mail.kernel.org ([198.145.29.99]) by bombadil.infradead.org with esmtps (Exim 4.94 #2 (Red Hat Linux)) id 1lj2I2-00En1e-JJ; Tue, 18 May 2021 16:09:52 +0000 Received: by mail.kernel.org (Postfix) with ESMTPSA id 7AC69611AC; Tue, 18 May 2021 16:09:45 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1621354190; bh=qryFGREqLRRZQLKFaOIFkrGz8b/QRKaiyNq9FU8d52c=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=JWnj8jadWyIY4heJ96ftgfCxeqYRP1dxLHGsj+AKkdngR4J/hfRID4LcsnZnrInsc VBsZHqLtuCUsBfeWBVCKk+ZOzpYHGOs8Bo5PZJtNKD4wS5mtVc2WuaMG1H09wq7jhu ftkGYdCYyfkTR1MBoP23I7wO6cMr5OLGY0HtqDwSr0wtkQ+fD1jPH01Kyrf8C+TPqM at/V25Qc/l4SvBw/IpbDy/Z3kdPfmg0Fchfj/3jEO4BUZEOfOoDjSvodwwhwfsNeBa ju5N9xRKj2F6WqKrwGPQJoGOQ7iLP7LagH5pil0byD8Ah5CyF2y85mvWvCQNMJJ1LC aLrECFmDGe/fA== Date: Tue, 18 May 2021 19:09:40 +0300 From: Mike Rapoport To: Miles Chen Cc: Dave Young , Baoquan He , Vivek Goyal , Jonathan Corbet , Michael Ellerman , Benjamin Herrenschmidt , Paul Mackerras , Andrew Morton , kexec@lists.infradead.org, linux-doc@vger.kernel.org, linuxppc-dev@lists.ozlabs.org, linux-mm@kvack.org, linux-arm-kernel@lists.infradead.org, linux-mediatek@lists.infradead.org Subject: Re: [PATCH v2 0/2] mm: unify the allocation of pglist_data instances Message-ID: References: <20210518092446.16382-1-miles.chen@mediatek.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20210518092446.16382-1-miles.chen@mediatek.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210518_090950_700948_E93C8F92 X-CRM114-Status: GOOD ( 19.42 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Hello Miles, On Tue, May 18, 2021 at 05:24:44PM +0800, Miles Chen wrote: > This patches is created to fix the __pa() warning messages when > CONFIG_DEBUG_VIRTUAL=y by unifying the allocation of pglist_data > instances. > > In current implementation of node_data, if CONFIG_NEED_MULTIPLE_NODES=y, > pglist_data is allocated by a memblock API. If CONFIG_NEED_MULTIPLE_NODES=n, > we use a global variable named "contig_page_data". > > If CONFIG_DEBUG_VIRTUAL is not enabled. __pa() can handle both > allocation and symbol cases. But if CONFIG_DEBUG_VIRTUAL is set, > we will have the "virt_to_phys used for non-linear address" warning > when booting. > > To fix the warning, always allocate pglist_data by memblock APIs and > remove the usage of contig_page_data. Somehow I was sure that we can allocate pglist_data before it is accessed in sparse_init() somewhere outside mm/sparse.c. It's really not the case and having two places that may allocated this structure is surely worth than your previous suggestion. Sorry about that. > Warning message: > [ 0.000000] ------------[ cut here ]------------ > [ 0.000000] virt_to_phys used for non-linear address: (____ptrval____) (contig_page_data+0x0/0x1c00) > [ 0.000000] WARNING: CPU: 0 PID: 0 at arch/arm64/mm/physaddr.c:15 __virt_to_phys+0x58/0x68 > [ 0.000000] Modules linked in: > [ 0.000000] CPU: 0 PID: 0 Comm: swapper Tainted: G W 5.13.0-rc1-00074-g1140ab592e2e #3 > [ 0.000000] Hardware name: linux,dummy-virt (DT) > [ 0.000000] pstate: 600000c5 (nZCv daIF -PAN -UAO -TCO BTYPE=--) > [ 0.000000] pc : __virt_to_phys+0x58/0x68 > [ 0.000000] lr : __virt_to_phys+0x54/0x68 > [ 0.000000] sp : ffff800011833e70 > [ 0.000000] x29: ffff800011833e70 x28: 00000000418a0018 x27: 0000000000000000 > [ 0.000000] x26: 000000000000000a x25: ffff800011b70000 x24: ffff800011b70000 > [ 0.000000] x23: fffffc0001c00000 x22: ffff800011b70000 x21: 0000000047ffffb0 > [ 0.000000] x20: 0000000000000008 x19: ffff800011b082c0 x18: ffffffffffffffff > [ 0.000000] x17: 0000000000000000 x16: ffff800011833bf9 x15: 0000000000000004 > [ 0.000000] x14: 0000000000000fff x13: ffff80001186a548 x12: 0000000000000000 > [ 0.000000] x11: 0000000000000000 x10: 00000000ffffffff x9 : 0000000000000000 > [ 0.000000] x8 : ffff8000115c9000 x7 : 737520737968705f x6 : ffff800011b62ef8 > [ 0.000000] x5 : 0000000000000000 x4 : 0000000000000001 x3 : 0000000000000000 > [ 0.000000] x2 : 0000000000000000 x1 : ffff80001159585e x0 : 0000000000000058 > [ 0.000000] Call trace: > [ 0.000000] __virt_to_phys+0x58/0x68 > [ 0.000000] check_usemap_section_nr+0x50/0xfc > [ 0.000000] sparse_init_nid+0x1ac/0x28c > [ 0.000000] sparse_init+0x1c4/0x1e0 > [ 0.000000] bootmem_init+0x60/0x90 > [ 0.000000] setup_arch+0x184/0x1f0 > [ 0.000000] start_kernel+0x78/0x488 > [ 0.000000] ---[ end trace f68728a0d3053b60 ]--- > > [1] https://lore.kernel.org/patchwork/patch/1425110/ > > Change since v1: > - use memblock_alloc() to create pglist_data when CONFIG_NUMA=n > > Miles Chen (2): > mm: introduce prepare_node_data > mm: replace contig_page_data with node_data > > Documentation/admin-guide/kdump/vmcoreinfo.rst | 13 ------------- > arch/powerpc/kexec/core.c | 5 ----- > include/linux/gfp.h | 3 --- > include/linux/mm.h | 2 ++ > include/linux/mmzone.h | 4 ++-- > kernel/crash_core.c | 1 - > mm/memblock.c | 3 +-- > mm/page_alloc.c | 16 ++++++++++++++++ > mm/sparse.c | 2 ++ > 9 files changed, 23 insertions(+), 26 deletions(-) > > > base-commit: 8ac91e6c6033ebc12c5c1e4aa171b81a662bd70f > -- > 2.18.0 > -- Sincerely yours, Mike. _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel From mboxrd@z Thu Jan 1 00:00:00 1970 Return-path: Date: Tue, 18 May 2021 19:09:40 +0300 From: Mike Rapoport Subject: Re: [PATCH v2 0/2] mm: unify the allocation of pglist_data instances Message-ID: References: <20210518092446.16382-1-miles.chen@mediatek.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20210518092446.16382-1-miles.chen@mediatek.com> List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "kexec" Errors-To: kexec-bounces+dwmw2=infradead.org@lists.infradead.org To: Miles Chen Cc: Dave Young , Baoquan He , Vivek Goyal , Jonathan Corbet , Michael Ellerman , Benjamin Herrenschmidt , Paul Mackerras , Andrew Morton , kexec@lists.infradead.org, linux-doc@vger.kernel.org, linuxppc-dev@lists.ozlabs.org, linux-mm@kvack.org, linux-arm-kernel@lists.infradead.org, linux-mediatek@lists.infradead.org Hello Miles, On Tue, May 18, 2021 at 05:24:44PM +0800, Miles Chen wrote: > This patches is created to fix the __pa() warning messages when > CONFIG_DEBUG_VIRTUAL=y by unifying the allocation of pglist_data > instances. > > In current implementation of node_data, if CONFIG_NEED_MULTIPLE_NODES=y, > pglist_data is allocated by a memblock API. If CONFIG_NEED_MULTIPLE_NODES=n, > we use a global variable named "contig_page_data". > > If CONFIG_DEBUG_VIRTUAL is not enabled. __pa() can handle both > allocation and symbol cases. But if CONFIG_DEBUG_VIRTUAL is set, > we will have the "virt_to_phys used for non-linear address" warning > when booting. > > To fix the warning, always allocate pglist_data by memblock APIs and > remove the usage of contig_page_data. Somehow I was sure that we can allocate pglist_data before it is accessed in sparse_init() somewhere outside mm/sparse.c. It's really not the case and having two places that may allocated this structure is surely worth than your previous suggestion. Sorry about that. > Warning message: > [ 0.000000] ------------[ cut here ]------------ > [ 0.000000] virt_to_phys used for non-linear address: (____ptrval____) (contig_page_data+0x0/0x1c00) > [ 0.000000] WARNING: CPU: 0 PID: 0 at arch/arm64/mm/physaddr.c:15 __virt_to_phys+0x58/0x68 > [ 0.000000] Modules linked in: > [ 0.000000] CPU: 0 PID: 0 Comm: swapper Tainted: G W 5.13.0-rc1-00074-g1140ab592e2e #3 > [ 0.000000] Hardware name: linux,dummy-virt (DT) > [ 0.000000] pstate: 600000c5 (nZCv daIF -PAN -UAO -TCO BTYPE=--) > [ 0.000000] pc : __virt_to_phys+0x58/0x68 > [ 0.000000] lr : __virt_to_phys+0x54/0x68 > [ 0.000000] sp : ffff800011833e70 > [ 0.000000] x29: ffff800011833e70 x28: 00000000418a0018 x27: 0000000000000000 > [ 0.000000] x26: 000000000000000a x25: ffff800011b70000 x24: ffff800011b70000 > [ 0.000000] x23: fffffc0001c00000 x22: ffff800011b70000 x21: 0000000047ffffb0 > [ 0.000000] x20: 0000000000000008 x19: ffff800011b082c0 x18: ffffffffffffffff > [ 0.000000] x17: 0000000000000000 x16: ffff800011833bf9 x15: 0000000000000004 > [ 0.000000] x14: 0000000000000fff x13: ffff80001186a548 x12: 0000000000000000 > [ 0.000000] x11: 0000000000000000 x10: 00000000ffffffff x9 : 0000000000000000 > [ 0.000000] x8 : ffff8000115c9000 x7 : 737520737968705f x6 : ffff800011b62ef8 > [ 0.000000] x5 : 0000000000000000 x4 : 0000000000000001 x3 : 0000000000000000 > [ 0.000000] x2 : 0000000000000000 x1 : ffff80001159585e x0 : 0000000000000058 > [ 0.000000] Call trace: > [ 0.000000] __virt_to_phys+0x58/0x68 > [ 0.000000] check_usemap_section_nr+0x50/0xfc > [ 0.000000] sparse_init_nid+0x1ac/0x28c > [ 0.000000] sparse_init+0x1c4/0x1e0 > [ 0.000000] bootmem_init+0x60/0x90 > [ 0.000000] setup_arch+0x184/0x1f0 > [ 0.000000] start_kernel+0x78/0x488 > [ 0.000000] ---[ end trace f68728a0d3053b60 ]--- > > [1] https://lore.kernel.org/patchwork/patch/1425110/ > > Change since v1: > - use memblock_alloc() to create pglist_data when CONFIG_NUMA=n > > Miles Chen (2): > mm: introduce prepare_node_data > mm: replace contig_page_data with node_data > > Documentation/admin-guide/kdump/vmcoreinfo.rst | 13 ------------- > arch/powerpc/kexec/core.c | 5 ----- > include/linux/gfp.h | 3 --- > include/linux/mm.h | 2 ++ > include/linux/mmzone.h | 4 ++-- > kernel/crash_core.c | 1 - > mm/memblock.c | 3 +-- > mm/page_alloc.c | 16 ++++++++++++++++ > mm/sparse.c | 2 ++ > 9 files changed, 23 insertions(+), 26 deletions(-) > > > base-commit: 8ac91e6c6033ebc12c5c1e4aa171b81a662bd70f > -- > 2.18.0 > -- Sincerely yours, Mike. _______________________________________________ kexec mailing list kexec@lists.infradead.org http://lists.infradead.org/mailman/listinfo/kexec