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=-0.8 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS,URIBL_BLOCKED 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 2C7F8C433DF for ; Wed, 8 Jul 2020 15:51:52 +0000 (UTC) Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) (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 F10F2206F6 for ; Wed, 8 Jul 2020 15:51:51 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="uluqsjsh"; dkim=fail reason="signature verification failed" (2048-bit key) header.d=intel-com.20150623.gappssmtp.com header.i=@intel-com.20150623.gappssmtp.com header.b="eNptn699" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org F10F2206F6 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=intel.com 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=merlin.20170209; h=Sender:Content-Transfer-Encoding: Content-Type:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:To:Subject:Message-ID:Date:From:In-Reply-To: References:MIME-Version:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=J1QMtYz/f7/wsnh8gwijO88WT0kZclXqkq67MiSx2Ag=; b=uluqsjshgCw/P+6qDbbz54hYB WF0Zxu+lkoODCbu15kIEg0DLYfw9nVLesIZujAyT5yGZQ3xtnDrg0uD5NyDMR2JqwOA+PjGyR5xf/ zktP7Wirnp0+1L6Em3ESD8VuDcnkVXTogo/pBCX2B2BmVSDAlM/vJIBuBchi+qDfpq6kxmdVLuveZ jHboLpr+8daGHe6Idw1DztdJ21Ft5W+CQ7/YUvsxP1MrKDUc2WFwaNS2JnZx40lu5wFwi1+0uoN5f 7vxvzvcNEKIsuNdM1irvWgM/J1iwRY4EC5YNMgPFCBc53P872ll+gef3LCVKodBTcpTWFyaCC/zXR QYaY1xPyA==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1jtCL0-0002oi-3I; Wed, 08 Jul 2020 15:50:22 +0000 Received: from mail-ej1-x641.google.com ([2a00:1450:4864:20::641]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1jtCKw-0002mK-1m for linux-arm-kernel@lists.infradead.org; Wed, 08 Jul 2020 15:50:19 +0000 Received: by mail-ej1-x641.google.com with SMTP id lx13so32426346ejb.4 for ; Wed, 08 Jul 2020 08:50:15 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=intel-com.20150623.gappssmtp.com; s=20150623; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=1EiYlSj53kAa10Re22X7U17L3JibixRtXdcfzQAF4RI=; b=eNptn699SYep16X4CoHPkgiGM5zR/mQnI3Mzfc9eEIY75pcRdSypj0pJntEDR4CHvS AogyjaLxg5b7iP5tvNUzz/jAPzLjWzHgZoJOeYZCaJYfJsP54+JncPgdDwCXaNdf5kDH K1mIGvj60uqPjUQAobqbGoJIlXdqdUK/+fD1DMteEv5JNXCo5U65YhxhYzb+IlmrLu27 E3IX7kZcsTEMvjr4RRH6V4KWQ0rfrgXmeEmYl93SiTjzlboiF4oiFV3u04EJoo9Su1be U4kIpVOKeOQn52xh78cieCUwmNTeMkzDU3sr3r03UQCxfqxMjQyf2Q76ItzqDLCVZDbq Bqjw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=1EiYlSj53kAa10Re22X7U17L3JibixRtXdcfzQAF4RI=; b=ObmkLryqG5ZMQf+DAFGzohB+mGYi6dP7wzDQzwSNapiQpfXhX0hf7VMW7h4RqUF8lL zQ00xbMFX3is6qXasIzstivCrKwAiJ66CAckL/Of+X1sQbNr2QGC50QBEFjkz0h1tvFl B31VElLX3IDQQLH2NIhvF3oCLd8Ax1Y1yQxzQeOp0N4KJ+BAawn73Ns0soIx00LXp37u TStjgF3USK2Z2SzYAf6bHoOe6T7YjnWl2hum1vLcUNzy0fVLGonlADoAt5rLw59z5+hO 9e+Yuwj/14ROddyGZo6HhLgAh56XnQk0hgFx/PGSJ8IOnqBpdmqJk+KtL/t7qf1JqEOl vSaw== X-Gm-Message-State: AOAM533fodpr5u2qdbBjMt7RTon1GDm1US3/qP+mKPw2QoSZG5SKIMYZ JewaWxsHbCburUOo9B/Y4EteK3pf5qhUJZ8dQ0ZlYQ== X-Google-Smtp-Source: ABdhPJw/8Kbx1/bdnv7iOEbWdknY8BbvvUvThRPw7aqvnIeHYlAeIqwGVHirPg4m6UtNvCENnXVgYQiwBwoexLKostU= X-Received: by 2002:a17:906:b888:: with SMTP id hb8mr51820947ejb.124.1594223414714; Wed, 08 Jul 2020 08:50:14 -0700 (PDT) MIME-Version: 1.0 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> <20200708094549.GA781326@linux.ibm.com> <98166184-3aaf-479e-bfb3-fc737f4ac98d@redhat.com> In-Reply-To: <98166184-3aaf-479e-bfb3-fc737f4ac98d@redhat.com> From: Dan Williams Date: Wed, 8 Jul 2020 08:50:03 -0700 Message-ID: Subject: Re: [PATCH v2 1/3] arm64/numa: export memory_add_physaddr_to_nid as EXPORT_SYMBOL_GPL To: David Hildenbrand X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20200708_115018_280519_66D77CFD X-CRM114-Status: GOOD ( 29.00 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Kaly Xin , Jia He , Baoquan He , linux-nvdimm , Catalin Marinas , Chuhong Yuan , Linux Kernel Mailing List , Michal Hocko , Linux MM , Linux ARM , Vishal Verma , Dave Jiang , Andrew Morton , Mike Rapoport , Will Deacon , Mike Rapoport 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 On Wed, Jul 8, 2020 at 3:04 AM David Hildenbrand wrote: > > On 08.07.20 11:45, Mike Rapoport wrote: > > 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? > > Yes, looks like it. > > > > >>> 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. > > Yes, I tend to agree. Details to be clarified :) I'm not quite understanding the concern, or requirement about "updating memblock" in the hotplug path. The routines memory_add_physaddr_to_nid() and phys_to_target_node() are helpers to interrogate platform-firmware numa info through a common abstraction. They place no burden on the memory hotplug code they're just used to see if a hot-added range lies within an existing node span when platform-firmware otherwise fails to communicate a node. x86 can continue to back those helpers with numa_meminfo, arm64 can use a generic memblock implementation and other archs can follow the arm64 example if they want better numa answers for drivers. _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel