Received: by 2002:a05:6a10:a0d1:0:0:0:0 with SMTP id j17csp2071586pxa; Fri, 7 Aug 2020 02:18:08 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzUtAUaR/h3gJdnljG14x3yBR6IvnWgF99I8Cv1+U18YaI+ES+Z+nXg7NrSkSKykecd2DWT X-Received: by 2002:a50:d1c2:: with SMTP id i2mr7641725edg.60.1596791888245; Fri, 07 Aug 2020 02:18:08 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1596791888; cv=none; d=google.com; s=arc-20160816; b=rBf0pSSF253/kb+wZS5Bno+Um+/wjkqvoHHVOEQxoWLeqhD9YnghPGilCzLPzOjTET 4G5XiaD/elpWj1eg7ZwJ0Q5I6uSPlTsOBnNJfmHZjaV/nAhjNnGc2ZdOKSkFfNagao/m fo+B16yJoQ6JCmPERPPsKIhsds1NHuueTZyPTjdFoj9IxezmbfeA3V7gw52yZ5PA3qbu oHVM3w58jp2cv30i/aPNDJ6h8jUFplpVqzMgBRRUTGhtmw9eopH1KKdfPf4zsa14Z3GO ny/ANkxOWQwlIlwgWerXXIvb0XGHDN5nM4Bn+kLbEBW61dAhTP15fpCCE7jS710jX9gp C3vg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from; bh=ErE2/bpQybjPSR0Ww966376udpkSfG11EE8gU5r4MSo=; b=B+5pEXE9OD+iYzD9zQ7Wqy5QPBd7zQgXOAorhFkxy0HAmJ8IZpqmGDqF5OE5tHJb8/ nO4HCHUNMOAE1a0wqh83BIKbqYHSKI0/yHV7z0IkVgreJNUQ2OBXB1MiMcWuAw8yy/ff ct5MDq2UEdc10rMCXe/jOMFFTwCp3Kh2L6WyzLPFRasmhu2tF1tlhxaIlIj5B1Og0dpC 86px8HWwRF9ZRhpIzsKDRY+XYTrrUiD9potK8lAm23ms447RPdNRxy/LLYzATJKxZeI1 IaWrppYR2rzjI6NhlcmEtVXmYSAHBoJM7aqI/nF6cBK7aCB1atMJPirih4Lm7TwBr7vf flrg== 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 e12si6295305edc.318.2020.08.07.02.17.45; Fri, 07 Aug 2020 02:18:08 -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 S1726956AbgHGJNS (ORCPT + 99 others); Fri, 7 Aug 2020 05:13:18 -0400 Received: from out30-130.freemail.mail.aliyun.com ([115.124.30.130]:57180 "EHLO out30-130.freemail.mail.aliyun.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726721AbgHGJNS (ORCPT ); Fri, 7 Aug 2020 05:13:18 -0400 X-Alimail-AntiSpam: AC=PASS;BC=-1|-1;BR=01201311R521e4;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=5;SR=0;TI=SMTPD_---0U5.0C2._1596791595; Received: from localhost(mailfrom:richard.weiyang@linux.alibaba.com fp:SMTPD_---0U5.0C2._1596791595) by smtp.aliyun-inc.com(127.0.0.1); Fri, 07 Aug 2020 17:13:16 +0800 From: Wei Yang To: mike.kravetz@oracle.com, akpm@linux-foundation.org Cc: linux-mm@kvack.org, linux-kernel@vger.kernel.org, Wei Yang Subject: [PATCH 01/10] mm/hugetlb: not necessary to coalesce regions recursively Date: Fri, 7 Aug 2020 17:12:42 +0800 Message-Id: <20200807091251.12129-2-richard.weiyang@linux.alibaba.com> X-Mailer: git-send-email 2.20.1 (Apple Git-117) In-Reply-To: <20200807091251.12129-1-richard.weiyang@linux.alibaba.com> References: <20200807091251.12129-1-richard.weiyang@linux.alibaba.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Per my understanding, we keep the regions ordered and would always coalesce regions properly. So the task to keep this property is just to coalesce its neighbour. Let's simplify this. Signed-off-by: Wei Yang --- mm/hugetlb.c | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/mm/hugetlb.c b/mm/hugetlb.c index 590111ea6975..62ec74f6d03f 100644 --- a/mm/hugetlb.c +++ b/mm/hugetlb.c @@ -307,8 +307,7 @@ static void coalesce_file_region(struct resv_map *resv, struct file_region *rg) list_del(&rg->link); kfree(rg); - coalesce_file_region(resv, prg); - return; + rg = prg; } nrg = list_next_entry(rg, link); @@ -318,9 +317,6 @@ static void coalesce_file_region(struct resv_map *resv, struct file_region *rg) list_del(&rg->link); kfree(rg); - - coalesce_file_region(resv, nrg); - return; } } -- 2.20.1 (Apple Git-117)