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=-8.2 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,NICE_REPLY_A, SPF_HELO_NONE,SPF_PASS,USER_AGENT_SANE_1 autolearn=ham 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 12A31C432BE for ; Thu, 12 Aug 2021 18:58:07 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 900ED61077 for ; Thu, 12 Aug 2021 18:58:06 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 900ED61077 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 217C18D0003; Thu, 12 Aug 2021 14:58:06 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 1C7488D0001; Thu, 12 Aug 2021 14:58:06 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 0B6398D0003; Thu, 12 Aug 2021 14:58:06 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0165.hostedemail.com [216.40.44.165]) by kanga.kvack.org (Postfix) with ESMTP id E50278D0001 for ; Thu, 12 Aug 2021 14:58:05 -0400 (EDT) Received: from smtpin02.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay02.hostedemail.com (Postfix) with ESMTP id 99345250A4 for ; Thu, 12 Aug 2021 18:58:05 +0000 (UTC) X-FDA: 78467338530.02.AB20E9A Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by imf26.hostedemail.com (Postfix) with ESMTP id 50888200B3B4 for ; Thu, 12 Aug 2021 18:58:05 +0000 (UTC) Received: by mail.kernel.org (Postfix) with ESMTPSA id 236EC61077; Thu, 12 Aug 2021 18:58:04 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1628794684; bh=qInDITMHlKZExB3w3owcOP9e470UVRLbvU7avF4jbl8=; h=Subject:To:Cc:References:From:Date:In-Reply-To:From; b=O8jhfdOWyyaLym8+6X2BZWzwaLe2fLqCOanrK2udvM8aquWfSiWF1pjewgQzxDAPL vQismJEz4AhBVaavdyc5nXhmSUoeJfpekbERnI61osLXV8kY4L9ym+/mgI5b7/jkuJ 2KlU82IYMPi4qgxp8llZFr6q9/qFdcnKKh09kwBSd2V1RhICi+JJjRjBq+bKH2o+DG YRlMFtLaQgn3zV+0Y1oV+DbP32ss8RBc4BGYfyaNkDs0WeyBP0bm7KP6eU3vrByPCh eOEhufPXNMcVr6FWJgSU4yrw/LI0TiX3IUHAMubZ3cnQTn6m20bZGDZhhdrk9aTApN aUW9tGPMQ+Gdg== Subject: Re: [PATCH 09/18] ARC: mm: non-functional code cleanup ahead of 3 levels To: Mike Rapoport Cc: linux-snps-arc@lists.infradead.org, linux-kernel@vger.kernel.org, linux-mm@kvack.org, Anshuman Khandual References: <20210811004258.138075-1-vgupta@kernel.org> <20210811004258.138075-10-vgupta@kernel.org> <7d022d55-c70b-b3ac-4f0b-1faa26c0d4bd@kernel.org> From: Vineet Gupta Message-ID: Date: Thu, 12 Aug 2021 11:58:03 -0700 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.11.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Content-Language: en-US X-Rspamd-Server: rspam03 X-Rspamd-Queue-Id: 50888200B3B4 X-Stat-Signature: 7xqkyts4zgrcwfaj3sonhju3umau4r59 Authentication-Results: imf26.hostedemail.com; dkim=pass header.d=kernel.org header.s=k20201202 header.b=O8jhfdOW; dmarc=pass (policy=none) header.from=kernel.org; spf=pass (imf26.hostedemail.com: domain of vgupta@kernel.org designates 198.145.29.99 as permitted sender) smtp.mailfrom=vgupta@kernel.org X-HE-Tag: 1628794685-920554 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 8/11/21 11:18 PM, Mike Rapoport wrote: > 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 Not needed - those cases are unreal, esoteric at best. I'm working on switching back to canonical struct page based pgtable_t, will do that in v2. >> 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. Sure ! Thx, -Vineet