Message ID | 20230810095309.3109107-3-shikemeng@huaweicloud.com |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:b824:0:b0:3f2:4152:657d with SMTP id z4csp159196vqi; Wed, 9 Aug 2023 20:33:58 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHmy/GPwE50uueR2hqk6B2gaUh7lTm5/5w/Nw+R3Hpv8xVGGqs4vbGLhAZ/jYwliVfwJONw X-Received: by 2002:a17:902:d511:b0:1b3:fafd:11c5 with SMTP id b17-20020a170902d51100b001b3fafd11c5mr1215338plg.44.1691638437622; Wed, 09 Aug 2023 20:33:57 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1691638437; cv=none; d=google.com; s=arc-20160816; b=QOHYnS636AwTCO+QNxqiPJgVuKSlCsXUrSa3NyvvQLJ7pa23vQiskXiMCZNBy3tGSt LKNbpSWLEIyFYnRJ2pZBj2OpgGF/AWJ9cCGYcjasY6JD52xdN71YmsSoxMzY/JoUFYym 6aQuqmc/guqWebZbSX+l2CrV8YpvhSFEXEVNIKDnEPDbHYtmzBkD8DdQPx+Cnev8hW6a zlUJPi3q7kDZ0gzBDxSBUqmFdfe9J+QLa30CPMRse7o7E/YfDGaLOHLOlreucF94FxEF f3IYflTvRtDAq9Frj+H4rjLDnr+M1OSmhIfLLyvX7/F1XgA3ttaihUhFFHUh8AVzSkPC gTug== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from; bh=KfsDLmW+33ck7UhsOCgtuHEW/S7e7sfMpJT8/TxaYT4=; fh=7OUidGM7uWbpAl8VTxhM9W4yciPE2x0Gkm1foXEeriw=; b=XMYUSHuO+5carh2f8BDfGTsKbG2lIOE8n4eU3mrLEIWoLkz2IA1vodCHmCppngRG9c QY9T5/PANVsk57u1rVjJXxDCykKoq26SixK9DVx983gf17fTjmexAezo3Gx8Zavj464E FCY3Jia3uR3fIXWjgiiyZqOjkLcMlul3ouJ7tuAtpW9zvEJFoPWGm2gFvSBi0YyVm6+a 7pwbfexmU1/pLJrPdoLyLA4kXfGvZ2VjZ9tpx7UZ1PsHY4gYn7Q8lqtvIGnWaOxhLzVA AkpJe684KIt6HFLB4D1375Xh0ikiYXmS2V1Of/adFmNga5YLTOk37k47UkU0gt10EslC XA+Q== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id kr4-20020a170903080400b001b9e66e836dsi537800plb.587.2023.08.09.20.33.41; Wed, 09 Aug 2023 20:33:57 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232202AbjHJBxI (ORCPT <rfc822;craechal@gmail.com> + 99 others); Wed, 9 Aug 2023 21:53:08 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34012 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232124AbjHJBxF (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Wed, 9 Aug 2023 21:53:05 -0400 Received: from dggsgout11.his.huawei.com (dggsgout11.his.huawei.com [45.249.212.51]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6DE25C5 for <linux-kernel@vger.kernel.org>; Wed, 9 Aug 2023 18:53:05 -0700 (PDT) Received: from mail02.huawei.com (unknown [172.30.67.143]) by dggsgout11.his.huawei.com (SkyGuard) with ESMTP id 4RLqgx5D5jz4f3mHy for <linux-kernel@vger.kernel.org>; Thu, 10 Aug 2023 09:53:01 +0800 (CST) Received: from huaweicloud.com (unknown [10.175.124.27]) by APP4 (Coremail) with SMTP id gCh0CgCXJ6r8QtRkiaZjAQ--.27199S4; Thu, 10 Aug 2023 09:53:02 +0800 (CST) From: Kemeng Shi <shikemeng@huaweicloud.com> To: linux-mm@kvack.org, linux-kernel@vger.kernel.org, akpm@linux-foundation.org, baolin.wang@linux.alibaba.com, mgorman@techsingularity.net, david@redhat.com, willy@infradead.org Cc: shikemeng@huaweicloud.com Subject: [PATCH 2/3] mm/page_alloc: remove unnecessary check in break_down_buddy_pages Date: Thu, 10 Aug 2023 17:53:08 +0800 Message-Id: <20230810095309.3109107-3-shikemeng@huaweicloud.com> X-Mailer: git-send-email 2.30.0 In-Reply-To: <20230810095309.3109107-1-shikemeng@huaweicloud.com> References: <20230810095309.3109107-1-shikemeng@huaweicloud.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-CM-TRANSID: gCh0CgCXJ6r8QtRkiaZjAQ--.27199S4 X-Coremail-Antispam: 1UD129KBjvdXoW7XF4rWr48Kr18Wr1rWw1xZrb_yoWDAFb_ua n7tr95tFy5KF1IgF17C3W7GrWkWw1F9w4xWF4YgFsxKa4UAFnxta1kXFyrJr1Duay8ur98 W3ZxArW2qr1a9jkaLaAFLSUrUUUUUb8apTn2vfkv8UJUUUU8Yxn0WfASr-VFAUDa7-sFnT 9fnUUIcSsGvfJTRUUUbqAYFVCjjxCrM7AC8VAFwI0_Wr0E3s1l1xkIjI8I6I8E6xAIw20E Y4v20xvaj40_Wr0E3s1l1IIY67AEw4v_Jr0_Jr4l87I20VAvwVAaII0Ic2I_JFv_Gryl82 xGYIkIc2x26280x7IE14v26r15M28IrcIa0xkI8VCY1x0267AKxVW8JVW5JwA2ocxC64kI II0Yj41l84x0c7CEw4AK67xGY2AK021l84ACjcxK6xIIjxv20xvE14v26w1j6s0DM28EF7 xvwVC0I7IYx2IY6xkF7I0E14v26r4UJVWxJr1l84ACjcxK6I8E87Iv67AKxVW0oVCq3wA2 z4x0Y4vEx4A2jsIEc7CjxVAFwI0_GcCE3s1le2I262IYc4CY6c8Ij28IcVAaY2xG8wAqx4 xG64xvF2IEw4CE5I8CrVC2j2WlYx0E2Ix0cI8IcVAFwI0_Jr0_Jr4lYx0Ex4A2jsIE14v2 6r1j6r4UMcvjeVCFs4IE7xkEbVWUJVW8JwACjcxG0xvY0x0EwIxGrwACjI8F5VA0II8E6I AqYI8I648v4I1l42xK82IYc2Ij64vIr41l4I8I3I0E4IkC6x0Yz7v_Jr0_Gr1lx2IqxVAq x4xG67AKxVWUJVWUGwC20s026x8GjcxK67AKxVWUGVWUWwC2zVAF1VAY17CE14v26r1q6r 43MIIYrxkI7VAKI48JMIIF0xvE2Ix0cI8IcVAFwI0_Jr0_JF4lIxAIcVC0I7IYx2IY6xkF 7I0E14v26r4j6F4UMIIF0xvE42xK8VAvwI8IcIk0rVWUJVWUCwCI42IY6I8E87Iv67AKxV WUJVW8JwCI42IY6I8E87Iv6xkF7I0E14v26r4j6r4UJbIYCTnIWIevJa73UjIFyTuYvjTR QNVDUUUUU X-CM-SenderInfo: 5vklyvpphqwq5kxd4v5lfo033gof0z/ X-CFilter-Loop: Reflected X-Spam-Status: No, score=0.1 required=5.0 tests=BAYES_00,DATE_IN_FUTURE_06_12, RCVD_IN_DNSWL_BLOCKED,SPF_HELO_NONE,SPF_NONE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: <linux-kernel.vger.kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1773811466192027497 X-GMAIL-MSGID: 1773811466192027497 |
Series |
Fixes and cleanups to break_down_buddy_pages in
|
|
Commit Message
Kemeng Shi
Aug. 10, 2023, 9:53 a.m. UTC
1. We always have target in range started with next_page and full free
range started with current_buddy.
2. The last splited range size is 1 << low and low should be >= 0, then
size >= 1, then page + size and page will not interleave.
As summary, current_page will not equal to target page.
Signed-off-by: Kemeng Shi <shikemeng@huaweicloud.com>
---
mm/page_alloc.c | 6 ++----
1 file changed, 2 insertions(+), 4 deletions(-)
diff --git a/mm/page_alloc.c b/mm/page_alloc.c index fd93d1396ccd..d0b400733031 100644 --- a/mm/page_alloc.c +++ b/mm/page_alloc.c @@ -6562,10 +6562,8 @@ static void break_down_buddy_pages(struct zone *zone, struct page *page, if (set_page_guard(zone, current_buddy, high, migratetype)) continue; - if (current_buddy != target) { - add_to_free_list(current_buddy, zone, high, migratetype); - set_buddy_order(current_buddy, high); - } + add_to_free_list(current_buddy, zone, high, migratetype); + set_buddy_order(current_buddy, high); } }