Received: by 2002:a05:6902:102b:0:0:0:0 with SMTP id x11csp403377ybt; Wed, 8 Jul 2020 02:47:03 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxGFn3aXVCak1JKOYSNsw/1cuKX6nx9FvxopDITS8UlobTYhN4lUpdFErI5+9Fs0XOjqgE5 X-Received: by 2002:aa7:c2d7:: with SMTP id m23mr3213568edp.216.1594201623183; Wed, 08 Jul 2020 02:47:03 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1594201623; cv=none; d=google.com; s=arc-20160816; b=uasuGYJS+cOVf1szpk0PadRdM8BDYpucDDHdanoXaLDLPZle3m5mZ9zX7puoxL9Bah gnmH41PYlPAAifzTj4SjfBz2pL0DzgS68CJtC/TE3pTK6O6xlCxNOCT+c/5xzQUW9aen J+i1WIjePrCcuiT+KmDRX4NGQX2Xtiu4UxYylTyEHvqcaWMFireyQdQat4AhsXTDr2fY aAg1VdSYKsCWr2swxzWwYw+chhDGav+FkpLMSP+uJfIIqOXDEH4ZDpm6B3mwXw0y8YmI Iwa0Iqxal4fqa8N9vKZAPVZOSU9pvLx11+To3dOFnHS0xKFbCjh30PSZZ83p/B6E5Q6g S8Yg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date; bh=rYUsRNPLryfj/o5XUOq5lC+vsB+kSP3BWqZU+8g5UbQ=; b=OvsO7N1gvg1Psx3PAJTi3cODiB1ZAol4FUeDtl9J3pOy8JwcmJVd4UcDxtvBY3Gy+0 PSOpwemFYXgXSJ86AoHhSVIXvkR/smnNlinZAupifUz0qg529JzwXXdVqvK2SYyN0KmL 5tEvKePg6cgLSSzQrndNL9FpePTmDXlBfRiPN7OZQNKtAe5fVDxsauRpX8z4X4pDAB/9 8yVeUHQTsEI/ROPj4waYnfwziL+Iib1XOUDkBI1yQh3WYad5DNih2QPb+u1tVYth9tmz GzAF8vGC7rzcfN66Yodli/O7vAiHa2uT7eXkyy55kuZ1ccIcruxbxSSXq0ubLXhfI97y B8yA== 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=ibm.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id d19si15549759ejt.396.2020.07.08.02.46.40; Wed, 08 Jul 2020 02:47:03 -0700 (PDT) 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=ibm.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728417AbgGHJqJ (ORCPT + 99 others); Wed, 8 Jul 2020 05:46:09 -0400 Received: from mx0a-001b2d01.pphosted.com ([148.163.156.1]:60752 "EHLO mx0a-001b2d01.pphosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726445AbgGHJqJ (ORCPT ); Wed, 8 Jul 2020 05:46:09 -0400 Received: from pps.filterd (m0098409.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.0.42/8.16.0.42) with SMTP id 0689Y4Aj181016; Wed, 8 Jul 2020 05:45:58 -0400 Received: from pps.reinject (localhost [127.0.0.1]) by mx0a-001b2d01.pphosted.com with ESMTP id 32584yej66-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 08 Jul 2020 05:45:57 -0400 Received: from m0098409.ppops.net (m0098409.ppops.net [127.0.0.1]) by pps.reinject (8.16.0.36/8.16.0.36) with SMTP id 0689b92K192578; Wed, 8 Jul 2020 05:45:57 -0400 Received: from ppma03fra.de.ibm.com (6b.4a.5195.ip4.static.sl-reverse.com [149.81.74.107]) by mx0a-001b2d01.pphosted.com with ESMTP id 32584yej58-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 08 Jul 2020 05:45:57 -0400 Received: from pps.filterd (ppma03fra.de.ibm.com [127.0.0.1]) by ppma03fra.de.ibm.com (8.16.0.42/8.16.0.42) with SMTP id 0689eLGH026392; Wed, 8 Jul 2020 09:45:55 GMT Received: from b06cxnps3074.portsmouth.uk.ibm.com (d06relay09.portsmouth.uk.ibm.com [9.149.109.194]) by ppma03fra.de.ibm.com with ESMTP id 322hd7t846-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 08 Jul 2020 09:45:54 +0000 Received: from d06av21.portsmouth.uk.ibm.com (d06av21.portsmouth.uk.ibm.com [9.149.105.232]) by b06cxnps3074.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 0689jqQl11338098 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 8 Jul 2020 09:45:52 GMT Received: from d06av21.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id C3C205204E; Wed, 8 Jul 2020 09:45:52 +0000 (GMT) Received: from linux.ibm.com (unknown [9.148.202.29]) by d06av21.portsmouth.uk.ibm.com (Postfix) with ESMTPS id 2F8345204F; Wed, 8 Jul 2020 09:45:51 +0000 (GMT) Date: Wed, 8 Jul 2020 12:45:49 +0300 From: Mike Rapoport To: David Hildenbrand Cc: Mike Rapoport , Dan Williams , Michal Hocko , Jia He , Catalin Marinas , Will Deacon , Vishal Verma , Dave Jiang , Andrew Morton , Baoquan He , Chuhong Yuan , Linux ARM , Linux Kernel Mailing List , Linux MM , linux-nvdimm , Kaly Xin Subject: Re: [PATCH v2 1/3] arm64/numa: export memory_add_physaddr_to_nid as EXPORT_SYMBOL_GPL Message-ID: <20200708094549.GA781326@linux.ibm.com> References: <20200707180043.GA386073@linux.ibm.com> <20200708052626.GB386073@linux.ibm.com> <9a009cf6-6c30-91ca-a1a5-9aa090c66631@redhat.com> <999ea296-4695-1219-6a4d-a027718f61e5@redhat.com> <20200708083951.GH386073@linux.ibm.com> <20200708091520.GE128651@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-TM-AS-GCONF: 00 X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:6.0.235,18.0.687 definitions=2020-07-08_07:2020-07-08,2020-07-08 signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 cotscore=-2147483648 mlxscore=0 lowpriorityscore=0 malwarescore=0 adultscore=0 mlxlogscore=999 bulkscore=0 impostorscore=0 suspectscore=1 phishscore=0 priorityscore=1501 spamscore=0 clxscore=1015 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2004280000 definitions=main-2007080069 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Jul 08, 2020 at 11:25:36AM +0200, David Hildenbrand wrote: > On 08.07.20 11:15, Mike Rapoport wrote: > >>>>>> > >>> But on more theoretical/fundmanetal level, I think we lack a generic > >>> abstraction similar to e.g. x86 'struct numa_meminfo' that serves as > >>> translaton of firmware supplied information into data that can be used > >>> by the generic mm without need to reimplement it for each and every > >>> arch. > >> > >> Right. As I expressed, I am not a friend of using memblock for that, and > >> the pgdat node span is tricky. > >> > >> Maybe abstracting that x86 concept is possible in some way (and we could > >> restrict the information to boot-time properties, so we don't have to > >> mess with memory hot(un)plug - just as done for numa_meminfo AFAIKS). > > > > I agree with pgdat part and disagree about memblock. It already has > > non-init physmap, why won't we add memblock.memory to the mix? ;-) > > Can we generalize and tweak physmap to contain node info? That's all we > need, no? (the special mem= parameter handling should not matter for our > use case, where "physmap" and "memory" would differ) TBH, I have only random vague thoughts at the moment. This might be an option. But then we need to enable physmap on !s390, right? > > Now, seriously, memblock already has all the necessary information about > > the coldplug memory for several architectures. x86 being an exception > > because for some reason the reserved memory is not considered memory > > there. The infrastructure for quiering and iterating memory regions is > > already there. We just need to leave out the irrelevant parts, like > > memblock.reserved and allocation funcions. > > I *really* don't want to mess with memblocks on memory hot(un)plug on > x86 and s390x (+other architectures in the future). I also thought about > stopping to create memblocks for hotplugged memory on arm64, by tweaking > pfn_valid() to query memblocks only for early sections. > > If "physmem" is not an option, can we at least introduce something like > ARCH_UPDTAE_MEMBLOCK_ON_HOTPLUG to avoid doing that on x86 and s390x for > now (and later maybe for others)? I have to do more memory hotplug howework to answer that ;-) My general point is that we don't have to reinvent the wheel to have coldplug memory representation, it's already there. We just need a way to use it properly. > -- > Thanks, > > David / dhildenb > -- Sincerely yours, Mike.