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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 861BDECAAA1 for ; Fri, 9 Sep 2022 19:47:46 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230006AbiIITro (ORCPT ); Fri, 9 Sep 2022 15:47:44 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56088 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231128AbiIITrT (ORCPT ); Fri, 9 Sep 2022 15:47:19 -0400 Received: from casper.infradead.org (casper.infradead.org [IPv6:2001:8b0:10b:1236::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1514365570 for ; Fri, 9 Sep 2022 12:45:00 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; h=In-Reply-To:Content-Type:MIME-Version: References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=rH8i5H/nxQpLKKOPnacxADawuH/GKvEdLBuxVQE/TkA=; b=bBuCLNHCiqnCbkeypvuzqK0m/4 xCnerWuTX7pxCLZYif6oH7y0Ax2Fydp7FmMCaXx9P4b4qFK4IqZ6Ioxqa5GRF5IGNrlFEA3ReAOAr ET5rxkRfapYRKBctnHI21OE5FzL2K+Xqg/7FlYR0HdBPcjRl9pp5SaSZed4Jlpv5oMtaz5mBrL+ID pcpl/p3DOYzhavrWV3BGIZOHyPF2HJB+brAgZ6Ko7khejIB7OHeoc4c10Cu3kgqKJDay9B993D4Ko MWF2l+S5KQD9sH09hRrUrBEsxZG/OYFYHRLp9BQBWRXvx8llRz9RM9UVjQaXtAp0rMJuoicvWYOo/ kJNbEdWw==; Received: from willy by casper.infradead.org with local (Exim 4.94.2 #2 (Red Hat Linux)) id 1oWjvo-00DWK7-5c; Fri, 09 Sep 2022 19:44:52 +0000 Date: Fri, 9 Sep 2022 20:44:52 +0100 From: Matthew Wilcox To: David Hildenbrand Cc: Miaohe Lin , akpm@linux-foundation.org, osalvador@suse.de, linux-mm@kvack.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH 12/16] mm/page_alloc: use helper macro SZ_1{K,M} Message-ID: References: <20220909092451.24883-1-linmiaohe@huawei.com> <20220909092451.24883-13-linmiaohe@huawei.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Sep 09, 2022 at 01:34:52PM +0200, David Hildenbrand wrote: > On 09.09.22 11:24, Miaohe Lin wrote: > > @@ -9055,7 +9055,7 @@ void *__init alloc_large_system_hash(const char *tablename, > > /* It isn't necessary when PAGE_SIZE >= 1MB */ > > Huh, how could we ever have that. Smells like dead code. > > > if (PAGE_SHIFT < 20) > > What about adjusting that as well? The it exactly matches the comment > > if (PAGE_SIZE >= SZ_1M) > > > - numentries = round_up(numentries, (1<<20)/PAGE_SIZE); > > + numentries = round_up(numentries, SZ_1M / PAGE_SIZE); The git history provides some clues here. See a7e833182a92. But we do have an architecture which has ... #ifdef CONFIG_PAGE_SIZE_1MB #define PAGE_SHIFT 20 #define HEXAGON_L1_PTE_SIZE __HVM_PDE_S_1MB #endif I don't think it's an especially common config.