Received: by 2002:a05:6a10:c604:0:0:0:0 with SMTP id y4csp872012pxt; Thu, 5 Aug 2021 13:56:25 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxEI6YaZ/8J8COsNi3wrcGQ7uez1iIivhx2Fij9wLF1iznzw5BSu6kissOONnDU2JhI5A96 X-Received: by 2002:a6b:cc02:: with SMTP id c2mr430174iog.39.1628196985451; Thu, 05 Aug 2021 13:56:25 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1628196985; cv=none; d=google.com; s=arc-20160816; b=hyOVrjC6JDwcbw/AUr6wPRrzjdmPxapdhlKs4xKpUTxaEKveoLsVHUY+YKXQ7cy8TR HBQPq8OODE0qlk7dMJuTFgL2ZAGQMldDCge9/gInmvz/ewI4tWqdSnJOs9vg+A8axn0i kw+8bezWYtSXL4Chp1rJRcFCHB3I4XFcWVArxAjiO2r1P25ukT/sInDqlQSAzIGtAgEb vnFJo/tBBJ2ncd13q+aE425dTZA0+gHojA5USBFd/rp7SYrwpweszzofuGimAig4kEeC Xxurt79RJ82cOZVnaqBwJo7Ns0nZHoYHC0WK+1QdDrjrWwRblfGULAt7GJ3lokFlL72A m+sw== 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 :dkim-signature:dkim-signature; bh=ppy32GVmy6OZkOOejSng3cThhTAJUY99OP+ee8s2A8E=; b=aQG6pA5Oa+7MG2ULLcqZ12TgRntWK9cMUBkPEtjF06cs8eWUJRco/Jcec5wo7OEe2J UY9DZIylqnp7uECnipHGnzpPHnEyZLIxpiJD+OcvBzqA8fWnWNomJGAJpv4O1264VnfB isaPhicrP0lH5ZrvWHvPoUM4din1UV8T1jL7nm39U94orQi62JveZUx+VBD9j5/jICCX weXtC3eSe2aC0yhegnKzmXnf7iqKGXRbORzRF4urya6LxF2uFyuAO5m9vcauT4w7MDjP KLqUTi1BZ34hQcUDFuM3ftlCPUfwziQciwjO5IQ3B9huhUFa8n5V4Z5Z0/7zB3X2i41a rJUA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@sent.com header.s=fm1 header.b="S/XJQV6e"; dkim=pass header.i=@messagingengine.com header.s=fm3 header.b=KJDFjjZV; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 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 vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id z9si7141351jat.41.2021.08.05.13.56.13; Thu, 05 Aug 2021 13:56:25 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@sent.com header.s=fm1 header.b="S/XJQV6e"; dkim=pass header.i=@messagingengine.com header.s=fm3 header.b=KJDFjjZV; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 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 S242089AbhHETEI (ORCPT + 99 others); Thu, 5 Aug 2021 15:04:08 -0400 Received: from new3-smtp.messagingengine.com ([66.111.4.229]:39227 "EHLO new3-smtp.messagingengine.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S242069AbhHETED (ORCPT ); Thu, 5 Aug 2021 15:04:03 -0400 Received: from compute4.internal (compute4.nyi.internal [10.202.2.44]) by mailnew.nyi.internal (Postfix) with ESMTP id 05DDA5810B5; Thu, 5 Aug 2021 15:03:49 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute4.internal (MEProxy); Thu, 05 Aug 2021 15:03:49 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sent.com; h=from :to:cc:subject:date:message-id:in-reply-to:references:reply-to :mime-version:content-transfer-encoding; s=fm1; bh=ppy32GVmy6OZk OOejSng3cThhTAJUY99OP+ee8s2A8E=; b=S/XJQV6eETWl+Cvdsgb1bFI94cbuu y/h6D8K4a90v2BwHExBPeOeC/LyOjL0a5z1tFhq4nQzAgli9WrQULDIy0DolhiVD cbMGHXcvzKugFEZfWnLTGdWPJCGKLNMfRq8mphzsV4+xT7+G9Ij7lD8fbJaWDD2k YNBaicI7S5yFQhsY5fiF7wZKpU8F1eVT4LUJx8sR0JXkx/348nSSifHKZz4hYBUt n41iqv+5lrmr8C1gGfSlSj0pJEZfR6MAFiHV3mfIkK/vX/nt3IoTQcXR0xiiTjfE 7gaAdcGehqF/DSunoObtIL92uu1Xcls32HmNC5UNv5Qe0ash2eIM0Vjrw== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:date:from :in-reply-to:message-id:mime-version:references:reply-to:subject :to:x-me-proxy:x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s= fm3; bh=ppy32GVmy6OZkOOejSng3cThhTAJUY99OP+ee8s2A8E=; b=KJDFjjZV yIOQrCPlG/TJKc5wOfEVskvE0+O33WC52LwAV+KJLw6KATiAK4kCJESSY+wYZx0y Ll5GolCNLMUB///tI6PDTMPOiNXSgkybq+s9pV1snev+0jgNVoALD/LlQugZCYJA wwIgsHmY3DFM6FCMJqzV3U3RBxOiD+YUDJI619NLJGMV4IOGwHeD515XCkD3YbFj LBhX0TitF9X+oU0zlcWSnLcjH6AigIKjV2j8aF3YWmOskD6E7w+pCY+aB6+of+hc HzD5hGti7vYcAjJu3BHUnMEmB5xyZ9WTY2hX+ZAm2EEY1brRjTLGeRP3K73X++Ze 6GQN61lJFdxqaQ== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvtddrieelgdduvdelucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhephffvufffkffojghfrhgggfestdhqredtredttdenucfhrhhomhepkghiucgj rghnuceoiihirdihrghnsehsvghnthdrtghomheqnecuggftrfgrthhtvghrnhepieejue dvueduuefhgefhheeiuedvtedvuefgieegveetueeiueehtdegudehfeelnecuvehluhhs thgvrhfuihiivgeptdenucfrrghrrghmpehmrghilhhfrhhomhepiihirdihrghnsehsvg hnthdrtghomh X-ME-Proxy: Received: by mail.messagingengine.com (Postfix) with ESMTPA; Thu, 5 Aug 2021 15:03:48 -0400 (EDT) From: Zi Yan To: David Hildenbrand , linux-mm@kvack.org Cc: Matthew Wilcox , Vlastimil Babka , "Kirill A . Shutemov" , Mike Kravetz , Michal Hocko , John Hubbard , linux-kernel@vger.kernel.org, Zi Yan , Wei Yang Subject: [RFC PATCH 04/15] mm: prevent pageblock size being larger than section size. Date: Thu, 5 Aug 2021 15:02:42 -0400 Message-Id: <20210805190253.2795604-5-zi.yan@sent.com> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20210805190253.2795604-1-zi.yan@sent.com> References: <20210805190253.2795604-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 973fd731a520..4277b4267767 100644 --- a/include/linux/pageblock-flags.h +++ b/include/linux/pageblock-flags.h @@ -44,8 +44,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-1) +/* + * 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-1)) =20 #endif /* CONFIG_HUGETLB_PAGE */ =20 --=20 2.30.2