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 DC482C25B06 for ; Thu, 11 Aug 2022 23:17:22 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236468AbiHKXRT (ORCPT ); Thu, 11 Aug 2022 19:17:19 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48884 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236049AbiHKXQv (ORCPT ); Thu, 11 Aug 2022 19:16:51 -0400 Received: from out4-smtp.messagingengine.com (out4-smtp.messagingengine.com [66.111.4.28]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 90F57A1A47 for ; Thu, 11 Aug 2022 16:16:49 -0700 (PDT) Received: from compute2.internal (compute2.nyi.internal [10.202.2.46]) by mailout.nyi.internal (Postfix) with ESMTP id A85585C016A; Thu, 11 Aug 2022 19:16:48 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute2.internal (MEProxy); Thu, 11 Aug 2022 19:16:48 -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=fm1; t=1660259808; x= 1660346208; bh=h7KvVoFgGWP9FjrKQ1xzyC233beztE1gWDCxy87SIdw=; b=M S7Yo7dRKmxYgBaUAIPZt6K1dzK+mkREVRbiFyc33eCtEKxHMAai/dK4sMQgi/KjQ aSuIPaMDagxyUtNK0nqGqkrtzmvgCvNUYQ+Ty5dssjYJzuqJ149DqvxG02cJ4vFr uqSAmpried/ZVC7Mu+yt6ogLuOjAauEh2X9vk/PkStbTcwMh2bYhoq1RMYAnXKgs xzMuYU7VzOiiGlNASVJ+xpKEyegvuvVK1o4Hbcy4yJWJCGMFacbYEANSgS58xiSp f1cKkCwWfl7XeViuc9c6zjUAxfqThqGARJngxcJ85V8LZNEZ1IFEqKmQyYj4t5V9 1lNqLh6HH5Dozbu1ZuOIg== 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=fm1; t=1660259808; x=1660346208; bh=h 7KvVoFgGWP9FjrKQ1xzyC233beztE1gWDCxy87SIdw=; b=zFmpwpxtxD4EJ/NJ4 iy8+P15+cNAjsKn2vaINhpPO/H5BsFI5QldjHbAA4r7RcpFo88NQrDPt9JVxI5h9 T+yynq60tigfn/M7vXfcCX+u+ps4+SOcoQMs55ZL9+K+qTbn0pCrKDkRamV2pFvK I6eqhqGfcUY7/dQFj1AXb9NAva2zrAfgA47oVmC9IKitjHBje0i9zWH579hb6wkz G9WSzKhMfKrMoJ1GMIbIm332W1nv1cnk0WDtz9NBHVRegRgsaBf+fFbYG5iIC3bM mDepKmzGm06FfWMu7vMFbGo4V6UU/y2FEi4o8y7a8GlO2ZmFKe3aSeMUsfsjKRCV uAALA== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvfedrvdeghedgvddtucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhephffvvefufffkofgjfhhrggfgsedtqhertdertddtnecuhfhrohhmpegkihcu jggrnhcuoeiiihdrhigrnhesshgvnhhtrdgtohhmqeenucggtffrrghtthgvrhhnpeegge ehudfgudduvdelheehteegledtteeiveeuhfffveekhfevueefieeijeegvdenucevlhhu shhtvghrufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfhhrohhmpeiiihdrhigrnhessh gvnhhtrdgtohhm X-ME-Proxy: Feedback-ID: iccd040f4:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Thu, 11 Aug 2022 19:16:48 -0400 (EDT) From: Zi Yan To: linux-mm@kvack.org Cc: David Hildenbrand , Matthew Wilcox , Vlastimil Babka , "Kirill A . Shutemov" , Mike Kravetz , John Hubbard , Yang Shi , David Rientjes , James Houghton , Mike Rapoport , linux-kernel@vger.kernel.org Subject: [RFC PATCH v2 05/12] mm: prevent pageblock size being larger than section size. Date: Thu, 11 Aug 2022 19:16:36 -0400 Message-Id: <20220811231643.1012912-6-zi.yan@sent.com> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20220811231643.1012912-1-zi.yan@sent.com> References: <20220811231643.1012912-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 358b871b07ca..2679b2b4c079 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