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.0 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_AGENT_SANE_1 autolearn=no 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 73E2CC433ED for ; Thu, 13 May 2021 01:17:00 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id D996961183 for ; Thu, 13 May 2021 01:16:59 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org D996961183 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=redhat.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 201796B006C; Wed, 12 May 2021 21:16:59 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 1B0016B006E; Wed, 12 May 2021 21:16:59 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 028BB6B0070; Wed, 12 May 2021 21:16:58 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0216.hostedemail.com [216.40.44.216]) by kanga.kvack.org (Postfix) with ESMTP id C4A656B006C for ; Wed, 12 May 2021 21:16:58 -0400 (EDT) Received: from smtpin02.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay05.hostedemail.com (Postfix) with ESMTP id 4ECBD181AF5D0 for ; Thu, 13 May 2021 01:16:58 +0000 (UTC) X-FDA: 78134443716.02.6B926BA Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by imf25.hostedemail.com (Postfix) with ESMTP id 20520600013E for ; Thu, 13 May 2021 01:16:48 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1620868617; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=8rIOlce/5RXrT16ramfLpoZjAAz9w2C7JWd/JQK5isA=; b=Sz87xDnH113sWSHdeLObUgq6frhPNvVcr/FYNy+VTQimg0j87ykJSENRXaTQIkhiwzoPHF VvLZsdw5G3uj0yn05owGhPPU22sJRk/XbJ8bo9mFw4dl24w0jd/2rbrj1V8xircJpLlei8 RYDXJFLj1ZyNi6Lwqjiju0CN1zbn5CU= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-466-mgF-RyesNwGIJLXXb7cNcw-1; Wed, 12 May 2021 21:16:53 -0400 X-MC-Unique: mgF-RyesNwGIJLXXb7cNcw-1 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 14FC9801B12; Thu, 13 May 2021 01:16:52 +0000 (UTC) Received: from localhost (ovpn-12-82.pek2.redhat.com [10.72.12.82]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 15A0B63BA7; Thu, 13 May 2021 01:16:50 +0000 (UTC) Date: Thu, 13 May 2021 09:16:48 +0800 From: Baoquan He To: Mike Rapoport , Miles Chen Cc: Andrew Morton , linux-mm@kvack.org, linux-kernel@vger.kernel.org, linux-mediatek@lists.infradead.org, wsd_upstream@mediatek.com, k-hagio-ab@nec.com Subject: Re: [PATCH] mm/sparse: fix check_usemap_section_nr warnings Message-ID: <20210513011648.GA6776@MiWiFi-R3L-srv> References: <20210511093114.15123-1-miles.chen@mediatek.com> <1620797600.14730.7.camel@mtkswgap22> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.10.1 (2018-07-13) X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 Authentication-Results: imf25.hostedemail.com; dkim=pass header.d=redhat.com header.s=mimecast20190719 header.b=Sz87xDnH; dmarc=pass (policy=none) header.from=redhat.com; spf=none (imf25.hostedemail.com: domain of bhe@redhat.com has no SPF policy when checking 170.10.133.124) smtp.mailfrom=bhe@redhat.com X-Rspamd-Server: rspam05 X-Rspamd-Queue-Id: 20520600013E X-Stat-Signature: 7474ag1szjfrtpdjp67xpqwy8c9tmwz1 Received-SPF: none (redhat.com>: No applicable sender policy available) receiver=imf25; identity=mailfrom; envelope-from=""; helo=us-smtp-delivery-124.mimecast.com; client-ip=170.10.133.124 X-HE-DKIM-Result: pass/pass X-HE-Tag: 1620868608-201338 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 05/12/21 at 12:37pm, Mike Rapoport wrote: > On Wed, May 12, 2021 at 01:33:20PM +0800, Miles Chen wrote: > > On Tue, 2021-05-11 at 13:24 +0300, Mike Rapoport wrote: > > > On Tue, May 11, 2021 at 05:31:14PM +0800, Miles Chen wrote: > > > > In current implementation of node_data, if CONFIG_NEED_MULTIPLE_NODES=y, > > > > node_data is allocated by kzmalloc. 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 kzalloc 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. > > > > > > Maybe we'll just allocate pgdat for CONFIG_NEED_MULTIPLE_NODES=n (which is > > > essentially !NUMA) case in, say, free_area_init()? > > > > > > thanks for your comment. > > > > I check the source tree and found that contig_page_data is used by > > crash_core.c as a symbol. I am not familiar with crash_core but I guess > > allocate pgdat may break this crash_core users. > > > > For example: some userspace scripts want to read the address of > > contig_page_data symbol from a corefile. > > > > kernel/crash_core.c:460: VMCOREINFO_SYMBOL(contig_page_data); > > > > #ifndef CONFIG_NEED_MULTIPLE_NODES > > VMCOREINFO_SYMBOL(mem_map); > > VMCOREINFO_SYMBOL(contig_page_data); > > #endif > > My understanding is that VMCOREINFO_SYMBOL() should correspond to actual > symbol. If there is no contig_page_data symbol, there is no need for > VMCOREINFO_SYMBOL() either. Yeah, it's exported for makedumpfile and crash utility to parse and get the memory layout of the corrupted kernel. If removing it, makedumpfile will get it from node_data[]. Looks like a good idea to unify code for numa|!numa on pglist_data instances. Add Kazu to CC since he maintain makedumpfile and Crash utilities. My concern is that that only happens on arm/arm64/riscv, does it mean the warning is not necessary, so can be removed? Or we need to check if CONFIG_DEBUG_VIRTUAL doesn't work well in this case. Thanks Baoquan