From patchwork Wed Aug 3 02:51:21 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Abel Wu X-Patchwork-Id: 12935136 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 4D785C00140 for ; Wed, 3 Aug 2022 02:51:33 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id BB7F68E0002; Tue, 2 Aug 2022 22:51:32 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id B40138E0001; Tue, 2 Aug 2022 22:51:32 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 9E11D8E0002; Tue, 2 Aug 2022 22:51:32 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0014.hostedemail.com [216.40.44.14]) by kanga.kvack.org (Postfix) with ESMTP id 8AFD98E0001 for ; Tue, 2 Aug 2022 22:51:32 -0400 (EDT) Received: from smtpin24.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay08.hostedemail.com (Postfix) with ESMTP id 58063140830 for ; Wed, 3 Aug 2022 02:51:32 +0000 (UTC) X-FDA: 79756755624.24.41E584D Received: from mail-pj1-f52.google.com (mail-pj1-f52.google.com [209.85.216.52]) by imf25.hostedemail.com (Postfix) with ESMTP id 2178CA002E for ; Wed, 3 Aug 2022 02:51:31 +0000 (UTC) Received: by mail-pj1-f52.google.com with SMTP id t2-20020a17090a4e4200b001f21572f3a4so732301pjl.0 for ; Tue, 02 Aug 2022 19:51:30 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bytedance-com.20210112.gappssmtp.com; s=20210112; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=SubjzKtYxDwDh8eAZSjb5LF7LaekSyXiSzaHJbGx46c=; b=0k+LPPDqot9w/ei6bhu8Saf19+jwJhCTiXVlPLOiH/apZc7EFs3Jc+LWVAZKLQqUtC y+zMdBbTj1vycCfeQN1LSjk7sMgFcCtm//nvZ6T8KNJWwAz19dvxAioiNSoj7NGR9pbs UpJkZNpYjowp/VWxNUKWywkbIGgE9KdbRsJqu70co7fJquTjPPUGw5HYby10E/dpDGwG ZkG9oTuCG5VE2yAbA75L3rn1i1hzt8vuJQTcqKin+iOPBMkzwUTWgCCL4k09JXl1eijO DP+088+KezS65c5G80sgmL0p6Z4gbVYCLfoWe8pNYfAVGUkqUGSVvbdGFi0d2oBBh5DA 8ijg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=SubjzKtYxDwDh8eAZSjb5LF7LaekSyXiSzaHJbGx46c=; b=XvHwaAiP/M2SmRQzADFtq3zV156fqSMjHZZ3f8Gfea5yzzPGuCtmy7eeNXQEfKzbHg /w1MMDdX8EJM6zqs/s7wEXIbAec9Q1eOeN2BWNLws2oRXvl7WhMTXA4CrfSEnLPJTMYh /g7R70b+le376jEelkLMVwUUwzU8jSjkPXo+Oi7HG4be2KgQqhlXUDSFLYahAW3chyV8 V2LEIYN5LpzQ58KITO2QEMHXEUOCsOQfxB0r3ns1KEww078TTL/9wB3qhcpN/+sHNDYC peD/1Gn8Ep0ukXeVNkaushF/1uYTL/YGdNDvpzsCPI/0CSh0EfAIuzpJRO2knHJgeJar uWtA== X-Gm-Message-State: ACgBeo0lJclr4Zn1vFB6YsYJmrItwNE/p8gDWpB0IGbm/zt72MPGSkjb SUlPphQwoz4/XZmVkFjCARuYwA== X-Google-Smtp-Source: AA6agR6uAIymTe7SBs7hQLYRkzepfVqH5J0cZPr2b2QFOnfJKDV5zb6tsgX3vckF3HVoYYBWmgo0sg== X-Received: by 2002:a17:902:bd8a:b0:16c:dfcf:38ba with SMTP id q10-20020a170902bd8a00b0016cdfcf38bamr23775277pls.35.1659495089834; Tue, 02 Aug 2022 19:51:29 -0700 (PDT) Received: from C02DV8HUMD6R.bytedance.net ([139.177.225.254]) by smtp.gmail.com with ESMTPSA id n12-20020a170902d2cc00b0016da68b09b3sm444774plc.87.2022.08.02.19.51.26 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Tue, 02 Aug 2022 19:51:29 -0700 (PDT) From: Abel Wu To: Andrew Morton , Vlastimil Babka , Michal Hocko , Mel Gorman , Muchun Song Cc: linux-mm@kvack.org, linux-kernel@vger.kernel.org, Abel Wu Subject: [PATCH] mm/page_alloc: only search higher order when fallback Date: Wed, 3 Aug 2022 10:51:21 +0800 Message-Id: <20220803025121.47018-1-wuyun.abel@bytedance.com> X-Mailer: git-send-email 2.31.1 MIME-Version: 1.0 ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1659495092; 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:references:dkim-signature; bh=SubjzKtYxDwDh8eAZSjb5LF7LaekSyXiSzaHJbGx46c=; b=tZt5aBldYCEUtbgA8AHUgIUm7K0YQewCQv7pXanDnaP2We/mbZgNNiffAjCoOorGwdiPIl b7kabHEH4dvUP2MbqcIXelYKeD7ahMu7pSk64UtEmvG2bwMBKC5SAsOoaVH1Q8xCtnCI29 PC2EFvbRGHvxxBcBEwwgMDnYEZ21qQw= ARC-Authentication-Results: i=1; imf25.hostedemail.com; dkim=pass header.d=bytedance-com.20210112.gappssmtp.com header.s=20210112 header.b=0k+LPPDq; spf=pass (imf25.hostedemail.com: domain of wuyun.abel@bytedance.com designates 209.85.216.52 as permitted sender) smtp.mailfrom=wuyun.abel@bytedance.com; dmarc=pass (policy=none) header.from=bytedance.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1659495092; a=rsa-sha256; cv=none; b=G8khIKahOSJMbr/mc7KM0uDej2ACRCOw14SZF0rNOAboPN28mgX0d85w0td4tLAsQabrwS SFKqaJRhVY3JQOBjkTLFHKAyopwUvBTdYomW07KutpLnXfQNcxOjZ6cF0aE+A/lbUCTL98 mIbXnOOpuIEMecHZwa5HPC2L7QBi+9g= X-Rspam-User: Authentication-Results: imf25.hostedemail.com; dkim=pass header.d=bytedance-com.20210112.gappssmtp.com header.s=20210112 header.b=0k+LPPDq; spf=pass (imf25.hostedemail.com: domain of wuyun.abel@bytedance.com designates 209.85.216.52 as permitted sender) smtp.mailfrom=wuyun.abel@bytedance.com; dmarc=pass (policy=none) header.from=bytedance.com X-Stat-Signature: 3oteyqtoz8ub8okz7edw467kyfo7x1z9 X-Rspamd-Queue-Id: 2178CA002E X-Rspamd-Server: rspam10 X-HE-Tag: 1659495091-813926 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000873, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: It seems unnecessary to search pages with order < alloc_order in fallback allocation. Signed-off-by: Abel Wu Acked-by: Vlastimil Babka Reviewed-by: Muchun Song Acked-by: Mel Gorman --- mm/page_alloc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mm/page_alloc.c b/mm/page_alloc.c index e008a3df0485..0abafc2fc3e0 100644 --- a/mm/page_alloc.c +++ b/mm/page_alloc.c @@ -2934,7 +2934,7 @@ __rmqueue_fallback(struct zone *zone, int order, int start_migratetype, * i.e. orders < pageblock_order. If there are no local zones free, * the zonelists will be reiterated without ALLOC_NOFRAGMENT. */ - if (alloc_flags & ALLOC_NOFRAGMENT) + if (order < pageblock_order && alloc_flags & ALLOC_NOFRAGMENT) min_order = pageblock_order; /*