Received: by 2002:a05:6a10:22f:0:0:0:0 with SMTP id 15csp2782706pxk; Tue, 15 Sep 2020 02:08:18 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxLQruWwxS2R/e8vmF5GqLIt6Q46nAzGgCJJKhPQc0o+gdx90hxST2ZeRuxnBe48gjAms7t X-Received: by 2002:aa7:d78f:: with SMTP id s15mr20944204edq.322.1600160898234; Tue, 15 Sep 2020 02:08:18 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1600160898; cv=none; d=google.com; s=arc-20160816; b=o+opXSN1t6+gCiHxvkPWu5ywx6p8Zq61PxIXKoa1KNdPhbGgfVP5PUt3pb5VHI15Xq 8cxqHg2O5Tmjw6OlEKxC9zNH0/gQn+pniwNCnU0ZDJ/Q8qNm5g29U1Ce1NqFNp2uBdv4 RLZ2f1MhVaI8N90WWP1EcIzpLiu2e+rfSbvG+vLp+8Oc1mDQV86nizk7lzu+T9xBI9eg 5JouUgIPLDxRteQVc63KHFGkGoontRcKT8BKsf9ibDn/YqJ7JcdYanMJb4Eks2VAVqcP Wi+K9I4FnW7FJ0NPG1gLNyekpgIJbN1vGPxNBY7ysBFrfFPr76RtKDM67jPW2k1l8G/T YGUQ== 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=A/kCUsB7U76+h82rBHzEQgnC33GtX6oDBwv4+qmj8mg=; b=xgT71k4fIQ9aKfHIg05PsahyRz83yEfObuTX0d32q3Efp3UkRQIAsiJJBWV7S1qY1B Ws/ejmVgMYEz09MqyE9faNqIs8hG0tw1r8+V7Y0qWyVXt5i1SM1TC94FW46xh3SmQ1R5 LTrv98Hnmscy6KCfxzvOBgGaCYv9JMEafNMzuKfwZBKI7gLK1fS+dTK089a4+kgjF9d6 trFSiQZcl4usYB0AaGd4bO+141SGuM75Ss6xuOYxsEcISpFSjRXGtToZC7gKIpFzaV7v L+v6PAyJmdBit1jlw/N6zkShymfJeo7Mmnxy+ZDw0uEMn0Cje2MeWl2G5ZXEeGcPm0Zj IjlA== 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 s6si10050115edi.427.2020.09.15.02.07.55; Tue, 15 Sep 2020 02:08:18 -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 S1726462AbgIOJGq (ORCPT + 99 others); Tue, 15 Sep 2020 05:06:46 -0400 Received: from out30-43.freemail.mail.aliyun.com ([115.124.30.43]:56036 "EHLO out30-43.freemail.mail.aliyun.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726142AbgIOJGS (ORCPT ); Tue, 15 Sep 2020 05:06:18 -0400 X-Alimail-AntiSpam: AC=PASS;BC=-1|-1;BR=01201311R971e4;CH=green;DM=||false|;DS=||;FP=0|-1|-1|-1|0|-1|-1|-1;HT=e01e04394;MF=richard.weiyang@linux.alibaba.com;NM=1;PH=DS;RN=18;SR=0;TI=SMTPD_---0U90pcMF_1600160772; Received: from localhost(mailfrom:richard.weiyang@linux.alibaba.com fp:SMTPD_---0U90pcMF_1600160772) by smtp.aliyun-inc.com(127.0.0.1); Tue, 15 Sep 2020 17:06:12 +0800 Date: Tue, 15 Sep 2020 17:06:12 +0800 From: Wei Yang To: David Hildenbrand Cc: Wei Yang , 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 , Michal Hocko , Dan Williams , Jason Gunthorpe , Kees Cook , Ard Biesheuvel , Pankaj Gupta , Baoquan He Subject: Re: [PATCH v2 1/7] kernel/resource: make release_mem_region_adjustable() never fail Message-ID: <20200915090612.GA6936@L-31X9LVDL-1304.local> Reply-To: Wei Yang References: <20200908201012.44168-1-david@redhat.com> <20200908201012.44168-2-david@redhat.com> <20200915021012.GC2007@L-31X9LVDL-1304.local> <927904b1-1909-f11f-483e-8012bda8ad0c@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <927904b1-1909-f11f-483e-8012bda8ad0c@redhat.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Sep 15, 2020 at 09:35:30AM +0200, David Hildenbrand wrote: > >>> static int __ref try_remove_memory(int nid, u64 start, u64 size) >>> { >>> int rc = 0; >>> @@ -1777,7 +1757,7 @@ static int __ref try_remove_memory(int nid, u64 start, u64 size) >>> memblock_remove(start, size); >>> } >>> >>> - __release_memory_resource(start, size); >>> + release_mem_region_adjustable(&iomem_resource, start, size); >>> >> >> Seems the only user of release_mem_region_adjustable() is here, can we move >> iomem_resource into the function body? Actually, we don't iterate the resource >> tree from any level. We always start from the root. > >You mean, making iomem_resource implicit? I can spot that something >similar was done for > >#define devm_release_mem_region(dev, start, n) \ > __devm_release_region(dev, &iomem_resource, (start), (n)) > What I prefer is remove iomem_resource from the parameter list. Just use is in the function body. For the example you listed, __release_region() would have varies of *parent*, which looks reasonable to keep it here. >I'll send an addon patch for that, ok? - thanks. > >-- >Thanks, > >David / dhildenb -- Wei Yang Help you, Help me