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 6811FC7618E for ; Thu, 16 Mar 2023 23:31:01 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229669AbjCPXa7 (ORCPT ); Thu, 16 Mar 2023 19:30:59 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51800 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229599AbjCPXa5 (ORCPT ); Thu, 16 Mar 2023 19:30:57 -0400 Received: from out4-smtp.messagingengine.com (out4-smtp.messagingengine.com [66.111.4.28]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A1A419E066; Thu, 16 Mar 2023 16:30:56 -0700 (PDT) Received: from compute4.internal (compute4.nyi.internal [10.202.2.44]) by mailout.nyi.internal (Postfix) with ESMTP id EE46D5C0003; Thu, 16 Mar 2023 19:30:55 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute4.internal (MEProxy); Thu, 16 Mar 2023 19:30:55 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=shutemov.name; h=cc:cc:content-type:content-type:date:date:from:from :in-reply-to:in-reply-to:message-id:mime-version:references :reply-to:sender:subject:subject:to:to; s=fm3; t=1679009455; x= 1679095855; bh=mWjnFNvzepxM90lSc+OOQwduG8sRnhr4PdJP/q1hvoQ=; b=C Y7m2Kt2AcPEeMIc9lF8vV7fzv8FuxtG1ugefnXwzUBQd4FEyQX24p0GZfctzEkaJ SCr+lF7u+Edq1Ao2utuvGI1ibzp/YfHTr0vqu418BFfQSmZbnyvpXii0IQrkfx7v N6PISxC8KmfFK7Us8H2CuHkO98BN6pb5CM+liuwgOiY6iUllAGSg1TsVA7dUAHe0 N+jXOUHqEepWaTc/wcRsIwKysEAsRPSwoJaveQs05Rsy6F06CJWYhZH3bD05w4EO Sac/ifu28oaHeqexZgieYwW6M7AOdhyQsPKFJiYDFWBGta9JkDFIfsMr4Nx3A26H 5Ohi5ddr4inW6xmRWuNlA== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-type:content-type:date:date :feedback-id:feedback-id:from:from:in-reply-to:in-reply-to :message-id:mime-version:references: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=1679009455; x=1679095855; bh=mWjnFNvzepxM9 0lSc+OOQwduG8sRnhr4PdJP/q1hvoQ=; b=KiE1iVJ3JifNjDNCeVPeEhzreHnj3 LXVvywWxEhHfyMeQvna8NgxoUudcCQgxRM5G8jpUpFFQwKk4ye7AVc125mzBZdLr 10wa+IXcjBCQZ0JIi6J+loG+u93b4R+7EchczP/kPyPiKoLtstjJQ0vD7vKrV6CJ 9AQuqqPMURqIthmjxRtr2iQ0oPA/qivNRnGPFjR/MC/TQLx630pKNmImDuDE55E2 FjFN3akAfMhoPbGeoUThph6qY4UIviGAFWOr+EGCAm309wGwN9jSCNg4hjnE8vAw ukmyxiskbj1ty2LMnGjPR7xZmoF7sG08dwxUvjp3Pu9kjOe1ZBBdh6GnA== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvhedrvdefuddguddvucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhepfffhvfevuffkfhggtggujgesthdttddttddtvdenucfhrhhomhepfdfmihhr ihhllhcutedrucfuhhhuthgvmhhovhdfuceokhhirhhilhhlsehshhhuthgvmhhovhdrnh grmhgvqeenucggtffrrghtthgvrhhnpefhieeghfdtfeehtdeftdehgfehuddtvdeuheet tddtheejueekjeegueeivdektdenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmh epmhgrihhlfhhrohhmpehkihhrihhllhesshhhuhhtvghmohhvrdhnrghmvg X-ME-Proxy: Feedback-ID: ie3994620:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Thu, 16 Mar 2023 19:30:54 -0400 (EDT) Received: by box.shutemov.name (Postfix, from userid 1000) id 4B65910C9F7; Fri, 17 Mar 2023 02:30:53 +0300 (+03) Date: Fri, 17 Mar 2023 02:30:53 +0300 From: "Kirill A. Shutemov" To: Mike Kravetz , Vineet Gupta Cc: "Kirill A. Shutemov" , Andrew Morton , Mel Gorman , Vlastimil Babka , David Hildenbrand , linux-mm@kvack.org, linux-arch@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH 10/10] mm, treewide: Redefine MAX_ORDER sanely Message-ID: <20230316233053.iwsffmfxzzacnkuy@box.shutemov.name> References: <20230315113133.11326-1-kirill.shutemov@linux.intel.com> <20230315113133.11326-11-kirill.shutemov@linux.intel.com> <20230316181547.GA6211@monkey> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20230316181547.GA6211@monkey> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Mar 16, 2023 at 11:15:47AM -0700, Mike Kravetz wrote: > On 03/15/23 14:31, Kirill A. Shutemov wrote: > > MAX_ORDER currently defined as number of orders page allocator supports: > > user can ask buddy allocator for page order between 0 and MAX_ORDER-1. > > > > This definition is counter-intuitive and lead to number of bugs all over > > the kernel. > > > > Change the definition of MAX_ORDER to be inclusive: the range of orders > > user can ask from buddy allocator is 0..MAX_ORDER now. > > > > --- a/arch/arc/Kconfig > > +++ b/arch/arc/Kconfig > > @@ -556,7 +556,7 @@ endmenu # "ARC Architecture Configuration" > > > > config ARCH_FORCE_MAX_ORDER > > int "Maximum zone order" > > - default "12" if ARC_HUGEPAGE_16M > > - default "11" > > + default "11" if ARC_HUGEPAGE_16M > > + default "10" > > Is this Kconfig file wrong (off by 1) today? It seems like it wants MAX_ORDER > to be sufficiently large to allocate 16M if ARC_HUGEPAGE_16M. So, seems like > it should be 13 today? +Vineet. Hm. I think it is okay as long as CONFIG_ARC_PAGE_SIZE_8K=y which is default, but breaks for other PAGE_SIZE. Looks like ARCH_FORCE_MAX_ORDER calculation should involve selected page size. -- Kiryl Shutsemau / Kirill A. Shutemov