Received: by 2002:a05:6a10:22f:0:0:0:0 with SMTP id 15csp233359pxk; Wed, 16 Sep 2020 03:04:04 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyNxGQXeZWFNjT2P+Lsdcyex1/q/qURI8VJciUdjk+/T+ystQCchPoW9sm8JAemOny/2WRN X-Received: by 2002:a17:907:64d:: with SMTP id wq13mr24031870ejb.513.1600250644230; Wed, 16 Sep 2020 03:04:04 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1600250644; cv=none; d=google.com; s=arc-20160816; b=b/FZpk6drmtMjeEffQmYjfQV0iLih8nQ7zP/Rcch9kstUGuIgv3MN5xSdWYtmyK0l5 JNLCtwRIrDPtoXJouSTwKzzRPfC4Za0QQEgf1L6k3hn0roGZwI/t2OjggsSybuyd15mP LWN0AWNJ1EdPsr45xnE5f8+Vpcd1oDEtAt2nmc0HXyxKKTOApMxb6YFcdPktVnXGF9XG C4WervHH41Bh3ogspuS21gfLC8LNgoBRKZ75rdQ+vQhdTQA4Z66ucfuorWQot1u7kOAr yho4kiJ2VzWRC6Ci04cRjit27/W9GL7E3LlPPHGtsY9mp59EDlkADd2C0hiFRSLBncZk 6ELQ== 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:reply-to:message-id:subject:cc:to:from:date; bh=7hu5t+Y32Ko8Uc9lCuZ0pWTaOukBcDWNGMHAXupuph8=; b=dQ4F0Ebxq9T+Nt8jBtvnK2UDFj9uEP/ivE4L5cl5ew3VpaI8dvgI3MGS8i8gPcNY58 2d1LyIYO13gruueEDp825ZL/C+nnW5OUMOsaumk62/IxeVYjjgsCjWVGcbE6AI5nWG/a fv6Ry4gzWScHAzgYKeEjOJ570W0eDRNjPQF04pkTcvg1ijJZrJ351NEnx+hp7vPMFjue CFfHdmPcKazAGaMSX5iHyEkvnnURi+5+u3QyHyVQwudKA9T7HDO3tzhIie9d7txTRm8y 6+D7pQoTlNpXLZPza67uBYFDty2vD0UF7qqjxz5Bjo6AAoXSXMp5MrwGgI4oDrWsY88s vFsA== 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=alibaba.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id u11si9096545edo.342.2020.09.16.03.03.41; Wed, 16 Sep 2020 03:04:04 -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=alibaba.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726781AbgIPKCg (ORCPT + 99 others); Wed, 16 Sep 2020 06:02:36 -0400 Received: from out30-42.freemail.mail.aliyun.com ([115.124.30.42]:38575 "EHLO out30-42.freemail.mail.aliyun.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726302AbgIPKC2 (ORCPT ); Wed, 16 Sep 2020 06:02:28 -0400 X-Alimail-AntiSpam: AC=PASS;BC=-1|-1;BR=01201311R281e4;CH=green;DM=||false|;DS=||;FP=0|-1|-1|-1|0|-1|-1|-1;HT=e01e04395;MF=richard.weiyang@linux.alibaba.com;NM=1;PH=DS;RN=18;SR=0;TI=SMTPD_---0U97.XS1_1600250543; Received: from localhost(mailfrom:richard.weiyang@linux.alibaba.com fp:SMTPD_---0U97.XS1_1600250543) by smtp.aliyun-inc.com(127.0.0.1); Wed, 16 Sep 2020 18:02:24 +0800 Date: Wed, 16 Sep 2020 18:02:23 +0800 From: Wei Yang To: David Hildenbrand Cc: linux-kernel@vger.kernel.org, virtualization@lists.linux-foundation.org, linux-mm@kvack.org, linux-hyperv@vger.kernel.org, xen-devel@lists.xenproject.org, linux-acpi@vger.kernel.org, linux-nvdimm@lists.01.org, linux-s390@vger.kernel.org, Andrew Morton , Wei Yang , Michal Hocko , Dan Williams , Jason Gunthorpe , Kees Cook , Ard Biesheuvel , Pankaj Gupta , Baoquan He Subject: Re: [PATCH] kernel/resource: make iomem_resource implicit in release_mem_region_adjustable() Message-ID: <20200916100223.GA46154@L-31X9LVDL-1304.local> Reply-To: Wei Yang References: <20200911103459.10306-1-david@redhat.com> <20200916073041.10355-1-david@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200916073041.10355-1-david@redhat.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Sep 16, 2020 at 09:30:41AM +0200, David Hildenbrand wrote: >"mem" in the name already indicates the root, similar to >release_mem_region() and devm_request_mem_region(). Make it implicit. >The only single caller always passes iomem_resource, other parents are >not applicable. > Looks good to me. Reviewed-by: Wei Yang >Suggested-by: Wei Yang >Cc: Andrew Morton >Cc: Michal Hocko >Cc: Dan Williams >Cc: Jason Gunthorpe >Cc: Kees Cook >Cc: Ard Biesheuvel >Cc: Pankaj Gupta >Cc: Baoquan He >Cc: Wei Yang >Signed-off-by: David Hildenbrand >--- > >Based on next-20200915. Follow up on > "[PATCH v4 0/8] selective merging of system ram resources" [1] >That's in next-20200915. As noted during review of v2 by Wei [2]. > >[1] https://lkml.kernel.org/r/20200911103459.10306-1-david@redhat.com >[2] https://lkml.kernel.org/r/20200915021012.GC2007@L-31X9LVDL-1304.local > >--- > include/linux/ioport.h | 3 +-- > kernel/resource.c | 5 ++--- > mm/memory_hotplug.c | 2 +- > 3 files changed, 4 insertions(+), 6 deletions(-) > >diff --git a/include/linux/ioport.h b/include/linux/ioport.h >index 7e61389dcb01..5135d4b86cd6 100644 >--- a/include/linux/ioport.h >+++ b/include/linux/ioport.h >@@ -251,8 +251,7 @@ extern struct resource * __request_region(struct resource *, > extern void __release_region(struct resource *, resource_size_t, > resource_size_t); > #ifdef CONFIG_MEMORY_HOTREMOVE >-extern void release_mem_region_adjustable(struct resource *, resource_size_t, >- resource_size_t); >+extern void release_mem_region_adjustable(resource_size_t, resource_size_t); > #endif > #ifdef CONFIG_MEMORY_HOTPLUG > extern void merge_system_ram_resource(struct resource *res); >diff --git a/kernel/resource.c b/kernel/resource.c >index 7a91b935f4c2..ca2a666e4317 100644 >--- a/kernel/resource.c >+++ b/kernel/resource.c >@@ -1240,7 +1240,6 @@ EXPORT_SYMBOL(__release_region); > #ifdef CONFIG_MEMORY_HOTREMOVE > /** > * release_mem_region_adjustable - release a previously reserved memory region >- * @parent: parent resource descriptor > * @start: resource start address > * @size: resource region size > * >@@ -1258,9 +1257,9 @@ EXPORT_SYMBOL(__release_region); > * assumes that all children remain in the lower address entry for > * simplicity. Enhance this logic when necessary. > */ >-void release_mem_region_adjustable(struct resource *parent, >- resource_size_t start, resource_size_t size) >+void release_mem_region_adjustable(resource_size_t start, resource_size_t size) > { >+ struct resource *parent = &iomem_resource; > struct resource *new_res = NULL; > bool alloc_nofail = false; > struct resource **p; >diff --git a/mm/memory_hotplug.c b/mm/memory_hotplug.c >index 553c718226b3..7c5e4744ac51 100644 >--- a/mm/memory_hotplug.c >+++ b/mm/memory_hotplug.c >@@ -1764,7 +1764,7 @@ static int __ref try_remove_memory(int nid, u64 start, u64 size) > memblock_remove(start, size); > } > >- release_mem_region_adjustable(&iomem_resource, start, size); >+ release_mem_region_adjustable(start, size); > > try_offline_node(nid); > >-- >2.26.2 -- Wei Yang Help you, Help me