Received: by 2002:a05:7412:6592:b0:d7:7d3a:4fe2 with SMTP id m18csp2392344rdg; Mon, 14 Aug 2023 00:27:18 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFmldz2ElFt6+u7mq2ZJ7Lb90Ebz6Yq2ALQFrPuxOxEBUhQ3y1OEnPnMxofm1J83F3fYmj6 X-Received: by 2002:a05:6a20:144b:b0:142:952d:3e61 with SMTP id a11-20020a056a20144b00b00142952d3e61mr12341437pzi.7.1691998038082; Mon, 14 Aug 2023 00:27:18 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1691998038; cv=none; d=google.com; s=arc-20160816; b=fRl4lSOFL4gvq5TesyM8KdzxmSwnoFVyJSWurelLuW/vvGMjqsqOavKjYMnUWLcWnb cLK158u7iNXw/UslMP8B+yewNsDrEd/Pg02aWDrLvtKC4oKVroBk0yxQ2t0fvSGsBgom Z1+pd6Yaj2nUpxVsOnfOK5aJ5CAOPHReNFr+6PLxWmGfKj+ABdwQIE/GMhi7do/chtlO OXTHVukH/eDmwOAXOuHJUWUELa7XfuPb8xl8qmXGEmC5MnQxSfaCzJ+29Vv5TWRnw/X1 3RHMZ4B2TkSligxCcUWBqD1Nu1LTMlJJ59E0PbFOkjxw2lOfPtEtszCN+GfxHKd3xtOE npQA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:user-agent:message-id:in-reply-to :date:references:subject:cc:to:from:dkim-signature; bh=q0e9rwWIWjg/ZDO7rCx96YDeMVzkuUww37+q5f0R3BI=; fh=ILsRVUSfqGI1uRQ6k9wtc/vchzfehdPIJ/UkXlcoFK4=; b=RigQXokTZrJhm0R0MCgxUkqbf8q+UmDZ1ePQTlR3S6b4CVQWLHmwYE2bonjZCMkKdR j7KNhfEKoDxUjM6cDKZxCQut/RhbS5ZaQfzVwQe7Y3VJY5jxZ1I3FEXPS3weSZFTMP7U kU+KQvTpZPoHV0j2KTOSBCwlhTwAfrA7b77Ru38pI+3eTBCy+ItTY2nMRq9csOhd8xc8 wLXpXbt9gsTvR8RJZjHBYudvvgyhCBOdHetQgR57GhqcYNrsLxsfSVwqsOPeRDJh7O7/ I8/k6ACuEPuDWzeRaT+9cQwzGPhYcVdbaTjk6u6bbZGOJ801A664ULa6/SU4VqEu/Gqs L79g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=EFK7z9KG; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id h191-20020a6383c8000000b00563fc720694si3513pge.119.2023.08.14.00.27.06; Mon, 14 Aug 2023 00:27:18 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=EFK7z9KG; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233450AbjHNGrC (ORCPT + 99 others); Mon, 14 Aug 2023 02:47:02 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55832 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233871AbjHNGqy (ORCPT ); Mon, 14 Aug 2023 02:46:54 -0400 Received: from mgamail.intel.com (mgamail.intel.com [134.134.136.126]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4C127E60; Sun, 13 Aug 2023 23:46:53 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1691995613; x=1723531613; h=from:to:cc:subject:references:date:in-reply-to: message-id:mime-version; bh=C0TDfkgSSHw3hPvjktNVzuGscNvAIMHKbLVHz69LTMQ=; b=EFK7z9KGXjYZj1FAhX5dLdRTLl4goO568XKd+J/NTSAqWWRrFcsxwpax uPSsMwswhwouHmplWXDCX5A20RVnCYeA+HxZpAb8RKR3KY4esX5kHt9UF CCj53r0eW+kVzlWkw8WEZi+gDx1nRxRGSCYEHT8SgYpfg5e0P7StmUUKl ipa8ZzvbaSLLYozo3Mlfr+v7EdnARRp47/XIyG9gMmdTDGLTNZOzwvAKj Bu6IhR+/Uh/jwrt8EhcPUComA0xufer+vandQf10tRWE8GOj/C1OF5n/t S2TOZI0Mg7hLU2qc4yGwbBzZQyNR5OqX6ta+WgLZ0mAT6iPuuxrGmFZMH Q==; X-IronPort-AV: E=McAfee;i="6600,9927,10801"; a="356939098" X-IronPort-AV: E=Sophos;i="6.01,171,1684825200"; d="scan'208";a="356939098" Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by orsmga106.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 13 Aug 2023 23:46:52 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10801"; a="847527023" X-IronPort-AV: E=Sophos;i="6.01,171,1684825200"; d="scan'208";a="847527023" Received: from yhuang6-desk2.sh.intel.com (HELO yhuang6-desk2.ccr.corp.intel.com) ([10.238.208.55]) by fmsmga002-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 13 Aug 2023 23:46:48 -0700 From: "Huang, Ying" To: "Verma, Vishal L" Cc: "david@redhat.com" , "Jiang, Dave" , "linux-mm@kvack.org" , "osalvador@suse.de" , "akpm@linux-foundation.org" , "linux-kernel@vger.kernel.org" , "Williams, Dan J" , "dave.hansen@linux.intel.com" , "Jonathan.Cameron@Huawei.com" , "nvdimm@lists.linux.dev" , "aneesh.kumar@linux.ibm.com" , "jmoyer@redhat.com" , "linux-cxl@vger.kernel.org" , Greg Kroah-Hartman , Mike Rapoport , Bernhard Walle Subject: Re: [PATCH v2 2/3] mm/memory_hotplug: split memmap_on_memory requests across memblocks References: <20230720-vv-kmem_memmap-v2-0-88bdaab34993@intel.com> <20230720-vv-kmem_memmap-v2-2-88bdaab34993@intel.com> <87wmyp26sw.fsf@yhuang6-desk2.ccr.corp.intel.com> Date: Mon, 14 Aug 2023 14:45:11 +0800 In-Reply-To: (Vishal L. Verma's message of "Wed, 2 Aug 2023 14:08:20 +0800") Message-ID: <87jzty9l6w.fsf@yhuang6-desk2.ccr.corp.intel.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.2 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=ascii X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE, SPF_NONE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org "Verma, Vishal L" writes: > On Mon, 2023-07-24 at 13:54 +0800, Huang, Ying wrote: >> Vishal Verma writes: >> >> > >> > @@ -2035,12 +2056,38 @@ void try_offline_node(int nid) >> > } >> > EXPORT_SYMBOL(try_offline_node); >> > >> > -static int __ref try_remove_memory(u64 start, u64 size) >> > +static void __ref __try_remove_memory(int nid, u64 start, u64 size, >> > + struct vmem_altmap *altmap) >> > { >> > - struct vmem_altmap mhp_altmap = {}; >> > - struct vmem_altmap *altmap = NULL; >> > - unsigned long nr_vmemmap_pages; >> > - int rc = 0, nid = NUMA_NO_NODE; >> > + /* remove memmap entry */ >> > + firmware_map_remove(start, start + size, "System RAM"); >> >> If mhp_supports_memmap_on_memory(), we will call >> firmware_map_add_hotplug() for whole range. But here we may call >> firmware_map_remove() for part of range. Is it OK? >> > > Good point, this is a discrepancy in the add vs remove path. Can the > firmware memmap entries be moved up a bit in the add path, and is it > okay to create these for each memblock? Or should these be for the > whole range? I'm not familiar with the implications. (I've left it as > is for v3 for now, but depending on the direction I can update in a > future rev). Cced more firmware map developers and maintainers. Per my understanding, we should create one firmware memmap entry for each memblock. -- Best Regards, Huang, Ying