Received: by 2002:a05:7412:6592:b0:d7:7d3a:4fe2 with SMTP id m18csp2409665rdg; Mon, 14 Aug 2023 01:14:14 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGJWffhTFkFRizCm+yv77G81TkcQntvpLRbLWP2ud9N2HOkNUYL0UClufszC02+cW8GnS+J X-Received: by 2002:a05:6870:65a3:b0:1bb:8867:f7ef with SMTP id fp35-20020a05687065a300b001bb8867f7efmr9418369oab.25.1692000853740; Mon, 14 Aug 2023 01:14:13 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1692000853; cv=none; d=google.com; s=arc-20160816; b=DaZbc4qwKVMLjCaR7ZKxdTxLUw68LOemh381x1YfT9z2J1Lf44M9F8MCLvh2/JR/Ua Cv9+iowUZJokj63HvIZ3oHNo4/U0Ej8Q68EhVGU4dgomSVUqszh76mu+kDXpGjoH9kTu kZZ1ycfa3J9v4h4v8BAWPRle/yN8IlOfoP2kcHVH3uq6dkHIznMQTy+O2US0HsskxpeY Ysd4xdJ5MbcA7XfSajQaxquPYN2aiKOnLD7a7NZwWL9cdb3Q2FpcBHP9Y15c1lcxg6TI Jn4923I4l0P7iK/zfwyEwu8TtraWoHH+AKAaR2sDKBRTyNOvUdA4NbBC4H3UCf0vtyhx Aw2w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to :organization:from:content-language:references:cc:to:subject :user-agent:mime-version:date:message-id:dkim-signature; bh=BKY0cWansTn2sEL2WxZ0Fij0kBQM026mOZKicS65Eq4=; fh=7EFie336iIxfE7xj+22uMbcfZ9R9JhibKREbuU0qPnA=; b=uFlocjck4qiSizMlgTnN/CRkcrt6A8KVtWV1jraRkcmec55DdFLqe9bp6qPA+3nGrH WPQFwY+37JtX6m7ylDKwbUIYAqXYvRlB4SPXsQ8ewsBKsELZMoHH0iw8tml8BBuDMTMX Ev2F17p/p5upuYGODE2DGWquw1VzQjBD8jEw8lB485a1467r6DZvNTY7OS9VC8NPzhxs 5+vkJmlyky3J5pwoFm4+BVCMFclLQaE6AR3zykrsTdmHfmKJOKhs5XGsv1aO5O+hC7dN Nt2EDiu3MQzcKOFWPgKBHNZt+6otMSmc7IWbgvJkOHfqOHXPNrADNi15DGXuBHyAAiee BajA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=JYYt21Sk; 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=redhat.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id co20-20020a17090afe9400b002534f4ce2b6si9750164pjb.125.2023.08.14.01.14.01; Mon, 14 Aug 2023 01:14:13 -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=@redhat.com header.s=mimecast20190719 header.b=JYYt21Sk; 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=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233155AbjHNHVK (ORCPT + 99 others); Mon, 14 Aug 2023 03:21:10 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47932 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234141AbjHNHVF (ORCPT ); Mon, 14 Aug 2023 03:21:05 -0400 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B4A7110DE for ; Mon, 14 Aug 2023 00:20:17 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1691997616; 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: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=BKY0cWansTn2sEL2WxZ0Fij0kBQM026mOZKicS65Eq4=; b=JYYt21SkCFoWmNVj1kWjInmYAIJC3xbR5t82tArdueFfA7/u+3myeebvtG6vl6uq6UrPJm kO8nDRZkH+FFPprYPVW1J46iCT+7I3dMWsQFpyBGO+ft0gDw0BTReAW6FQn61yMYnmNlFF qMWm3xsQam8JYc1t+k19M9R6CzqpmNk= Received: from mail-lj1-f200.google.com (mail-lj1-f200.google.com [209.85.208.200]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-22-PmAUxpHfMRKzUJFMwGiZlQ-1; Mon, 14 Aug 2023 03:20:15 -0400 X-MC-Unique: PmAUxpHfMRKzUJFMwGiZlQ-1 Received: by mail-lj1-f200.google.com with SMTP id 38308e7fff4ca-2b9cd6a555aso38588911fa.3 for ; Mon, 14 Aug 2023 00:20:14 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1691997613; x=1692602413; h=content-transfer-encoding:in-reply-to:organization:from :content-language:references:cc:to:subject:user-agent:mime-version :date:message-id:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=BKY0cWansTn2sEL2WxZ0Fij0kBQM026mOZKicS65Eq4=; b=bF812UGFCG7AHYgFc5IjXcvMXlCIslsvaLQAEdoX3Umv1ms46d/qDG9+gVgbYOUP1u G+YhUCyHnobQAzZi+IWZUFTKMpqy8C+tpGjkEwAuuiT0wpiwkJ3IEBAsk0jVxHgSnKiH syVdb6RI/cvW6PagVSOUDaXuFCoeHozaNPfew153+v915s0ijSsZNXVkJ4SeXTdaHMI2 UD/6XKgzgMwiWxcXDcoK8au5OLCNXtGP3Eyg7SHleMeytHEyDfXoGezVp3sz3jqNOPEX ssfFGtdAnu7aEONaKdnZREzZPy+s9OhDkJwyImlYKWZcDJz0pyL1K5ZYuVgxYZNcZoDi fMoQ== X-Gm-Message-State: AOJu0YwRv4d85OY29YJP4IfEU/To2EPUbtgQ9f+vwtlC8ILumgvaHwZ9 W5gcfu3DLWsXeq+455tR8gaDDjoJHevpWPxV+XhgZPkveJQE/Z9WsPABOna+pmzP0Wzvc8BLYDG +kGJ+6KNuIp50lWIr3eoAuaD8 X-Received: by 2002:a05:6512:3985:b0:4fd:f77d:5051 with SMTP id j5-20020a056512398500b004fdf77d5051mr7102534lfu.26.1691997613532; Mon, 14 Aug 2023 00:20:13 -0700 (PDT) X-Received: by 2002:a05:6512:3985:b0:4fd:f77d:5051 with SMTP id j5-20020a056512398500b004fdf77d5051mr7102519lfu.26.1691997613136; Mon, 14 Aug 2023 00:20:13 -0700 (PDT) Received: from ?IPV6:2003:d8:2f2b:d900:2d94:8433:b532:3418? (p200300d82f2bd9002d948433b5323418.dip0.t-ipconnect.de. [2003:d8:2f2b:d900:2d94:8433:b532:3418]) by smtp.gmail.com with ESMTPSA id n20-20020a7bc5d4000000b003fe2a40d287sm13602203wmk.1.2023.08.14.00.20.11 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 14 Aug 2023 00:20:12 -0700 (PDT) Message-ID: <6ce08d40-332b-217e-6203-c73dd7203e96@redhat.com> Date: Mon, 14 Aug 2023 09:20:11 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.13.0 Subject: Re: [PATCH v2 2/3] mm/memory_hotplug: split memmap_on_memory requests across memblocks To: "Huang, Ying" , "Verma, Vishal L" Cc: "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 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> <87jzty9l6w.fsf@yhuang6-desk2.ccr.corp.intel.com> Content-Language: en-US From: David Hildenbrand Organization: Red Hat In-Reply-To: <87jzty9l6w.fsf@yhuang6-desk2.ccr.corp.intel.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-6.5 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,NICE_REPLY_A, RCVD_IN_DNSWL_BLOCKED,RCVD_IN_MSPIKE_H4,RCVD_IN_MSPIKE_WL, 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 On 14.08.23 08:45, Huang, Ying wrote: > "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. Ideally we should create it for the whole range, ti limit the ranges. But it really only matters for DIMMs; for dax/kmem, we'll not create any firmware entries. -- Cheers, David / dhildenb