Received: by 2002:a05:6a10:c604:0:0:0:0 with SMTP id y4csp368936pxt; Wed, 11 Aug 2021 23:53:53 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzdlZU6qoE52+ctVbKvVrZvLkUL3+niQtnmJm0QQkaeRSsw41HiqmuymXiDLljg0tjAXzYM X-Received: by 2002:a05:6402:34ce:: with SMTP id w14mr3768059edc.299.1628751233609; Wed, 11 Aug 2021 23:53:53 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1628751233; cv=none; d=google.com; s=arc-20160816; b=vcW3rQo1cyjoHjs1RgxHPYI7HrDFVcXxJuSd64s9qTbWWyCRRo3IGIYyz02ziFFzyW Oj/Fa9QHG6HKihmchGrBsLZJ2rHe2YgkdDcIUYwgTG5Or7pFdSBwHzFTNlGidJGBf2Qe 54/zR3ZLVbfFm4nDjH/7jEamq9BccUUYfFs7qwrJ3CRoHv9/ctPdba020xT87x9jBrbQ 9KoF5R+NWL+8TcrL3d5/68pM8dP2gC5vSC1FXfWSEXVwJI6uyqmRTpFbhQ1bWliCmpdS CcVuS6ViWa+ijqXBm2laiiuExBS1t3rvVc8zYiOTv/xgB/eUMUTgOcyJSFYhdUrE10AY ikaQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=L/yiEJYss6Io5Szv+9rtwo43wwVBMhVhetJG84qi8IU=; b=sxDc3pNz67EJP+KE9xHpVcPL4W+eqfYxDsFPXIvqPPo/3ZYATrhrz7AQoSHs4jQPUl yT3Cgm0nGhFblg0lc2EdiMkzlJxOGIj5TZ9XeYixbvOT5dDsZvZKTYpUR25VMrQDWp33 cwDdeoNwK88GPk3i5GkWk47ngS+24UWtB7Uj0Kvq1INtw2tVJHO2Q2bfqqS86QqhKlc3 UcqZV3I+jmjURgtzjUWMxR2fV1oTQlTafzM7gC0Wx1uYL0wZQn626G3hE55CMSNLktFw yWqW8fuwQmpu9WxrJGCmXRo67493nauEVIm5VOQcNDJRrPVUDXojqdcPlMtuEI6diP9o Ur6A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=CFsIWVtN; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id m4si1693372ejl.583.2021.08.11.23.53.28; Wed, 11 Aug 2021 23:53:53 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=CFsIWVtN; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232985AbhHLGTF (ORCPT + 99 others); Thu, 12 Aug 2021 02:19:05 -0400 Received: from mail.kernel.org ([198.145.29.99]:39640 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232902AbhHLGTE (ORCPT ); Thu, 12 Aug 2021 02:19:04 -0400 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> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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.