Message ID | 20230810095309.3109107-3-shikemeng@huaweicloud.com (mailing list archive) |
---|---|
State | New |
Headers | show
Return-Path: <owner-linux-mm@kvack.org> 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 5DDEDEB64DD for <linux-mm@archiver.kernel.org>; Thu, 10 Aug 2023 01:53:13 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id CC6176B0075; Wed, 9 Aug 2023 21:53:10 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id C73DC6B0078; Wed, 9 Aug 2023 21:53:10 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id B3BD18E0001; Wed, 9 Aug 2023 21:53:10 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0013.hostedemail.com [216.40.44.13]) by kanga.kvack.org (Postfix) with ESMTP id 9E8256B0075 for <linux-mm@kvack.org>; Wed, 9 Aug 2023 21:53:10 -0400 (EDT) Received: from smtpin04.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay08.hostedemail.com (Postfix) with ESMTP id 70577140942 for <linux-mm@kvack.org>; Thu, 10 Aug 2023 01:53:10 +0000 (UTC) X-FDA: 81106522140.04.F6BB7F8 Received: from dggsgout12.his.huawei.com (unknown [45.249.212.56]) by imf10.hostedemail.com (Postfix) with ESMTP id A794BC0012 for <linux-mm@kvack.org>; Thu, 10 Aug 2023 01:53:07 +0000 (UTC) Authentication-Results: imf10.hostedemail.com; dkim=none; dmarc=none; spf=none (imf10.hostedemail.com: domain of shikemeng@huaweicloud.com has no SPF policy when checking 45.249.212.56) smtp.mailfrom=shikemeng@huaweicloud.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1691632388; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=KfsDLmW+33ck7UhsOCgtuHEW/S7e7sfMpJT8/TxaYT4=; b=PA/G1f8th4Ug2+5GP0HZR9PcMY9lYwF13mN9sGjKTOBje7AhzgFkYCeMsmuphdJr7Y1PVW gKyI3dk55BYkggVNs13VZ49nkjTDvjQ41JgEOvhY3SlmKy3jDmn0tc/3ewbcsvyRkZYNUQ gG7CjrjSiXygqtmw0OAqr5sD7CIYVtg= ARC-Authentication-Results: i=1; imf10.hostedemail.com; dkim=none; dmarc=none; spf=none (imf10.hostedemail.com: domain of shikemeng@huaweicloud.com has no SPF policy when checking 45.249.212.56) smtp.mailfrom=shikemeng@huaweicloud.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1691632388; a=rsa-sha256; cv=none; b=aI1Y7k+GixWsK2/qewMlzKDw2n9Ro+gz/oCUSRs4tsJN0E0D5g6m8gks5a9EqQnYLMwy68 9tIQKiUDSsLMAkkXEwhpyDeMYSk+8FTqWIirl0gwE20neWDmYQ1tu6b2J1SBO5FIaWB2Eu MKu64K6r51c+JzOlRWRv/5Zda/2WZUc= Received: from mail02.huawei.com (unknown [172.30.67.143]) by dggsgout12.his.huawei.com (SkyGuard) with ESMTP id 4RLqgv5yytz4f3lKZ for <linux-mm@kvack.org>; Thu, 10 Aug 2023 09:52:59 +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-Rspamd-Queue-Id: A794BC0012 X-Rspam-User: X-Rspamd-Server: rspam05 X-Stat-Signature: nhqbyhy6y6fn1yn84uy8kpewwm6o3myc X-HE-Tag: 1691632387-576162 X-HE-Meta: U2FsdGVkX1+03UM1EezeJ1h5vOJ44do7pn4Op3q6/9bTaL2+PmEwAzZF3nfUYp19Y/Yj4WPc22Dq92/jpJGJnakrTtSaNQWfuMzdR3VTRIdMCBmR1YDvg86hik/lOOc8l5OBtahYo/bQLaFreo762dEiGi/AWD7hBAxPYlc0OS6+MM05LGMFG3ZQFm1/bEU9BDUFScu2EbDcEjzxGz+45M8nubQpPMd5FBjXBBLs73Mx2Gp/oTYeRQm86OezvjcCYBlsOqb3ZpvYvlC5/KmC5S2dO8zWuCKbZMwmd9V9NOptifkm3hWDw3FJl87CKHXj5ilp0DxrVSlNQNk7a34+D/5OHt8KQMrIvLnyUkCcpCEHXW8bSc6L3OzTJKoPIVkQpM5XUXya/jVcX3l9ZIHPMhGb2d4MfbnoPQ6yxRz9/2n81k/XwMJyCuGtOykyfIeAYsNj++ZQdVak1Y9m2OAC/i0rJOuHji0ragzG0l1jrS98KULfQBWYQ/AC4XNx6MR8Lu1VyHmBtOfiUOabcczLPV7UqVjEINXfkO6o4UWItzehf694dSCovnSwEhm81YtOMhD1JqkPUajI4YbiVjSrZVHksQ38tniHp7WHQOHHp1q2XacG/YRrTgtauHxkHP+tvEeoSBJ6yY59zLhfrVHdo3h6QfNoNmNm7XlLFZce3RqxQvUijQNj5h/bmk2h0wJzy9QdkY0L/pU7cBFDKyRc+cz1euawCY5RMoYqzzLtNjFT60D4R+zYt1JpQ7+UZZw8Va2jAETADKus8jyi3R591B8yl+UdDkxDqMcuxDlQw+9o860S779cLqE/nNG8lw4IOgbTLPZZnGrtmjXTkyCHxPG42zE0UI70Dfkl8xlMZtYOmDTZY1JFXGiRYqP9r1dWNLyytrgQo246EwHy6Pv70r51plwXNA8MJe76Zu2nKZjaSJ8PDSLSnzrg+6FkxLxDDED6xyMWBZYpbjzdgVv qIQVFnhw JiCubG9QCPVbP1tyYF0/3BqnqX+2f0N6PtD0mYVIMtE8i7YapFoATZoiaaWFq8Wb1i4LvGClmyMwARjK45/EZGR9W7LWpF6e0b/w4lvEoI6tpgqa8dWztrbGCD6bmuYhF6v3sNY20H8rITRjuvfFvv3Y7yZyeJWiMos0y0VLRKqMylHk+ig1AHVRqHzfc7dYxloxpJjaDqzR+8XN4f7/tbS4OKXXj8Kgglx7ejvostNYKJSbp93S7rssj6F7Ei67SMkr/WkzVtRrl5qcHIeTtr8ofW+6S/uTWAt/caDHOLOG5AaM1hGBFyFg1DtL7FU2tPzhg 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: <linux-mm.kvack.org> |
Series |
Fixes and cleanups to break_down_buddy_pages in
|
expand
|
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); } }
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(-)