From patchwork Thu Aug 5 19:02:42 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Zi Yan X-Patchwork-Id: 12421863 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-15.7 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id CC190C43214 for ; Thu, 5 Aug 2021 19:03:53 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 66BD760F01 for ; Thu, 5 Aug 2021 19:03:53 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 66BD760F01 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=sent.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=kvack.org Received: by kanga.kvack.org (Postfix) id 552BD6B0075; Thu, 5 Aug 2021 15:03:50 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 48D3C8D0001; Thu, 5 Aug 2021 15:03:50 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 354F26B007B; Thu, 5 Aug 2021 15:03:50 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0150.hostedemail.com [216.40.44.150]) by kanga.kvack.org (Postfix) with ESMTP id 197B76B0075 for ; Thu, 5 Aug 2021 15:03:50 -0400 (EDT) Received: from smtpin29.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay01.hostedemail.com (Postfix) with ESMTP id BFF981802EFFD for ; Thu, 5 Aug 2021 19:03:49 +0000 (UTC) X-FDA: 78441951378.29.353ABF9 Received: from new3-smtp.messagingengine.com (new3-smtp.messagingengine.com [66.111.4.229]) by imf13.hostedemail.com (Postfix) with ESMTP id 5CD2E10187C4 for ; Thu, 5 Aug 2021 19:03:49 +0000 (UTC) Received: from compute4.internal (compute4.nyi.internal [10.202.2.44]) by mailnew.nyi.internal (Postfix) with ESMTP id 05DDA5810B5; Thu, 5 Aug 2021 15:03:49 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute4.internal (MEProxy); Thu, 05 Aug 2021 15:03:49 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sent.com; h=from :to:cc:subject:date:message-id:in-reply-to:references:reply-to :mime-version:content-transfer-encoding; s=fm1; bh=ppy32GVmy6OZk OOejSng3cThhTAJUY99OP+ee8s2A8E=; b=S/XJQV6eETWl+Cvdsgb1bFI94cbuu y/h6D8K4a90v2BwHExBPeOeC/LyOjL0a5z1tFhq4nQzAgli9WrQULDIy0DolhiVD cbMGHXcvzKugFEZfWnLTGdWPJCGKLNMfRq8mphzsV4+xT7+G9Ij7lD8fbJaWDD2k YNBaicI7S5yFQhsY5fiF7wZKpU8F1eVT4LUJx8sR0JXkx/348nSSifHKZz4hYBUt n41iqv+5lrmr8C1gGfSlSj0pJEZfR6MAFiHV3mfIkK/vX/nt3IoTQcXR0xiiTjfE 7gaAdcGehqF/DSunoObtIL92uu1Xcls32HmNC5UNv5Qe0ash2eIM0Vjrw== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:date:from :in-reply-to:message-id:mime-version:references:reply-to:subject :to:x-me-proxy:x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s= fm3; bh=ppy32GVmy6OZkOOejSng3cThhTAJUY99OP+ee8s2A8E=; b=KJDFjjZV yIOQrCPlG/TJKc5wOfEVskvE0+O33WC52LwAV+KJLw6KATiAK4kCJESSY+wYZx0y Ll5GolCNLMUB///tI6PDTMPOiNXSgkybq+s9pV1snev+0jgNVoALD/LlQugZCYJA wwIgsHmY3DFM6FCMJqzV3U3RBxOiD+YUDJI619NLJGMV4IOGwHeD515XCkD3YbFj LBhX0TitF9X+oU0zlcWSnLcjH6AigIKjV2j8aF3YWmOskD6E7w+pCY+aB6+of+hc HzD5hGti7vYcAjJu3BHUnMEmB5xyZ9WTY2hX+ZAm2EEY1brRjTLGeRP3K73X++Ze 6GQN61lJFdxqaQ== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvtddrieelgdduvdelucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhephffvufffkffojghfrhgggfestdhqredtredttdenucfhrhhomhepkghiucgj rghnuceoiihirdihrghnsehsvghnthdrtghomheqnecuggftrfgrthhtvghrnhepieejue dvueduuefhgefhheeiuedvtedvuefgieegveetueeiueehtdegudehfeelnecuvehluhhs thgvrhfuihiivgeptdenucfrrghrrghmpehmrghilhhfrhhomhepiihirdihrghnsehsvg hnthdrtghomh X-ME-Proxy: Received: by mail.messagingengine.com (Postfix) with ESMTPA; Thu, 5 Aug 2021 15:03:48 -0400 (EDT) From: Zi Yan To: David Hildenbrand , linux-mm@kvack.org Cc: Matthew Wilcox , Vlastimil Babka , "Kirill A . Shutemov" , Mike Kravetz , Michal Hocko , John Hubbard , linux-kernel@vger.kernel.org, Zi Yan , Wei Yang Subject: [RFC PATCH 04/15] mm: prevent pageblock size being larger than section size. Date: Thu, 5 Aug 2021 15:02:42 -0400 Message-Id: <20210805190253.2795604-5-zi.yan@sent.com> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20210805190253.2795604-1-zi.yan@sent.com> References: <20210805190253.2795604-1-zi.yan@sent.com> Reply-To: Zi Yan MIME-Version: 1.0 Authentication-Results: imf13.hostedemail.com; dkim=pass header.d=sent.com header.s=fm1 header.b="S/XJQV6e"; dkim=pass header.d=messagingengine.com header.s=fm3 header.b=KJDFjjZV; spf=pass (imf13.hostedemail.com: domain of zi.yan@sent.com designates 66.111.4.229 as permitted sender) smtp.mailfrom=zi.yan@sent.com; dmarc=pass (policy=none) header.from=sent.com X-Rspamd-Server: rspam05 X-Rspamd-Queue-Id: 5CD2E10187C4 X-Stat-Signature: d5d3bwn9sw9i8xxnifrjtzaagzn83mgs X-HE-Tag: 1628190229-223905 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: From: Zi Yan Only physical pages from a section can be guaranteed to be contiguous and so far a pageblock can only group contiguous physical pages by design. Set pageblock_order properly to prevent pageblock going beyond section size. Signed-off-by: Zi Yan Cc: Wei Yang Cc: Vlastimil Babka Cc: "Matthew Wilcox (Oracle)" Cc: linux-mm@kvack.org Cc: linux-kernel@vger.kernel.org --- include/linux/pageblock-flags.h | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/include/linux/pageblock-flags.h b/include/linux/pageblock-flags.h index 973fd731a520..4277b4267767 100644 --- a/include/linux/pageblock-flags.h +++ b/include/linux/pageblock-flags.h @@ -44,8 +44,11 @@ extern unsigned int pageblock_order; #else /* CONFIG_HUGETLB_PAGE */ -/* If huge pages are not used, group by MAX_ORDER_NR_PAGES */ -#define pageblock_order (MAX_ORDER-1) +/* + * If huge pages are not used, group by MAX_ORDER_NR_PAGES or + * PAGES_PER_SECTION when MAX_ORDER_NR_PAGES is larger. + */ +#define pageblock_order (min(PFN_SECTION_SHIFT, MAX_ORDER-1)) #endif /* CONFIG_HUGETLB_PAGE */