Received: by 2002:a05:6a10:22f:0:0:0:0 with SMTP id 15csp1389603pxk; Mon, 31 Aug 2020 18:51:30 -0700 (PDT) X-Google-Smtp-Source: ABdhPJy3tEtBHs7byNDKZjT0RXJFmMENmQ22sRYg+fK6I1nVCWa4PezrfgRijYMRA8ype2FdzyKZ X-Received: by 2002:a17:906:e2d5:: with SMTP id gr21mr3707464ejb.438.1598925090022; Mon, 31 Aug 2020 18:51:30 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1598925090; cv=none; d=google.com; s=arc-20160816; b=p91mOLS2+WmE25YPHNsVsJRUcDg5Th85lAdpwQduXV9CRFhR4LvswuMKJP9C/lcYZY XkRt+Dne3MTnu6EGCbHJ8SZ237bst3NKuZgkcmz4+oD0ObDF9FTemeeXsxREX0BpqOsV Wsj7ZrAsRy0bXSPfVh/BgeEqe2u3Qi17JtScSPELwZHEtGRtDEfov+28R1ugtxknm3ex fN/OAw5G6EYQIRD6wsW2Pj9wvq1N4N9niwzAqZH7T+jN9h8WTaOBnIT0OOC61OHmz9Ga PSyRRkmHK/JiMmaqFChzD2EVv8+OU/xGdNcEN1FLvEej5klMht5T/kmEDNi2PDYWXC2Y cibw== 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=kEWIxtId1xqs1hdz4CtiPNoOc0KIxjuVVutSPJ0b9Lk=; b=Cc3iS89WmUpzeMRLjbaRubk/ITAcHu4L73GmXMc+Mww1AR5l2I/Md6vPjRZV/GTfab Lchgh/AJ/KIN5l8t5DWHvp+vCwZIcrQwXEwVbso/dtl1R7bK79XJis3vN5sGMy536aKs Co8+UYesuLvxMLslPnCCO83qY+VGOh9c5AJ0RBCVTo4gpc+FMHaELRfkZXpKVcAmu4/q /VtX1y8Y5bcLrv1xIlUHHNbmtxMVSkazJjjFcb4tsfC9WGKIsReCO4h6mkuSKh2isIkB IlYXKWxXjEtJDTFHtFpmGUSkulOHbrZAWlcaWR5PSSj2s1bE1KGGe1SgV++iqhB17+3+ 6rvw== 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 b24si249066ejl.331.2020.08.31.18.51.07; Mon, 31 Aug 2020 18:51:30 -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 S1726167AbgIABqp (ORCPT + 99 others); Mon, 31 Aug 2020 21:46:45 -0400 Received: from out30-42.freemail.mail.aliyun.com ([115.124.30.42]:52427 "EHLO out30-42.freemail.mail.aliyun.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726023AbgIABqo (ORCPT ); Mon, 31 Aug 2020 21:46:44 -0400 X-Alimail-AntiSpam: AC=PASS;BC=-1|-1;BR=01201311R141e4;CH=green;DM=||false|;DS=||;FP=0|-1|-1|-1|0|-1|-1|-1;HT=e01f04397;MF=richard.weiyang@linux.alibaba.com;NM=1;PH=DS;RN=6;SR=0;TI=SMTPD_---0U7UMeCq_1598924802; Received: from localhost(mailfrom:richard.weiyang@linux.alibaba.com fp:SMTPD_---0U7UMeCq_1598924802) by smtp.aliyun-inc.com(127.0.0.1); Tue, 01 Sep 2020 09:46:42 +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 v4 1/7] mm/hugetlb: not necessary to coalesce regions recursively Date: Tue, 1 Sep 2020 09:46:30 +0800 Message-Id: <20200901014636.29737-2-richard.weiyang@linux.alibaba.com> X-Mailer: git-send-email 2.20.1 (Apple Git-117) In-Reply-To: <20200901014636.29737-1-richard.weiyang@linux.alibaba.com> References: <20200901014636.29737-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 a301c2d672bf..db6af2654f12 100644 --- a/mm/hugetlb.c +++ b/mm/hugetlb.c @@ -309,8 +309,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); @@ -320,9 +319,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)