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=-11.0 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_AGENT_SANE_1 autolearn=unavailable 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 72775C433B4 for ; Fri, 14 May 2021 11:01:11 +0000 (UTC) Received: from desiato.infradead.org (desiato.infradead.org [90.155.92.199]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 2109B6144F for ; Fri, 14 May 2021 11:01:11 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 2109B6144F Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=arm.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=desiato.20200630; h=Sender:Content-Transfer-Encoding :Content-Type:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References:Message-ID: Subject:Cc:To:From:Date:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=DzzJ6CJ6Z7szqNO9GTHfFTxreqXs6d9GPtkhOAi7LJg=; b=O/HaF7NzeLfIOli+k89kRu9Y6 6xUOq4uqA3IM8uSSQ1zbG+NnQUHKmHc0AhybPuzcLMzkALu8fSVLQTmu7DnGjpg4l8S10I2sL4kFO 46wi19C8MQsUZl/JZPmSFba4Xbx9o+Am5CEsv8tjcg+Gdbx9kuZCf/1z4S1uf9dwEKg7W+qfX3npV VO1nrwrZ2dYmN7pLGHR2tg4vkxEzjASFXX1sWaymH/jdzM8NfkbEyfRrSmk2Fn+N1FLectjASz6iM JnCO1mxbPVaHhnikuzNUM+LzzINkr+fbF35Ra4/M5huDo8gupYrgZTeioqQNBDtmNKEQRsLdSDy8p lw3MQTJIw==; Received: from localhost ([::1] helo=desiato.infradead.org) by desiato.infradead.org with esmtp (Exim 4.94 #2 (Red Hat Linux)) id 1lhVXD-007pVd-CH; Fri, 14 May 2021 10:59:11 +0000 Received: from bombadil.infradead.org ([2607:7c80:54:e::133]) by desiato.infradead.org with esmtps (Exim 4.94 #2 (Red Hat Linux)) id 1lhVXA-007pVV-J0 for linux-arm-kernel@desiato.infradead.org; Fri, 14 May 2021 10:59:08 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20210309; 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=/O0dm8z8xbOkfYNATZT4/76lDaCGiVObRU7gvVi6dL0=; b=FMNzaUM95GhrObH/1tUkggTWon k3dto8N4fI/dRZZ/NeSrbHFYkBqJZGH3LEbGW8PtMplcYo7T/JW9iPmIrrsEw5A1dESJGL5Qv0x19 3aBUSB1Kv7trMakIOy/xYQN2pxF09pSMt3x0pY1DHXpvXhJGOSIZi1Cw8PRve5pcBZD+XO99t0V32 RcPDFltENKBy/fmrLf9AXnmzFRcNfi0vNtaZtkQWkt1vgbFhF4GPfAdKo0oFBpd3uXZUGrjwY3AeG iwmvvNfR5Zg55bCotcBoA761UmkMzIJDiNfauo/1CB0wa9AjDGYwJzKT1PwZnYYOUZGmjWxkMkkR6 0PrqDf0w==; Received: from mail.kernel.org ([198.145.29.99]) by bombadil.infradead.org with esmtps (Exim 4.94 #2 (Red Hat Linux)) id 1lhVX7-00BuvI-Pf for linux-arm-kernel@lists.infradead.org; Fri, 14 May 2021 10:59:07 +0000 Received: by mail.kernel.org (Postfix) with ESMTPSA id 682706143D; Fri, 14 May 2021 10:59:04 +0000 (UTC) Date: Fri, 14 May 2021 11:59:02 +0100 From: Catalin Marinas To: Anshuman Khandual Cc: Mark Rutland , linux-arm-kernel@lists.infradead.org, Will Deacon , linux-kernel@vger.kernel.org Subject: Re: [PATCH] arm64/mm: Remove [PUD|PMD]_TABLE_BIT from [pud|pmd]_bad() Message-ID: <20210514105901.GC855@arm.com> References: <1620644871-26280-1-git-send-email-anshuman.khandual@arm.com> <20210510144337.GA92897@C02TD0UTHF1T.local> <4a36d7b7-6b27-31cc-d701-ebe3c6e4946e@arm.com> <20210511140708.GC8933@C02TD0UTHF1T.local> <8023de56-e6d5-8df0-9920-35fe7dbde640@arm.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <8023de56-e6d5-8df0-9920-35fe7dbde640@arm.com> User-Agent: Mutt/1.10.1 (2018-07-13) X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210514_035905_880465_A2CEE638 X-CRM114-Status: GOOD ( 25.54 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Thu, May 13, 2021 at 10:44:04AM +0530, Anshuman Khandual wrote: > On 5/11/21 7:37 PM, Mark Rutland wrote: > > On Tue, May 11, 2021 at 09:21:46AM +0530, Anshuman Khandual wrote: > >> On 5/10/21 8:13 PM, Mark Rutland wrote: > >>> On Mon, May 10, 2021 at 04:37:51PM +0530, Anshuman Khandual wrote: > >>>> Semantics wise, [pud|pmd]_bad() have always implied that a given [PUD|PMD] > >>>> entry does not have a pointer to the next level page table. This had been > >>>> made clear in the commit a1c76574f345 ("arm64: mm: use *_sect to check for > >>>> section maps"). Hence explicitly check for a table entry rather than just > >>>> testing a single bit. This basically redefines [pud|pmd]_bad() in terms of > >>>> [pud|pmd]_table() making the semantics clear. > >>>> > >>>> Cc: Catalin Marinas > >>>> Cc: Will Deacon > >>>> Cc: Mark Rutland > >>>> Cc: linux-arm-kernel@lists.infradead.org > >>>> Cc: linux-kernel@vger.kernel.org > >>>> Signed-off-by: Anshuman Khandual > >>> > >>> I have no strong feelings either way, so: > >>> > >>> Acked-by: Mark Rutland > >>> > >>> ... that said, I think that the "bad" naming is unclear and misleading, > >>> and it'd be really nice if we could clean that up treewide with > >>> something clearer than "bad". > >> > >> Agreed, the name is misleading. > >> > >>> It does seem that would roughly fit p??_leaf() if we had > >> > >> But what if the platform does not support huge page aka leaf mapping > >> at the given level ? Also a non table i.e bad entry might not always > >> mean a leaf/section/huge page mapping, it could simply imply that the > >> entry is not just pointing to next level and might be just in an bad > >> intermediate or invalid state. > > > > Ah, so that's also covering swap entries, too? It's not entirely clear > > to me what "bad intermediate or invalid state" means, because I assume > > it's not arbitrary junk or this wouldn't be sound genrally. > > Intermediate states like swap, migration or probably even splitting THP. > Though I am not really sure whether pxx_bad() only gets used for valid > table or leaf entries i.e things which are mapped. Hence checking just > for non table entry is better and even safer, than looking out for what > other states the entry could be in. I had a quick look through some of the uses and it seems the expectation is that after a !pmd_bad(), the pmd is a table. The checks for migration, huge page etc. are prior to the pmd_bad() check. For this patch: Acked-by: Catalin Marinas _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel