Received: by 2002:a05:6a10:6006:0:0:0:0 with SMTP id w6csp907009pxa; Thu, 27 Aug 2020 20:33:50 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwrKRu67xmidMA1fOAqjEGi33lT7YHgLmX9FTVWs/HGJx/K6emsV3JEmwxp7/b/BpsoLvLz X-Received: by 2002:aa7:c597:: with SMTP id g23mr20605239edq.172.1598585630390; Thu, 27 Aug 2020 20:33:50 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1598585630; cv=none; d=google.com; s=arc-20160816; b=DZm3+79SJR/bqtLF3edIdUEqKeS/pgJ37AvYHs8BaRpPwQn6FEz+VE27xFrkGEDKhf 93lnU0oW7uayh9m9lvtivTIsIXexBflvz1U0gS14DmDD4Xdr27pBw9aIA0J2m6o/ugf1 UKsyCqzBYOR3FPVzDlYD9AeB/Pfk9D8hBhSugC5RSdGkrN/duGrvH2WnLTmUMMzAEAuJ r6Vnco67zh6TRkXKlhxOIBEk6zBAzpmIcYFCMuo3McUudSeIh3amEUOBXm53JjXV8SGL clmF4R1Fs6LTyVlzag2e6vA33g5zpOM3kBDJSsqDCTM4w/mmUsDlmwevATWjUWNUfBBP 0C9Q== 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=6VE5AipHcE8cjCMz3bLQC8uAYtzEFGe0UrGlfqP1l58=; b=zRTuJuYqXq9JLkxMxkQ3eJVS2fWGHnLJ94DKsl0KFlxdm/1rGZZD2c2W+pEha3DB4W b6gHtFqt/A9AYLKyfWJ8yKBv95i643LgTcZ2wMOzHO7ozshdXVYRIYp4RLTMFCMIwan7 kNdgbn9/n3sm+gUPI7hBZNczzWdDLeZkt5hGNckYM0/Wmp0SFDGEYR1sN8V56dDuHWCH Wk1pweI1nCifis8xVgayB8utDSnAoCiAw7b9W5ZIjLaC7vSQ2pS+ayX7pxIxP/vC8VHY tomM1nTUQ3tCRCTIDLd/Idb+/MfZbKs/Zi+RZAHY/VEl3w7BfjUoNLOcdf6JLMwXuaoZ zigw== 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 91si882792edy.407.2020.08.27.20.33.28; Thu, 27 Aug 2020 20:33:50 -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 S1728197AbgH1Dc5 (ORCPT + 99 others); Thu, 27 Aug 2020 23:32:57 -0400 Received: from out30-133.freemail.mail.aliyun.com ([115.124.30.133]:36364 "EHLO out30-133.freemail.mail.aliyun.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727892AbgH1Dcy (ORCPT ); Thu, 27 Aug 2020 23:32:54 -0400 X-Alimail-AntiSpam: AC=PASS;BC=-1|-1;BR=01201311R171e4;CH=green;DM=||false|;DS=||;FP=0|-1|-1|-1|0|-1|-1|-1;HT=e01f04392;MF=richard.weiyang@linux.alibaba.com;NM=1;PH=DS;RN=6;SR=0;TI=SMTPD_---0U73Y7vW_1598585570; Received: from localhost(mailfrom:richard.weiyang@linux.alibaba.com fp:SMTPD_---0U73Y7vW_1598585570) by smtp.aliyun-inc.com(127.0.0.1); Fri, 28 Aug 2020 11:32:51 +0800 From: Wei Yang To: mike.kravetz@oracle.com, akpm@linux-foundation.org Cc: linux-mm@kvack.org, linux-kernel@vger.kernel.org, bhe@redhat.com, Wei Yang Subject: [Patch v2 1/7] mm/hugetlb: not necessary to coalesce regions recursively Date: Fri, 28 Aug 2020 11:32:36 +0800 Message-Id: <20200828033242.8787-2-richard.weiyang@linux.alibaba.com> X-Mailer: git-send-email 2.20.1 (Apple Git-117) In-Reply-To: <20200828033242.8787-1-richard.weiyang@linux.alibaba.com> References: <20200828033242.8787-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 Reviewed-by: Baoquan He Reviewed-by: Mike Kravetz --- 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)