From patchwork Thu Aug 11 23:16:36 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Zi Yan X-Patchwork-Id: 12941799 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 0BDB4C25B06 for ; Thu, 11 Aug 2022 23:16:56 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 2A4768E0002; Thu, 11 Aug 2022 19:16:50 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 1C0CA8E0006; Thu, 11 Aug 2022 19:16:50 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id CE8818E0002; Thu, 11 Aug 2022 19:16:49 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0010.hostedemail.com [216.40.44.10]) by kanga.kvack.org (Postfix) with ESMTP id B1D8D8E0003 for ; Thu, 11 Aug 2022 19:16:49 -0400 (EDT) Received: from smtpin27.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay08.hostedemail.com (Postfix) with ESMTP id 88E95141921 for ; Thu, 11 Aug 2022 23:16:49 +0000 (UTC) X-FDA: 79788873738.27.866C3B0 Received: from out4-smtp.messagingengine.com (out4-smtp.messagingengine.com [66.111.4.28]) by imf24.hostedemail.com (Postfix) with ESMTP id 0321918006D for ; Thu, 11 Aug 2022 23:16:48 +0000 (UTC) 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 ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1660259809; a=rsa-sha256; cv=none; b=jPJ+zd35TqRBZ70q71afNU+37vJ/kpXf8v5qybKWxWPAVBBG39ngsR8NOxBzsFMpVwGdPH 7+Ba8Ka//eYSn7jr73b9JCWsrlCBzgI8nM9TVbsh+0fDvr4CkhPJwsxGPawVGBQapS9aDL 6sjQpDHpWgxtNx+pZHhpaWfyAmhFUM8= ARC-Authentication-Results: i=1; imf24.hostedemail.com; dkim=pass header.d=sent.com header.s=fm1 header.b="M S7Yo7d"; dkim=pass header.d=messagingengine.com header.s=fm1 header.b=zFmpwpxt; dmarc=pass (policy=none) header.from=sent.com; spf=pass (imf24.hostedemail.com: domain of zi.yan@sent.com designates 66.111.4.28 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=1660259809; 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=h7KvVoFgGWP9FjrKQ1xzyC233beztE1gWDCxy87SIdw=; b=Kp9PK3TnI+Tkcv6FGcEtZHxcz0zGAIWxIeZw5CA6j+dWjsPZGhWjVoWKJFO8tgszNahXbC /r9fVn2aXAWAmkRAU+haM/WBqdSnZnWEIIKx0OBzN/2Jj7iqmVF73WzHYAXRVkn6WrEiUv 8vnt+RdF2mj4V6laigeeKA+OfOy84Oo= X-Rspamd-Server: rspam02 X-Rspamd-Queue-Id: 0321918006D Authentication-Results: imf24.hostedemail.com; dkim=pass header.d=sent.com header.s=fm1 header.b="M S7Yo7d"; dkim=pass header.d=messagingengine.com header.s=fm1 header.b=zFmpwpxt; dmarc=pass (policy=none) header.from=sent.com; spf=pass (imf24.hostedemail.com: domain of zi.yan@sent.com designates 66.111.4.28 as permitted sender) smtp.mailfrom=zi.yan@sent.com X-Stat-Signature: 1secdsytqgui6zdyzj37khpi5oznfbue X-Rspam-User: X-HE-Tag: 1660259808-545700 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 358b871b07ca..2679b2b4c079 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 */