From patchwork Sat Aug 26 15:47:45 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kemeng Shi X-Patchwork-Id: 13366520 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id BE02BC83F11 for ; Sat, 26 Aug 2023 07:48:11 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 65F2F2800EB; Sat, 26 Aug 2023 03:48:09 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 60EAB2800EA; Sat, 26 Aug 2023 03:48:09 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 461E82800EB; Sat, 26 Aug 2023 03:48:09 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0011.hostedemail.com [216.40.44.11]) by kanga.kvack.org (Postfix) with ESMTP id 356602800EA for ; Sat, 26 Aug 2023 03:48:09 -0400 (EDT) Received: from smtpin28.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay10.hostedemail.com (Postfix) with ESMTP id 29649C011F for ; Sat, 26 Aug 2023 07:48:08 +0000 (UTC) X-FDA: 81165477456.28.021B676 Received: from dggsgout12.his.huawei.com (unknown [45.249.212.56]) by imf08.hostedemail.com (Postfix) with ESMTP id E2F8E160006 for ; Sat, 26 Aug 2023 07:48:05 +0000 (UTC) Authentication-Results: imf08.hostedemail.com; dkim=none; spf=none (imf08.hostedemail.com: domain of shikemeng@huaweicloud.com has no SPF policy when checking 45.249.212.56) smtp.mailfrom=shikemeng@huaweicloud.com; dmarc=none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1693036086; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:mime-version:mime-version:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=Ut+LFIwwXptAQpA3D+G5n0tGS/UjQZCuyKTClyCORU8=; b=DNnARdLPP5MVZQuEaPkMGjo/FhAOkl7t/sOd8QVgGSQaM1xLy/Wk/7/CluI/jii5GMOIQ2 FzpQNbjUV9ReeBQQuSSFj6hoQP8tlrI0EAF3LU2d+Q662Y8pvOEhuEilPRQsTkA9gKcnFl YumzzbXhzAUvf4djQ1fd9N9uEy0K5YU= ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1693036086; a=rsa-sha256; cv=none; b=Y7b+bBggJET1JP6eQrObZLZ/AERvESNpsneYckgPBLXftgJHDPRU1lIhfhjW1xmNwAOq/R tdp/zfE0F1tPIYBfsm0908ff2ZYjHojB3IkXT8C8AQHC6bSvosDKAcxZNPYiNNC44R2xw0 /DWMH+NzccFkQE/KqWtVTeHTmf0Vrzw= ARC-Authentication-Results: i=1; imf08.hostedemail.com; dkim=none; spf=none (imf08.hostedemail.com: domain of shikemeng@huaweicloud.com has no SPF policy when checking 45.249.212.56) smtp.mailfrom=shikemeng@huaweicloud.com; dmarc=none Received: from mail02.huawei.com (unknown [172.30.67.169]) by dggsgout12.his.huawei.com (SkyGuard) with ESMTP id 4RXpp35lVnz4f3kj1 for ; Sat, 26 Aug 2023 15:47:55 +0800 (CST) Received: from huaweicloud.com (unknown [10.175.124.27]) by APP4 (Coremail) with SMTP id gCh0CgB3B6osrulk6+l0Bg--.52079S5; Sat, 26 Aug 2023 15:47:59 +0800 (CST) From: Kemeng Shi To: akpm@linux-foundation.org, linux-mm@kvack.org, linux-kernel@vger.kernel.org, willy@infradead.org, naoya.horiguchi@nec.com, osalvador@suse.de Subject: [PATCH v2 3/3] mm/page_alloc: remove unnecessary next_page in break_down_buddy_pages Date: Sat, 26 Aug 2023 23:47:45 +0800 Message-Id: <20230826154745.4019371-4-shikemeng@huaweicloud.com> X-Mailer: git-send-email 2.30.0 In-Reply-To: <20230826154745.4019371-1-shikemeng@huaweicloud.com> References: <20230826154745.4019371-1-shikemeng@huaweicloud.com> MIME-Version: 1.0 X-CM-TRANSID: gCh0CgB3B6osrulk6+l0Bg--.52079S5 X-Coremail-Antispam: 1UD129KBjvdXoWrZr48Cr17tF4ktryrZrW3Awb_yoWfKrg_CF s7twnxtFyYgFy7ta13A3WxJayDXasY9r4xXF13tr9xCFyDJFn3X3Z5XFy3CrW5ua4ru348 uasrZ3y7tF4I9jkaLaAFLSUrUUUUUb8apTn2vfkv8UJUUUU8Yxn0WfASr-VFAUDa7-sFnT 9fnUUIcSsGvfJTRUUUbfkYFVCjjxCrM7AC8VAFwI0_Wr0E3s1l1xkIjI8I6I8E6xAIw20E Y4v20xvaj40_Wr0E3s1l1IIY67AEw4v_Jr0_Jr4l87I20VAvwVAaII0Ic2I_JFv_Gryl82 xGYIkIc2x26280x7IE14v26r1rM28IrcIa0xkI8VCY1x0267AKxVW8JVW5JwA2ocxC64kI II0Yj41l84x0c7CEw4AK67xGY2AK021l84ACjcxK6xIIjxv20xvE14v26F1j6w1UM28EF7 xvwVC0I7IYx2IY6xkF7I0E14v26r4UJVWxJr1l84ACjcxK6I8E87Iv67AKxVW0oVCq3wA2 z4x0Y4vEx4A2jsIEc7CjxVAFwI0_GcCE3s1le2I262IYc4CY6c8Ij28IcVAaY2xG8wAqx4 xG64xvF2IEw4CE5I8CrVC2j2WlYx0E2Ix0cI8IcVAFwI0_JrI_JrylYx0Ex4A2jsIE14v2 6r1j6r4UMcvjeVCFs4IE7xkEbVWUJVW8JwACjcxG0xvY0x0EwIxGrwCF04k20xvY0x0EwI xGrwCFx2IqxVCFs4IE7xkEbVWUJVW8JwC20s026c02F40E14v26r1j6r18MI8I3I0E7480 Y4vE14v26r106r1rMI8E67AF67kF1VAFwI0_JF0_Jw1lIxkGc2Ij64vIr41lIxAIcVC0I7 IYx2IY67AKxVW8JVW5JwCI42IY6xIIjxv20xvEc7CjxVAFwI0_Cr0_Gr1UMIIF0xvE42xK 8VAvwI8IcIk0rVWUJVWUCwCI42IY6I8E87Iv67AKxVW8JVWxJwCI42IY6I8E87Iv6xkF7I 0E14v26r4j6r4UJbIYCTnIWIevJa73UjIFyTuYvjxUVVWLUUUUU X-CM-SenderInfo: 5vklyvpphqwq5kxd4v5lfo033gof0z/ X-CFilter-Loop: Reflected X-Rspamd-Queue-Id: E2F8E160006 X-Rspam-User: X-Stat-Signature: 4kyjsmiozybnfi8sxnw3qsy7s1sge6wa X-Rspamd-Server: rspam03 X-HE-Tag: 1693036085-802442 X-HE-Meta: U2FsdGVkX19+mBCgCP70jXaKLDA/4VfoXVs4geFkYaXtHH5d22QqCk9OFt6N6s7IgFkVw7LCqGwWyvq/eZCpZF/bL677JJJu53UhP6/FdPa/ggBFQEXUhjDW+LXjWildzGXsYhA1lOX0Ur8+VtD1gUR/KvTKsMKXa2F8fKxpeXqhxixM5YWejOVC7dCq9gCXD6bWNXTAsU2buUAoJtF0RNFMPghOKY4ilo0kE6FMiv+qBNRA7zE+MQzRNgLPLo5KWj+nRYwHiMnsrmRkwMC0at3obBPuyhGAnEuZe9FRTJFcN2a2SPjIHviuppooE304nj2pF/jCggUR1SKH78ImgdL7MVGTzKHiDVbOPYJqkebyFdCnTB9nVTOn9Q97mtTh0Drktw4Pjz6+XGuEn9UdREjc/Byp6BRZB3jf6NX5cafAYxbvdWbGVAGsuSXcwFzE4wgkZi9bWP+VpCgQvzw8/dLJOykhma0gVe5IqKEXxAHuSvuoMI6klALlRjlUERSwk5XxC+d9mC767Y+eDby/YSn0hQSxUuOOZxX04xBzAVs0oX9o73x0J+QUmapAHxYI5uIZvjwrtJGNKquKtXh4QhjY4g4D3PcYgKjiFhWhc3OQ8gGyTe4EnSlP5B9AiQqVYjO4kuT4zFJ7/5Z5PRoxuMg8i1vE8w+Fvrk1KklZTkcznjs4a4DbhyVjwivcrHmz0WKTlK7KiAo+R+kBLyC57qjJDGa0lHShcMohW/sCyZ+R+Xs60lvFf7KBH/eF39PHPMifL/pQiaaozMvFLBruj+89Lq1Fx+X1xKqDsgq2BWNJPrGySAl75ZjYKWKKmE39MVTJ8gE1SL7AezjxARW9JE+H+TBkxebz24ctj3QWOyil1vRbmSkWebSuiRhmy+/3RHv9BNwFvEmhA9+dRGjb44eMZfTh5EXKMMuShoDwlgbZpFNGFn4uzlOK2yCUxjmo0XlA0X99Xnq+3V2fdbf ZXjY+uu4 +XtVI8YPR6QCns/77LM7ThxsrtXMDmVsmVZF+bOWKAjGtanIkNiGEU1EULYWQ1P/mn0mXm2NKu4IHut4k5KPOAmP3sf/ccDOwTi/oi9M2d8yZ9idM0JcLB4UQWFxiwrR6G2OI6GbA3O8so5xZeiAXLrS1IhxU4YFRav4YqBl5SczlStC9s27k/jvQj8mMV1g6mIwlgX59VUxOZCDPOSb7DOX5YjfBrSM/bdMhVjUmPubyL2DDuTSpR8bSak+vcXRGt1A+VZmuLQvZ+qeUhkj+sWUihPGkOausFmH9UgKMTVnyOQBgrmcGer9Xjg== 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: The next_page is only used to forward page in case target is in second harf range. Move forward page directly to remove unnecessary next_page. Signed-off-by: Kemeng Shi Acked-by: Naoya Horiguchi --- 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 bb74b40dc195..1c35ee022dde 100644 --- a/mm/page_alloc.c +++ b/mm/page_alloc.c @@ -6492,20 +6492,18 @@ static void break_down_buddy_pages(struct zone *zone, struct page *page, int migratetype) { unsigned long size = 1 << high; - struct page *current_buddy, *next_page; + struct page *current_buddy; while (high > low) { high--; size >>= 1; if (target >= &page[size]) { - next_page = page + size; current_buddy = page; + page = page + size; } else { - next_page = page; current_buddy = page + size; } - page = next_page; if (set_page_guard(zone, current_buddy, high, migratetype)) continue;