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 X-Spam-Level: X-Spam-Status: No, score=-6.7 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id DB487C4338F for ; Thu, 12 Aug 2021 06:18:42 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 6BDAB61019 for ; Thu, 12 Aug 2021 06:18:42 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 6BDAB61019 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=kernel.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=kvack.org Received: by kanga.kvack.org (Postfix) id BB0126B006C; Thu, 12 Aug 2021 02:18:41 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id B61AF6B0071; Thu, 12 Aug 2021 02:18:41 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id A4EF58D0001; Thu, 12 Aug 2021 02:18:41 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0179.hostedemail.com [216.40.44.179]) by kanga.kvack.org (Postfix) with ESMTP id 88C106B006C for ; Thu, 12 Aug 2021 02:18:41 -0400 (EDT) Received: from smtpin23.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay04.hostedemail.com (Postfix) with ESMTP id 306B12287D for ; Thu, 12 Aug 2021 06:18:41 +0000 (UTC) X-FDA: 78465424842.23.6ED3573 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by imf08.hostedemail.com (Postfix) with ESMTP id D1ED130064E2 for ; Thu, 12 Aug 2021 06:18:40 +0000 (UTC) Received: by mail.kernel.org (Postfix) with ESMTPSA id 7519560F57; Thu, 12 Aug 2021 06:18:38 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1628749119; bh=SruAedw0pxejnRXjingrcJLTyjDFY9+CyOnUc7yNQmI=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=CFsIWVtNpplZxYYRWthnJL2sIAGAuI8SF/piyN76QRpS8JmdMB0WDhMZZjlzJopzZ Q9yjN04o9z4H7ZklEW5PlUTU9A79tm5HZ2lkk4IwkV6+KEonIxkSbThvjw7ZU4OHG/ C7LlBN+BdaYBJ/uSr6XZFxx3EZb6If5gmsYmVON+GXK3PTqN8wmmgv1ilAtyaI/Ztq M7/MTS1P6X1/ftmcwmilgN8LWbawKEoNpKW2Jv2iv/nfA60xKaQj+RiQPQlgCIiCXv hEgwVW4rqQOmInP35LWKck+fYFkZ0vgg0BUYjG1DwI5jrBuFpkJmsKa7cniIRqXTMp X2e+2Pf60nzHw== Date: Thu, 12 Aug 2021 09:18:34 +0300 From: Mike Rapoport To: Vineet Gupta Cc: linux-snps-arc@lists.infradead.org, linux-kernel@vger.kernel.org, linux-mm@kvack.org, Anshuman Khandual Subject: Re: [PATCH 09/18] ARC: mm: non-functional code cleanup ahead of 3 levels Message-ID: References: <20210811004258.138075-1-vgupta@kernel.org> <20210811004258.138075-10-vgupta@kernel.org> <7d022d55-c70b-b3ac-4f0b-1faa26c0d4bd@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <7d022d55-c70b-b3ac-4f0b-1faa26c0d4bd@kernel.org> X-Rspamd-Queue-Id: D1ED130064E2 Authentication-Results: imf08.hostedemail.com; dkim=pass header.d=kernel.org header.s=k20201202 header.b=CFsIWVtN; dmarc=pass (policy=none) header.from=kernel.org; spf=pass (imf08.hostedemail.com: domain of rppt@kernel.org designates 198.145.29.99 as permitted sender) smtp.mailfrom=rppt@kernel.org X-Rspamd-Server: rspam04 X-Stat-Signature: 8197e8mh8ckzryat8j6dextks5w5rtge X-HE-Tag: 1628749120-267684 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 Wed, Aug 11, 2021 at 06:37:19PM -0700, Vineet Gupta wrote: > On 8/11/21 5:31 AM, Mike Rapoport wrote: > > > +/* > > > + * For ARC, pgtable_t is not struct page *, but pte_t * (to avoid > > > + * extraneous page_address() calculations) hence can't use > > > + * use asm-generic/pgalloc.h which assumes it being struct page * > > > + */ > > Another reason to leave ARC without asm-generic/pgalloc.h was > > __get_order_pte() that other arches don't have. > > So this and pgtable_t aliased to pte_t * seemed to me too much to bother > > then, but probably it's worth reconsidering with addition of 3rd and 4th > > levels. > > I agree that savings of not havign page_address() might not be huge. However > asm-generic/pgalloc.h only has pte allocation routines and all other > allocation levels come from arch file asm-generic/pgalloc.h has allocation routines up to PUD. There is also pgtable_pmd_page_ctor() and pgtable_pmd_page_dtor() called in the generic versions of PMD allocation, it seems they are not called in ARC implementation. So using asm-generic/pgalloc.h would probably save you some THP debugging ;-) We may even probably accommodate multi-page PTEs in asm-generic/pgalloc.h with something like #ifndef __HAVE_ARCH_PTE_GET_ORDER static inline int __pte_get_order(void) { return 0; } #endif > Also for ARCv2, given the arbitrary address split and ensuing paging levels > (as well as support for different page sizes) we will need to make sure that > one page is enough to hold any level's paging using say BUILD_BUG_ON. In > fact that should also be done for 3rd and 4th levels for sanity. Right, these sanity checks would be useful, but they may live in one of .c files in arch/arc/mm. > -Vineet > > -- Sincerely yours, Mike.