Message ID | 20230810095309.3109107-4-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 2F8B2C001E0 for <linux-mm@archiver.kernel.org>; Thu, 10 Aug 2023 01:53:11 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 598776B0074; Wed, 9 Aug 2023 21:53:10 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 5489E6B0071; 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 3E9F46B0078; Wed, 9 Aug 2023 21:53:10 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0010.hostedemail.com [216.40.44.10]) by kanga.kvack.org (Postfix) with ESMTP id 1E8046B0071 for <linux-mm@kvack.org>; Wed, 9 Aug 2023 21:53:10 -0400 (EDT) Received: from smtpin06.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay07.hostedemail.com (Postfix) with ESMTP id E354D160282 for <linux-mm@kvack.org>; Thu, 10 Aug 2023 01:53:09 +0000 (UTC) X-FDA: 81106522098.06.691A80E Received: from dggsgout11.his.huawei.com (unknown [45.249.212.51]) by imf13.hostedemail.com (Postfix) with ESMTP id AA5692000F for <linux-mm@kvack.org>; Thu, 10 Aug 2023 01:53:07 +0000 (UTC) Authentication-Results: imf13.hostedemail.com; dkim=none; spf=none (imf13.hostedemail.com: domain of shikemeng@huaweicloud.com has no SPF policy when checking 45.249.212.51) smtp.mailfrom=shikemeng@huaweicloud.com; dmarc=none ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1691632388; a=rsa-sha256; cv=none; b=RUcf50sg4WaOikmIQ8wlshRXT3BtSpr9Jy/G9+IALlvB33gIB4YOokBus4bV+lkAY6t5YO x1qhQ8JCSuYzCq+4p35zQnZdT7l3ynnHL3bVDp4ffBPxMsBeGpfbqYxKV2DL7Mf9r46Lpf BdmzfKRblEWs7bzDXgq28Yydfa8MBDo= ARC-Authentication-Results: i=1; imf13.hostedemail.com; dkim=none; spf=none (imf13.hostedemail.com: domain of shikemeng@huaweicloud.com has no SPF policy when checking 45.249.212.51) 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=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=Leyhi4mhcX+IdG76ZRxKEVXMYP5GGXi6Ta1WvlexVJY=; b=UM5hq14Ur9gWfchmdpNMXJ1mCbvWIwRHk7FRKmzekvDAocFCX3CEzrzTgaJ4KOtuueEnUn SckbKM2xUTNoBsiXzTymSKOwH3P4lQmcXK04LhPqg3iCD6zFSezwGpfdBVcM96Wt5QOACi Z8QjTyW7t1seHG/O9WYJLfOQvBygVL4= Received: from mail02.huawei.com (unknown [172.30.67.143]) by dggsgout11.his.huawei.com (SkyGuard) with ESMTP id 4RLqgy0RlQz4f3mJQ for <linux-mm@kvack.org>; Thu, 10 Aug 2023 09:53:02 +0800 (CST) Received: from huaweicloud.com (unknown [10.175.124.27]) by APP4 (Coremail) with SMTP id gCh0CgCXJ6r8QtRkiaZjAQ--.27199S5; Thu, 10 Aug 2023 09:53:03 +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 3/3] mm/page_alloc: remove unnecessary next_page in break_down_buddy_pages Date: Thu, 10 Aug 2023 17:53:09 +0800 Message-Id: <20230810095309.3109107-4-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--.27199S5 X-Coremail-Antispam: 1UD129KBjvdXoWrZr48Cr17tF4ktryrZrW3Awb_yoWfKrg_Ga n7twnxtFy5KFyxKa17A3WxJrWDXa4F9r4xXF13tr9xAFyDJFnaq3WkXFy5CrZ8ua4ru348 uasxXrW7tr4I9jkaLaAFLSUrUUUUUb8apTn2vfkv8UJUUUU8Yxn0WfASr-VFAUDa7-sFnT 9fnUUIcSsGvfJTRUUUb6AFF20E14v26rWj6s0DM7CY07I20VC2zVCF04k26cxKx2IYs7xG 6rWj6s0DM7CIcVAFz4kK6r1j6r18M280x2IEY4vEnII2IxkI6r1a6r45M28IrcIa0xkI8V A2jI8067AKxVWUWwA2048vs2IY020Ec7CjxVAFwI0_Xr0E3s1l8cAvFVAK0II2c7xJM28C jxkF64kEwVA0rcxSw2x7M28EF7xvwVC0I7IYx2IY67AKxVWDJVCq3wA2z4x0Y4vE2Ix0cI 8IcVCY1x0267AKxVW8Jr0_Cr1UM28EF7xvwVC2z280aVAFwI0_GcCE3s1l84ACjcxK6I8E 87Iv6xkF7I0E14v26rxl6s0DM2AIxVAIcxkEcVAq07x20xvEncxIr21l5I8CrVACY4xI64 kE6c02F40Ex7xfMcIj6xIIjxv20xvE14v26r1j6r18McIj6I8E87Iv67AKxVWUJVW8JwAm 72CE4IkC6x0Yz7v_Jr0_Gr1lF7xvr2IYc2Ij64vIr41lF7I21c0EjII2zVCS5cI20VAGYx C7MxAIw28IcxkI7VAKI48JMxC20s026xCaFVCjc4AY6r1j6r4UMI8I3I0E5I8CrVAFwI0_ Jr0_Jr4lx2IqxVCjr7xvwVAFwI0_JrI_JrWlx4CE17CEb7AF67AKxVWUtVW8ZwCIc40Y0x 0EwIxGrwCI42IY6xIIjxv20xvE14v26r1j6r1xMIIF0xvE2Ix0cI8IcVCY1x0267AKxVW8 JVWxJwCI42IY6xAIw20EY4v20xvaj40_Jr0_JF4lIxAIcVC2z280aVAFwI0_Jr0_Gr1lIx AIcVC2z280aVCY1x0267AKxVW8JVW8JrUvcSsGvfC2KfnxnUUI43ZEXa7sRiyCJDUUUUU= = X-CM-SenderInfo: 5vklyvpphqwq5kxd4v5lfo033gof0z/ X-CFilter-Loop: Reflected X-Rspam-User: X-Rspamd-Server: rspam06 X-Rspamd-Queue-Id: AA5692000F X-Stat-Signature: o57ihx7qbtard34c69jdumbg5stn49bg X-HE-Tag: 1691632387-62123 X-HE-Meta: U2FsdGVkX18z6yBnVV4xp/s24y56FjYOlGODgt8AkDoQ67OMnZwCUATxrq406wpx++RVIHYQlMIdx5qQIYNAYqvvGp8bBB7aL9XrzvzihuyvZWK5paMCGkNX5fAq9qs15+sSI9gkLF8bHKKA5BLdh2kLMVWVjdY8gM8sMawtYNi63z2RV5wb1I4CAd0aE8Unzl90atAQklvX+ulZBcKtpxGMEtVTV9k0iIqV50rDPo9q6hzMVCTUP0LCALpn5isouz1OKBqqvzXFEdttJM87xb+4bmgg6I7U91UyVWcN0tAqi87m8hhJgNqyVkJ0nqEw3Ffr5VGIc8bjZw/vmTkA8RYTvy51C5KwODIWE2syuaRelnCSjNhs0tKDC7v9Nlz87trNrOynhPmj5KUB3TLLK1i/diI8ZYDywBIgJ88hhcigWqeYDawTWlpZlc2NxnwV2rMI7yP5mJrgYKgNCNSAMZhZVntaFHIu66pG9m0eJNkex4ur7c9mW8fmFLqFDIvqgfLeyea/CiMY01RcuV3J5mzl3yKBz34ceuN1ThfZ13lUC0KYKxfOfYEzDvP8o0wMQBk2VLqqUMv+1tgWrb6ZFWNFuKz9I8slg1Vyu8O+QgNeb8uxejuuRJjKDxIukAdKUW8kU0ldY6JsA4JxQ7+DVMv3u0x2oU5Wl2R9MbjtO4PhNq/IPjEISUQ3Ha66GfFEuBCLmqx5xuW0disEyM06rErjFlTTPwmAfiY9mQx5/qeUeD54sOSxXKKMQm4z2uqb6Cjhbv532uClt4xMbTISMRiqOjoKlL5o19vylXIh622XWqkvZImmMaPp3vDtwHqfXCiN9xEt4b410nGtPvGEdhOpTDgoXqWYn+JyKAW/bqTVrIh5P/CXgxFV+WdapMWzZbmrY8x2iVpKzI6ZDgoeY7LkDtQXTIagzYfgVOJmIjREH4CNgg4a20TuqpJiluP1HZEdhzllxsjDvGXWdqg 9KkXB36V gROXKXd5EXoOM7gEAiZYRQ10GIP7eWk0Lz/DUYtUxAcxXOgJyQRnJrKh/bWft6IpHIJodJUuPmQKoSCLxw7QlpYhwiOzlER2QTbpysa5iOddJtiIpUxSnKvYmuA0426gYjc/ZJH4s2i/8nSHRp1Y1CLcycVROXWotChRkZTLJTVoByuQNG+Q6mOX3nPNWbj/RhReBIgBRK8UI/D485UanAaT89wEMNTp8jbTyTY8XDdgyoL9KkXBOVIzGphHkJQ02Tz4H/MRK9nIfAId1ZKXsjZdDXIAmnFrXHZNFyoN9UgQpktienwJ5zDCITbeO4SeusCQh 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 d0b400733031..e884d3fd0d06 100644 --- a/mm/page_alloc.c +++ b/mm/page_alloc.c @@ -6544,20 +6544,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;
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 <shikemeng@huaweicloud.com> --- mm/page_alloc.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-)