From patchwork Sat Aug 26 15:47:44 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kemeng Shi X-Patchwork-Id: 13366519 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 D48BFC83F01 for ; Sat, 26 Aug 2023 07:48:09 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 417D02800E8; Sat, 26 Aug 2023 03:48:07 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 3C63A2800E4; Sat, 26 Aug 2023 03:48:07 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 269C92800E8; Sat, 26 Aug 2023 03:48:07 -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 1053D2800E4 for ; Sat, 26 Aug 2023 03:48:07 -0400 (EDT) Received: from smtpin06.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay09.hostedemail.com (Postfix) with ESMTP id CADFE8013F for ; Sat, 26 Aug 2023 07:48:06 +0000 (UTC) X-FDA: 81165477372.06.4DAA04B Received: from dggsgout11.his.huawei.com (dggsgout11.his.huawei.com [45.249.212.51]) by imf06.hostedemail.com (Postfix) with ESMTP id 38E18180006 for ; Sat, 26 Aug 2023 07:48:02 +0000 (UTC) Authentication-Results: imf06.hostedemail.com; dkim=none; dmarc=none; spf=none (imf06.hostedemail.com: domain of shikemeng@huaweicloud.com has no SPF policy when checking 45.249.212.51) smtp.mailfrom=shikemeng@huaweicloud.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1693036084; 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=ffFDmTA/1hpgDYhGzWoNjF7iO2kil+aXv7b+KABxJ3w=; b=3ysltPbZaJdyUd4gqIcZ8O3Nuyhx2/RMMglg2JwEQ2BKBLhBj7rnAj+9gtvUKr5X7LqbYF 1naYTAnt1g4hB+AG/cTD9pXOXQnyDTFFBJLLHWKy3+B0p1VF9xPIJLpvhKSFhasJFcdtp2 8nEAFgD30wpVCXzSoQBJyr/lOSfg2no= ARC-Authentication-Results: i=1; imf06.hostedemail.com; dkim=none; dmarc=none; spf=none (imf06.hostedemail.com: domain of shikemeng@huaweicloud.com has no SPF policy when checking 45.249.212.51) smtp.mailfrom=shikemeng@huaweicloud.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1693036084; a=rsa-sha256; cv=none; b=iUSMzyKPn8aDzrB/WZ8mv+3pmQGU2ZPME70/5Td8r+gH+OOBAlcMiMIa+B9Jkod1GgNSrP rIroCqUvJRP+QsNmtVWguHyrIBat+0etWxO+hcTfGCZ8SzD418CJBRrnR3NBrVwphlH5gL ECCVwkj5XMOH/rP6DdzbYp0vu6Y4aSc= Received: from mail02.huawei.com (unknown [172.30.67.169]) by dggsgout11.his.huawei.com (SkyGuard) with ESMTP id 4RXpp62N8Lz4f3jZd for ; Sat, 26 Aug 2023 15:47:58 +0800 (CST) Received: from huaweicloud.com (unknown [10.175.124.27]) by APP4 (Coremail) with SMTP id gCh0CgB3B6osrulk6+l0Bg--.52079S4; Sat, 26 Aug 2023 15:47:58 +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 2/3] mm/page_alloc: remove unnecessary check in break_down_buddy_pages Date: Sat, 26 Aug 2023 23:47:44 +0800 Message-Id: <20230826154745.4019371-3-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--.52079S4 X-Coremail-Antispam: 1UD129KBjvdXoW7XF4rWr48Kr18Wr1rWw1xZrb_yoWDAFb_ua n7trn5tFyUKF17KF17C3W7GrWkWw1F9w4xWr4YgF43Ka4UAFn0yan5XFyrJr1Duay8ur98 u3ZxZrW2qr1a9jkaLaAFLSUrUUUUUb8apTn2vfkv8UJUUUU8Yxn0WfASr-VFAUDa7-sFnT 9fnUUIcSsGvfJTRUUUbfkYFVCjjxCrM7AC8VAFwI0_Xr0_Wr1l1xkIjI8I6I8E6xAIw20E Y4v20xvaj40_Wr0E3s1l1IIY67AEw4v_Jr0_Jr4l87I20VAvwVAaII0Ic2I_JFv_Gryl82 xGYIkIc2x26280x7IE14v26r15M28IrcIa0xkI8VCY1x0267AKxVW8JVW5JwA2ocxC64kI II0Yj41l84x0c7CEw4AK67xGY2AK021l84ACjcxK6xIIjxv20xvE14v26F1j6w1UM28EF7 xvwVC0I7IYx2IY6xkF7I0E14v26r4UJVWxJr1l84ACjcxK6I8E87Iv67AKxVW0oVCq3wA2 z4x0Y4vEx4A2jsIEc7CjxVAFwI0_GcCE3s1le2I262IYc4CY6c8Ij28IcVAaY2xG8wAqx4 xG64xvF2IEw4CE5I8CrVC2j2WlYx0E2Ix0cI8IcVAFwI0_JrI_JrylYx0Ex4A2jsIE14v2 6r1j6r4UMcvjeVCFs4IE7xkEbVWUJVW8JwACjcxG0xvY0x0EwIxGrwCF04k20xvY0x0EwI xGrwCFx2IqxVCFs4IE7xkEbVWUJVW8JwC20s026c02F40E14v26r1j6r18MI8I3I0E7480 Y4vE14v26r106r1rMI8E67AF67kF1VAFwI0_JF0_Jw1lIxkGc2Ij64vIr41lIxAIcVC0I7 IYx2IY67AKxVW8JVW5JwCI42IY6xIIjxv20xvEc7CjxVAFwI0_Cr0_Gr1UMIIF0xvE42xK 8VAvwI8IcIk0rVWUJVWUCwCI42IY6I8E87Iv67AKxVW8JVWxJwCI42IY6I8E87Iv6xkF7I 0E14v26r4j6r4UJbIYCTnIWIevJa73UjIFyTuYvjxUVHGHUUUUU X-CM-SenderInfo: 5vklyvpphqwq5kxd4v5lfo033gof0z/ X-CFilter-Loop: Reflected X-Rspamd-Queue-Id: 38E18180006 X-Rspam-User: X-Rspamd-Server: rspam02 X-Stat-Signature: ptfnh9xeq5ck1ssq14345poczujh5ahs X-HE-Tag: 1693036082-503787 X-HE-Meta: U2FsdGVkX19iBrPo+rWnvCMVy33q2dt6vs2J4KP6VBhZDpgPJ69RMAG9ZHAfyVkztpSSnk269mhGMr1M3obzHaNzx1yIW+z7Mn/kMfSvnuFzTXIAaW/mc0w32S5qIOLNS3e5v/uAGLdjW1DxZYhF3ZZb2JXq/soQwQo9gqx9/sZlXHGUbcNRBAmLWKB4QYXPDqxJCpmyfzH5di0MADT0YZ1p38oAvUGhbhQzfohoKu2VZFtizBKByrrtSDAX1T/4fVXxkOUYHDA3x8DfFwIJ9PM64rGvBwvpMu17U8w+tDex48KXvcpdFndvHP013/Vn2coNSg3yNpe1ZG9J26+6+kWsa0NHE/0NumtDHdni4/SHbPfxxwfeXyyi+mE8h1lplLR+NDbxs32GctvOyeu9Ga/2auXSmXs6c80Jrr9httTQvXHSzO7sJUTpkYjiAZU2AkEehZbThfOCdh1lz/DWeONMjnZUq/sovc734EgJjxb38BRQ+xiktQ4TgStI66ZxjBjhKV+2eg1JgFSYuN/UpJVXZSIeI2Sk5hfBufXY+2Hr10h610VzIKQzKZ090mvpxmQw/9PEKrpu2M+4i6y8fJskT04Rs69YbYVi6VJeWWeJ0Nnnnv0rdXYt2KrThYuvwBsXEyEjoICsodBb8A0XY/TbQmnCXvUD4tsAxtlOo/djGIsjYwep5VTWGX5vW2c85HXTyvwqyZnDZFpztdtneIGnwdn9Fgzp0CWcycYIsdtd+vAGzncuuVH7hNw2/IglNxz6pCY7H90RDLWc+VgFoBZ+5CVWJtQf3va/dL1IE1xQ0qBamIIJU2X3a+cY+PAThTrgO3iptVJvq0nIf9Jpulu69ze5WVh6//pesICnNc0cGQglb9eLurHw+hxlAOfqMK84skFBE8KPX6Pg6TsZC+nPjzinjkIAnJArDCYfjr4Wma8HDBlD4KHw98cFbG08XeSyYi6TymTfoDVqtkG uERskICa xX/ENthnZ74cjqYIWGY3xXLLn2ohiKfRP1u9eMYAWqnXHNxaKEkM4EnFLaPaaeAzCaHlMhVjMyy5JR6aauadOFadAbRW8dDA15OfAX/D1bWbD3hgYYQpGjmbjH5k6+UT897kwZGafKhzltzYTC7xIaagv6cDxrc+ueBWpztRGEPcMjNAci/rP/LsRqBLMPcitoaAbd3MqKSXPns9Dq19OaWcnLZ+UaM77nBQBdmjdOxuUcGS7aSEHBoNZeHIRnGjQkNftrR1sKLc7eXI= 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 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 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 88c5f5aea9b0..bb74b40dc195 100644 --- a/mm/page_alloc.c +++ b/mm/page_alloc.c @@ -6510,10 +6510,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); } }