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=-3.8 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS, UNPARSEABLE_RELAY 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 EACA5C2D0E0 for ; Tue, 15 Sep 2020 09:33:57 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 7C3C12080C for ; Tue, 15 Sep 2020 09:33:57 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 7C3C12080C Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=linux.alibaba.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id D86F16B00B2; Tue, 15 Sep 2020 05:33:56 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id D37B86B00B4; Tue, 15 Sep 2020 05:33:56 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id C4D986B00B5; Tue, 15 Sep 2020 05:33:56 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0233.hostedemail.com [216.40.44.233]) by kanga.kvack.org (Postfix) with ESMTP id AD1E96B00B2 for ; Tue, 15 Sep 2020 05:33:56 -0400 (EDT) Received: from smtpin14.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay01.hostedemail.com (Postfix) with ESMTP id 8C299180AD81A for ; Tue, 15 Sep 2020 09:33:55 +0000 (UTC) X-FDA: 77264784030.14.veil92_27157f627110 Received: from filter.hostedemail.com (10.5.16.251.rfc1918.com [10.5.16.251]) by smtpin14.hostedemail.com (Postfix) with ESMTP id 5C59018229818 for ; Tue, 15 Sep 2020 09:33:55 +0000 (UTC) X-HE-Tag: veil92_27157f627110 X-Filterd-Recvd-Size: 3503 Received: from out30-133.freemail.mail.aliyun.com (out30-133.freemail.mail.aliyun.com [115.124.30.133]) by imf22.hostedemail.com (Postfix) with ESMTP for ; Tue, 15 Sep 2020 09:33:54 +0000 (UTC) X-Alimail-AntiSpam:AC=PASS;BC=-1|-1;BR=01201311R811e4;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_---0U90t1fN_1600162424; Received: from localhost(mailfrom:richard.weiyang@linux.alibaba.com fp:SMTPD_---0U90t1fN_1600162424) by smtp.aliyun-inc.com(127.0.0.1); Tue, 15 Sep 2020 17:33:45 +0800 Date: Tue, 15 Sep 2020 17:33:44 +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: <20200915093344.GA7324@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> <20200915090612.GA6936@L-31X9LVDL-1304.local> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Rspamd-Queue-Id: 5C59018229818 X-Spamd-Result: default: False [0.00 / 100.00] X-Rspamd-Server: rspam04 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: On Tue, Sep 15, 2020 at 11:15:53AM +0200, David Hildenbrand wrote: >On 15.09.20 11:06, Wei Yang wrote: >> 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. > >Yeah I got that ("making iomem_resource implicit"), as I said: > Thanks >>> I'll send an addon patch for that, ok? - thanks. > >-- >Thanks, > >David / dhildenb -- Wei Yang Help you, Help me