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 kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id 7FEF1ECAAD3 for ; Fri, 9 Sep 2022 19:44:59 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 0752B8D0002; Fri, 9 Sep 2022 15:44:59 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 0247C8D0001; Fri, 9 Sep 2022 15:44:58 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id E56398D0002; Fri, 9 Sep 2022 15:44:58 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0016.hostedemail.com [216.40.44.16]) by kanga.kvack.org (Postfix) with ESMTP id D30358D0001 for ; Fri, 9 Sep 2022 15:44:58 -0400 (EDT) Received: from smtpin25.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay06.hostedemail.com (Postfix) with ESMTP id A3E3CAB6EB for ; Fri, 9 Sep 2022 19:44:58 +0000 (UTC) X-FDA: 79893575076.25.8248AD7 Received: from casper.infradead.org (casper.infradead.org [90.155.50.34]) by imf17.hostedemail.com (Postfix) with ESMTP id 3C07D40087 for ; Fri, 9 Sep 2022 19:44:58 +0000 (UTC) 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: ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1662752698; a=rsa-sha256; cv=none; b=3nSSd4YiPB7rjvf0dNAXXX/5Z6RUde4uEtQPJfGfg95PeEijGw4acub3+bJPR5MrOpOLPg JXsOHizf2YE8Sy3xBN1wtfmXCEMf0nYu4iopyVReYr2Ve3Too0tdadzX2ljiGUb/haHYwl iQZgqpd0Wcq/7gIvRlLdf+rgl2eij1Y= ARC-Authentication-Results: i=1; imf17.hostedemail.com; dkim=pass header.d=infradead.org header.s=casper.20170209 header.b=bBuCLNHC; dmarc=none; spf=none (imf17.hostedemail.com: domain of willy@infradead.org has no SPF policy when checking 90.155.50.34) smtp.mailfrom=willy@infradead.org ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1662752698; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=rH8i5H/nxQpLKKOPnacxADawuH/GKvEdLBuxVQE/TkA=; b=RCS9RqvWLmpcN+IQdwW0IvrW8q3Hz8KCJe8hZJj0CQ4aFWAqc4rArasjZ/k5jaK1pB84Hi CsSEuzDwgvnMM4LObhZmv97wXr61GMBB+WWs23lRN5l+aFpBuNb53PqM0xrHOwN2cNfZj6 V8QqVzmkMTMWugazTz9vSF9NzTwe4Vk= Authentication-Results: imf17.hostedemail.com; dkim=pass header.d=infradead.org header.s=casper.20170209 header.b=bBuCLNHC; dmarc=none; spf=none (imf17.hostedemail.com: domain of willy@infradead.org has no SPF policy when checking 90.155.50.34) smtp.mailfrom=willy@infradead.org X-Rspam-User: X-Rspamd-Queue-Id: 3C07D40087 X-Rspamd-Server: rspam11 X-Stat-Signature: o1agpiuwfq6oqj51npdmfnpoqewme571 X-HE-Tag: 1662752698-438709 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: 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.