From patchwork Thu Sep 22 01:12:44 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Zi Yan X-Patchwork-Id: 12984356 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 98B89C32771 for ; Thu, 22 Sep 2022 01:13:03 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 0A1718000A; Wed, 21 Sep 2022 21:12:59 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 02A8980007; Wed, 21 Sep 2022 21:12:58 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id D95E48000A; Wed, 21 Sep 2022 21:12:58 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0017.hostedemail.com [216.40.44.17]) by kanga.kvack.org (Postfix) with ESMTP id CAFCB80007 for ; Wed, 21 Sep 2022 21:12:58 -0400 (EDT) Received: from smtpin12.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay08.hostedemail.com (Postfix) with ESMTP id 9F521141340 for ; Thu, 22 Sep 2022 01:12:58 +0000 (UTC) X-FDA: 79937947236.12.6F465E9 Received: from out2-smtp.messagingengine.com (out2-smtp.messagingengine.com [66.111.4.26]) by imf12.hostedemail.com (Postfix) with ESMTP id 54DCC40066 for ; Thu, 22 Sep 2022 01:12:58 +0000 (UTC) Received: from compute3.internal (compute3.nyi.internal [10.202.2.43]) by mailout.nyi.internal (Postfix) with ESMTP id E5FC35C00DC; Wed, 21 Sep 2022 21:12:57 -0400 (EDT) Received: from mailfrontend2 ([10.202.2.163]) by compute3.internal (MEProxy); Wed, 21 Sep 2022 21:12:57 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sent.com; h=cc :cc:content-transfer-encoding:date:date:from:from:in-reply-to :in-reply-to:message-id:mime-version:references:reply-to :reply-to:sender:subject:subject:to:to; s=fm2; t=1663809177; x= 1663895577; bh=nBAxwy7mmxae2g4ruRqIT/WlkqUizN+JnMmmOsyX9Nw=; b=O F+CFPoueSRToSVY24ff+BNtiDFR9srx8WZZbBDeaTKzjrs7eC6/BhuDCAszmbOU8 516R5WZ0C/DfnvJqa2eY3j+yPo5Zy4NfILyraWApldfgRubYrXcGWg9UtH7u66JH m7MbURBBajPXRL6W6FUrBUnnqz8EAYKzrJ0mrkvdXNPqKy2Mg6R308YYI/ECmU4R NuLOUgzIaABnzxvkFoOoZNZerNErJBFvBOjFNVXnziQ5QzhoUzGbxRnPkk8g8MTD khCWSjKYKhoZdRof68nShQsBeGPJ4wDA6B39vvcAc/w6uLePhNble7OBUx7vJ21j ub7eGy3Q46o3h6QNNGt0g== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-transfer-encoding:date:date :feedback-id:feedback-id:from:from:in-reply-to:in-reply-to :message-id:mime-version:references:reply-to:reply-to:sender :subject:subject:to:to:x-me-proxy:x-me-proxy:x-me-sender :x-me-sender:x-sasl-enc; s=fm2; t=1663809177; x=1663895577; bh=n BAxwy7mmxae2g4ruRqIT/WlkqUizN+JnMmmOsyX9Nw=; b=Dn0n8KLAOSyWbD2wa PYpDxYjWEp1fA7VZSNKS/JDLv+UgfQZqKaIHH4DxhKmCkjhx/5yAkXhasoQfA6Ym lQLA185JXhuqGYD0feLJ5JNmTSOimSofFZwpy7THBes232KpXfbilVa9wGztbivE JJsTd3xpE+n8eItJLVqur0tkVh8gWLQwjaSuKYBjOWz422k1krey7FSubEjlOmD2 3AemdmQ84WSMksz6EmJC3fTCEuaKASwsK60CHa/jS+zkvv9DlrWlGe3uiw6P/vKo avJciDxBHEm8Nu7RYCL9r+Wz2QkCRFPgDQNfXoprfY/OhNvkOMVuktqrnjdAQj/+ lNd8Q== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvfedrfeefvddggeefucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhephffvvefufffkofgjfhhrggfgsedtqhertdertddtnecuhfhrohhmpegkihcu jggrnhcuoeiiihdrhigrnhesshgvnhhtrdgtohhmqeenucggtffrrghtthgvrhhnpeegge ehudfgudduvdelheehteegledtteeiveeuhfffveekhfevueefieeijeegvdenucevlhhu shhtvghrufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfhhrohhmpeiiihdrhigrnhessh gvnhhtrdgtohhm X-ME-Proxy: Feedback-ID: iccd040f4:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Wed, 21 Sep 2022 21:12:57 -0400 (EDT) From: Zi Yan To: linux-mm@kvack.org Cc: Zi Yan , David Hildenbrand , Matthew Wilcox , Vlastimil Babka , "Kirill A . Shutemov" , Mike Kravetz , John Hubbard , Yang Shi , David Rientjes , James Houghton , Mike Rapoport , Muchun Song , Andrew Morton , linux-kernel@vger.kernel.org Subject: [PATCH v1 04/12] mm: prevent pageblock size being larger than section size. Date: Wed, 21 Sep 2022 21:12:44 -0400 Message-Id: <20220922011252.2266780-5-zi.yan@sent.com> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20220922011252.2266780-1-zi.yan@sent.com> References: <20220922011252.2266780-1-zi.yan@sent.com> Reply-To: Zi Yan MIME-Version: 1.0 ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1663809178; a=rsa-sha256; cv=none; b=Fj2I1AlZA44mLgoZFUakFWBvC/nts2vp5ks/l2sizG7RQYwdhSzbEixn7HBv0PZ2VJQZud 1MpO5Ez9GFV6HFkrajgVxXgKyztsd1L/DzRBLFYALu4BkWRSP0Qy/5Kn7CJQEERfcjHcg/ /XKoTZbJDJDRZvd6rEhjPe8xZ9wlKiE= ARC-Authentication-Results: i=1; imf12.hostedemail.com; dkim=pass header.d=sent.com header.s=fm2 header.b="O F+CFPo"; dkim=pass header.d=messagingengine.com header.s=fm2 header.b=Dn0n8KLA; dmarc=pass (policy=none) header.from=sent.com; spf=pass (imf12.hostedemail.com: domain of zi.yan@sent.com designates 66.111.4.26 as permitted sender) smtp.mailfrom=zi.yan@sent.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1663809178; h=from:from:sender:reply-to: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:dkim-signature; bh=nBAxwy7mmxae2g4ruRqIT/WlkqUizN+JnMmmOsyX9Nw=; b=lXZ4HyadwyWyyWIyPUOPE7AbvMl7/Dt3MiX1/rIjcZISFh9SmsEAHZQGQsbFfrdUR92mZK I5VbtcbmRFmT2qU1ca6RzsahioQ4QcgsZ7o3QLwcrVC2H7WkcwOysPyrAX5wG7i3LEx3CV fHvToGWgSpnsAE5nKu5ahMSSJusvLbo= X-Stat-Signature: c6egbzgq4omknpd9qp9jko1rfq7uuwuk X-Rspamd-Server: rspam01 X-Rspamd-Queue-Id: 54DCC40066 Authentication-Results: imf12.hostedemail.com; dkim=pass header.d=sent.com header.s=fm2 header.b="O F+CFPo"; dkim=pass header.d=messagingengine.com header.s=fm2 header.b=Dn0n8KLA; dmarc=pass (policy=none) header.from=sent.com; spf=pass (imf12.hostedemail.com: domain of zi.yan@sent.com designates 66.111.4.26 as permitted sender) smtp.mailfrom=zi.yan@sent.com X-Rspam-User: X-HE-Tag: 1663809178-974613 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 e83c4c095041..95589b24fff9 100644 --- a/include/linux/pageblock-flags.h +++ b/include/linux/pageblock-flags.h @@ -47,8 +47,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 +/* + * 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)) #endif /* CONFIG_HUGETLB_PAGE */