Received: by 2002:a05:6359:c8b:b0:c7:702f:21d4 with SMTP id go11csp114540rwb; Wed, 21 Sep 2022 18:34:34 -0700 (PDT) X-Google-Smtp-Source: AMsMyM7bDinNvySf3eNcF5vylcXmgoCRrqPMTqlV+8c+Nk2P4jQXL+9RuJa3GNm8tKd7LrCdhmAM X-Received: by 2002:a05:6402:1a4d:b0:44e:221d:d1dd with SMTP id bf13-20020a0564021a4d00b0044e221dd1ddmr863673edb.267.1663810473962; Wed, 21 Sep 2022 18:34:33 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1663810473; cv=none; d=google.com; s=arc-20160816; b=RIvH54vzMuYdtK/LELXYtZ1es/ToUU3pVj5rOx8pqw9n+Khy/VCXApQqbaBTwyppTA y0RSVComNqf36v4NrhNb4IXDM8Pfmv3f7Xhs3J4hSDpdu9tLWIVO6jN2Tqg7XoSku9vg 7NB9yDIdU6B7n7yeC49hlNe7MoJLVMjsIQ7w9Zz8InTts9qFkuUduGbIl7ZmEbm0Tiv1 nSlXSjb8Bm7l9JruY6V0RMrlbPkTm4+5jWbpYsIXqFklHQ661hQDICi+QUfardXe2t/Y 1iWGM2K6OGwdPGxnJjALdEvlc3RJ6p+YG0MoSbgmzDwc8y0rO3csWAGfzkFdsNfg1Ku+ dorQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version:reply-to :references:in-reply-to:message-id:date:subject:cc:to:from :feedback-id:dkim-signature:dkim-signature; bh=nBAxwy7mmxae2g4ruRqIT/WlkqUizN+JnMmmOsyX9Nw=; b=l+dWD71jGk/57xJRVEPqcw9WkehS95l2Bguai+Fz3yxOim0M7seY8/CaPn4RGbs7FL 0tG3DuOsqijD6Srem+JxEzl4i3OWXf1T4UMPEcTmMBGjC16vPJTytg/Pjn/HLnxMrX4E vYyAaW5LH3xRpbQVxrqHcPLcTv92IBox1rh160aBcnc4ykt3O3uoSrOpReaX7a2R558N zT7zYQNpMwAUDkjU8vMpqrmQokufSU5U9S8QC4gbJDvJRUIqlAU4uWs5RhyoxxZ1Z7JD ItztfgkmzvFZ60lWkwrxoCSl6evOW/K9I+E2HfkkjHaSU9k9sjs7obeGUTTawZmZbTgk RJTg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@sent.com header.s=fm2 header.b=OF+CFPou; dkim=pass header.i=@messagingengine.com header.s=fm2 header.b=Dn0n8KLA; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=sent.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id w9-20020a1709062f8900b0073d8ccd37c2si3256094eji.107.2022.09.21.18.34.08; Wed, 21 Sep 2022 18:34:33 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@sent.com header.s=fm2 header.b=OF+CFPou; dkim=pass header.i=@messagingengine.com header.s=fm2 header.b=Dn0n8KLA; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=sent.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230047AbiIVBNG (ORCPT + 99 others); Wed, 21 Sep 2022 21:13:06 -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 X-Spam-Status: No, score=-2.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM,RCVD_IN_DNSWL_LOW, RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL,SPF_HELO_PASS,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net 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