From mboxrd@z Thu Jan 1 00:00:00 1970 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id BBFC4C6FA90 for ; Thu, 22 Sep 2022 01:13:10 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230024AbiIVBNH (ORCPT ); Wed, 21 Sep 2022 21:13:07 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56780 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229678AbiIVBNA (ORCPT ); Wed, 21 Sep 2022 21:13:00 -0400 Received: from out2-smtp.messagingengine.com (out2-smtp.messagingengine.com [66.111.4.26]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 86865AA36A for ; Wed, 21 Sep 2022 18:12:58 -0700 (PDT) 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 Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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-flag= s.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; =20 #else /* CONFIG_HUGETLB_PAGE */ =20 -/* 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)) =20 #endif /* CONFIG_HUGETLB_PAGE */ =20 --=20 2.35.1