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 bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 8CBAAE7849A for ; Mon, 2 Oct 2023 10:15:57 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:In-Reply-To:From:References:Cc:To: Subject:MIME-Version:Date:Message-ID:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=lwXOqi9PJE3MhLUDxXUBL25CW/IRdyquUBtEmDxIUsM=; b=yHCDE/h0bKrv5l F14iu0MDtjYCXF4DTIeiJyTt/vjT+BCwfQt/6jwg2WiEcYumzdsb7Jy+GNWdecXyhJdCPo2O1bdSF uy7IPMK+zNFKTYZ94E/JBYnsLBjRlcLsCoUeLqEKD4NNoQiO8hU9F3X33fLnPIS96bVnck7+nkIVz Bx4w0nR4D64QhUQGbJBpzurE1fUdKeukcKZCY3YJygoGjLtHicfEZHSoZoHLDhBqkDoHhxy8pa93f SD2lc0E6It6JOCPulkApQAoUtIrB6cCWUpP/iQwVPGY8V7Wm0/gZsU2yVtkBx4WkhEBcIHXEk8fLa ZU5kWMFUTj2QCXsbA69g==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1qnFxd-00CIUq-1E; Mon, 02 Oct 2023 10:15:33 +0000 Received: from foss.arm.com ([217.140.110.172]) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1qnFxa-00CITa-0O for linux-arm-kernel@lists.infradead.org; Mon, 02 Oct 2023 10:15:31 +0000 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 52724C15; Mon, 2 Oct 2023 03:16:04 -0700 (PDT) Received: from [10.57.66.79] (unknown [10.57.66.79]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 8A3983F762; Mon, 2 Oct 2023 03:15:22 -0700 (PDT) Message-ID: <3fabc0ed-9f2e-4ad6-ac40-aabdacff1cf2@arm.com> Date: Mon, 2 Oct 2023 11:15:20 +0100 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH v6 4/9] mm: thp: Introduce anon_orders and anon_always_mask sysfs files Content-Language: en-GB To: Andrew Morton Cc: Matthew Wilcox , Yin Fengwei , David Hildenbrand , Yu Zhao , Catalin Marinas , Anshuman Khandual , Yang Shi , "Huang, Ying" , Zi Yan , Luis Chamberlain , Itaru Kitayama , "Kirill A. Shutemov" , John Hubbard , David Rientjes , Vlastimil Babka , Hugh Dickins , linux-mm@kvack.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linuxppc-dev@lists.ozlabs.org References: <20230929114421.3761121-1-ryan.roberts@arm.com> <20230929114421.3761121-5-ryan.roberts@arm.com> <20230929155530.a51e68e03e47a06b6b84c689@linux-foundation.org> From: Ryan Roberts In-Reply-To: <20230929155530.a51e68e03e47a06b6b84c689@linux-foundation.org> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20231002_031530_280443_7B72CDC2 X-CRM114-Status: GOOD ( 26.82 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On 29/09/2023 23:55, Andrew Morton wrote: > On Fri, 29 Sep 2023 12:44:15 +0100 Ryan Roberts wrote: > >> In preparation for adding support for anonymous large folios that are >> smaller than the PMD-size, introduce 2 new sysfs files that will be used >> to control the new behaviours via the transparent_hugepage interface. >> For now, the kernel still only supports PMD-order anonymous THP, so when >> reading back anon_orders, it will reflect that. Therefore there are no >> behavioural changes intended here. > > powerpc strikes again. ARCH=powerpc allmodconfig: > > > In file included from ./include/linux/bits.h:6, > from ./include/linux/ratelimit_types.h:5, > from ./include/linux/printk.h:9, > from ./include/asm-generic/bug.h:22, > from ./arch/powerpc/include/asm/bug.h:116, > from ./include/linux/bug.h:5, > from ./include/linux/mmdebug.h:5, > from ./include/linux/mm.h:6, > from mm/huge_memory.c:8: > ./include/vdso/bits.h:7:33: error: initializer element is not constant > 7 | #define BIT(nr) (UL(1) << (nr)) > | ^ > mm/huge_memory.c:77:47: note: in expansion of macro 'BIT' > 77 | unsigned int huge_anon_orders __read_mostly = BIT(PMD_ORDER); > | ^~~ Ahh my bad, sorry about that - I built various configs and arches but not powerpc. > > We keep tripping over this. I wish there was a way to fix it. > > > > Style whine: an all-caps identifier is supposed to be a constant, > dammit. > > #define PTE_INDEX_SIZE __pte_index_size > > Nope. > > > > I did this: > > --- a/mm/huge_memory.c~mm-thp-introduce-anon_orders-and-anon_always_mask-sysfs-files-fix > +++ a/mm/huge_memory.c > @@ -74,7 +74,7 @@ static unsigned long deferred_split_scan > static atomic_t huge_zero_refcount; > struct page *huge_zero_page __read_mostly; > unsigned long huge_zero_pfn __read_mostly = ~0UL; > -unsigned int huge_anon_orders __read_mostly = BIT(PMD_ORDER); > +unsigned int huge_anon_orders __read_mostly; > static unsigned int huge_anon_always_mask __read_mostly; > > /** > @@ -528,6 +528,9 @@ static int __init hugepage_init_sysfs(st > { > int err; > > + /* powerpc's PMD_ORDER isn't a compile-time constant */ > + huge_anon_orders = BIT(PMD_ORDER); > + > *hugepage_kobj = kobject_create_and_add("transparent_hugepage", mm_kobj); > if (unlikely(!*hugepage_kobj)) { > pr_err("failed to create transparent hugepage kobject\n"); > _ > > > I assume this is set up early enough. Yes this should be fine. > > I don't know why powerpc's PTE_INDEX_SIZE is variable. Hopefully it > has been set up by this time and it won't get altered. Looks that way from the code; its set during early_init_mmu(). Anyway, I'll take the fix into my next spin if I need to do one. I see you've taken it into mm-unstable - thanks! But given I'm introducing UABI, I was expecting some comments and a probably need for a new rev. I'd like to think we are getting there though. Thanks, Ryan _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel