From patchwork Wed Sep 27 10:35:13 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kemeng Shi X-Patchwork-Id: 13399827 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 BAC8CE7F150 for ; Wed, 27 Sep 2023 02:51:24 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 053886B00DC; Tue, 26 Sep 2023 22:51:24 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 002AB6B00E4; Tue, 26 Sep 2023 22:51:23 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id DBF4E6B00E6; Tue, 26 Sep 2023 22:51:23 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0015.hostedemail.com [216.40.44.15]) by kanga.kvack.org (Postfix) with ESMTP id C7DC56B00DC for ; Tue, 26 Sep 2023 22:51:23 -0400 (EDT) Received: from smtpin22.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay03.hostedemail.com (Postfix) with ESMTP id 9AA1FA0977 for ; Wed, 27 Sep 2023 02:51:23 +0000 (UTC) X-FDA: 81280851246.22.3F41470 Received: from dggsgout12.his.huawei.com (unknown [45.249.212.56]) by imf27.hostedemail.com (Postfix) with ESMTP id 4FDE940008 for ; Wed, 27 Sep 2023 02:51:19 +0000 (UTC) Authentication-Results: imf27.hostedemail.com; dkim=none; spf=none (imf27.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=1695783081; 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=y2Oy9IbcJAO4TckQw5cyGmXyDb0C603Xo937js6lATQ=; b=gwx1rBFEq+QrwPTptoFMBBRgIms6cRjGC4K9Fb0PKjk7j+FdR/s7Hu6LZgp0mHMIZNOcyq SR6z6sGma9csbea6WTTGj3driWL+9VV8H3E4h/2ik0d8BFEfdkJCT5rdqmMvpxupWxufYS m3G4XN3yMPD4+0FeLAUWkCzJJMvpe8A= ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1695783081; a=rsa-sha256; cv=none; b=UV1zQOWgdmWrnXOWM1vKhG+bsEm1R0ipVMDKehgbNh0kaVZTaAAO7Iu9xnLBLEjWT3v/nd gpIiseu7UfKHmK6zT0jl/rMmvZ0tgYqjvFfm5sq2/CcdifK191fXrqYr7UX4ORVdEs3tkQ lRigZuxsOMKuRejjYyE0Mp+JQ8Rbim8= ARC-Authentication-Results: i=1; imf27.hostedemail.com; dkim=none; spf=none (imf27.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.143]) by dggsgout12.his.huawei.com (SkyGuard) with ESMTP id 4RwLMB2L5hz4f3jsk for ; Wed, 27 Sep 2023 10:35:50 +0800 (CST) Received: from huaweicloud.com (unknown [10.175.124.27]) by APP4 (Coremail) with SMTP id gCh0CgAXqtkIlRNlpd30BQ--.22085S3; Wed, 27 Sep 2023 10:35:54 +0800 (CST) From: Kemeng Shi To: akpm@linux-foundation.org, naoya.horiguchi@nec.com, osalvador@suse.de, willy@infradead.org Cc: linux-mm@kvack.org, linux-kernel@vger.kernel.org Subject: [PATCH v2 1/2] mm/page_alloc: remove unnecessary check in break_down_buddy_pages Date: Wed, 27 Sep 2023 18:35:13 +0800 Message-Id: <20230927103514.98281-2-shikemeng@huaweicloud.com> X-Mailer: git-send-email 2.30.0 In-Reply-To: <20230927103514.98281-1-shikemeng@huaweicloud.com> References: <20230927103514.98281-1-shikemeng@huaweicloud.com> MIME-Version: 1.0 X-CM-TRANSID: gCh0CgAXqtkIlRNlpd30BQ--.22085S3 X-Coremail-Antispam: 1UD129KBjvdXoW7XF4rWr4xXr18KF1UJw4Utwb_yoWDKFX_ua n7trn3tFy5KFyIgF17C3WxGrZ7Ww1F9w1xWw4YgFsxKa4UZ3Zrta1kAF95Jr4Dua95uryD u3ZxtFW2vr1S9jkaLaAFLSUrUUUUUb8apTn2vfkv8UJUUUU8Yxn0WfASr-VFAUDa7-sFnT 9fnUUIcSsGvfJTRUUUbf8YFVCjjxCrM7AC8VAFwI0_Gr0_Xr1l1xkIjI8I6I8E6xAIw20E Y4v20xvaj40_Wr0E3s1l1IIY67AEw4v_Jr0_Jr4l87I20VAvwVAaII0Ic2I_JFv_Gryl82 xGYIkIc2x26280x7IE14v26r18M28IrcIa0xkI8VCY1x0267AKxVWUCVW8JwA2ocxC64kI II0Yj41l84x0c7CEw4AK67xGY2AK021l84ACjcxK6xIIjxv20xvE14v26w1j6s0DM28EF7 xvwVC0I7IYx2IY6xkF7I0E14v26F4UJVW0owA2z4x0Y4vEx4A2jsIE14v26rxl6s0DM28E F7xvwVC2z280aVCY1x0267AKxVW0oVCq3wAS0I0E0xvYzxvE52x082IY62kv0487Mc02F4 0EFcxC0VAKzVAqx4xG6I80ewAv7VC0I7IYx2IY67AKxVWUJVWUGwAv7VC2z280aVAFwI0_ Jr0_Gr1lOx8S6xCaFVCjc4AY6r1j6r4UM4x0Y48IcxkI7VAKI48JMxAIw28IcxkI7VAKI4 8JMxC20s026xCaFVCjc4AY6r1j6r4UMI8I3I0E5I8CrVAFwI0_Jr0_Jr4lx2IqxVCjr7xv wVAFwI0_JrI_JrWlx4CE17CEb7AF67AKxVWUAVWUtwCIc40Y0x0EwIxGrwCI42IY6xIIjx v20xvE14v26r1j6r1xMIIF0xvE2Ix0cI8IcVCY1x0267AKxVW8JVWxJwCI42IY6xAIw20E Y4v20xvaj40_Jr0_JF4lIxAIcVC2z280aVAFwI0_Jr0_Gr1lIxAIcVC2z280aVCY1x0267 AKxVW8JVW8JrUvcSsGvfC2KfnxnUUI43ZEXa7IU0PPEDUUUUU== X-CM-SenderInfo: 5vklyvpphqwq5kxd4v5lfo033gof0z/ X-CFilter-Loop: Reflected X-Rspamd-Queue-Id: 4FDE940008 X-Rspam-User: X-Rspamd-Server: rspam11 X-Stat-Signature: cztt4htqjjfjox5htrqfsyekghnongc5 X-HE-Tag: 1695783079-230627 X-HE-Meta: U2FsdGVkX1+i4lu8zB3cqXmBUbiH1LLRngqoRqvd5fVy5wHnjUPWx5TvSVCDTdf3CPpNABIaFqqOFpOUp4ZUPdBdWRrM42axL142PiI/d2VvYqD3yQ6MysYyj7HiQotfnAx9h2Tl2GlsiLBYug9nYZmErzLBw7G9coogxY/0SeUDwpUFxHGDEydgzMht4GpzkVqmJ25beqURYylEEVC09SE714qc7FsRa/DHQCzFlviIH12vqaCX+U97swnOXlJXzbJtju6ZAA1Oeqff/GSEfFzigfPSOM+v1PpnAc6mg/XchZdWfpx95h6drerCF5iOQ84DZfyp/30MgBNLuRTgQfHZi1A/f/ZMofxFpJ4FCZBYu9eCEXNMs8hJFHBjCXEGNUslSLCQcE0qdsFvl4eyRkh7Dhr4GyCNvxM1dOwr7aDc7jhhhw7VD/0UKohiAuNKS67RtJh8Iblk6ATXQyavwIbWyBK077zLiq4p2UKTy3yFcxqtBirnXJEAkGRCSpdPr9k9k3cY9mPy1xOJ6AU/jcQybJ+/jQnLt8hFocHWE0t9L/w01w3C0MnWSMoOnrPGZgLMfo5Cil5qGVt7xSXs7+2Qb3ZEA3ba7+wUb0XvNNvSjwzIzAykHgzVLIVwLAGKGRPCZvd0PWL7F5iZtsqExfRXZfKAienplo3I+YIAMRIaJfIcvDZs8VBQ0Wmx2Nh8TehQtg7oIWeRAbDMiZCv6xm3Zlg0jCo+2LNaJDM0s3oVkHz4SSHNt5zsT4yTS1vI9dv/HkeDWuISLrhXwW+8MjvSZqfmHTBp8G0nmVWSvRk0k2N0gcngWsDU1jWaiKEyWVN3pPQVtIpb9HNC+UzVYiPuucUQFGcGEWATdrV+PcX9+k8CtKYHTdTU0oSGLYkRo2VUPnQ4JgqnsOY35qesUciD+fwBpBCPFQVTFlU3sCeB+BR3jcz423zk4d038Lj6V8bwv9IQHS0aWVJ2sQ1 BEVLLhU4 Pb9LUaay3/44yVIzmthDQRvTJK6O4whvRGq5/+OQXhLKBYwuIu5nWOHmHIz+DyYQKzWY0unnXuz/UVSivPDsC+UrB40QQ5ZztbLJD5B8KOeFa5Gpc+RtlkfKQ0xmIEJwh2bqaD4kocjgTecY0aHvGQ292hPTOnd3xacllXskijXhpZKsjidPutqdjTIHchn1ZRBETahkFFpKXqEQFU1jU7X71h9vQYikHZVki7cQivOlfvz0j4vTZxQt1fRY8TmVKoOTWjkhkhQXi1+i8FVPSZyyircN5S8dRg9sdp12JWLhOfgiZ82mIy/LTSHEcfeHTLZI99Aa7J8an9Y/NIPeUWnOHjQ== 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: 1. We always have target in range started with next_page and full free range started with current_buddy. 2. The last split range size is 1 << low and low should be >= 0, then size >= 1. So page + size != page is always true (because size > 0). As summary, current_page will not equal to target 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 e18e0e20eff8..bad979493dde 100644 --- a/mm/page_alloc.c +++ b/mm/page_alloc.c @@ -6696,10 +6696,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); } }