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 bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id AA865EB64D9 for ; Wed, 12 Jul 2023 04:02:24 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:In-Reply-To:From:References:Cc:To: Subject:MIME-Version:Date:Message-ID:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=mH/YPmBLWOipIzF7fjnDLAB7cCBtcfcEHwhZt5ECIOE=; b=mfDSAsaF33uht3 OqpqJcVsw79ZhS0JfZ38nOsnSOEgqDmZn5kHb2cVPFpvNYLP7Q4lTLIIQm+SDaUF18MZVNTTLq0zv rHKzhU8vgGiOkm3e7SQTVJ6xBi9ugYmCfPrC//+ccVnTqk+z5qNTdompVyiJ3QeEBrMzLJcf9RS1n xQ2KCJQZaXRDEu/8qty1T5uq5NR+X0EuLhz0378b7lqg0ttrahcOKceddzXGb3NbeITjf8+YHBvTK +qiFV1MbtSmlpZeDMe6Q7uiJwFV5e8rJYF8GP71BMIZ3pxrokgpdvK6r2y0CyYiq2JTY2Fz8ppbsR zthfur6NLJ/PP0zazitw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1qJR33-00GS9k-1c; Wed, 12 Jul 2023 04:01:53 +0000 Received: from foss.arm.com ([217.140.110.172]) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1qJR31-00GS8R-0Q for linux-arm-kernel@lists.infradead.org; Wed, 12 Jul 2023 04:01:52 +0000 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 8F5B32F4; Tue, 11 Jul 2023 21:02:27 -0700 (PDT) Received: from [10.162.42.6] (unknown [10.162.42.6]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 22DE73F740; Tue, 11 Jul 2023 21:01:41 -0700 (PDT) Message-ID: <8a7416df-1656-8380-9a42-1af3cd940f97@arm.com> Date: Wed, 12 Jul 2023 09:31:39 +0530 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.11.0 Subject: Re: [RFC 0/4] arm64/mm: Clean up pte_dirty() state management Content-Language: en-US To: Mark Rutland Cc: linux-arm-kernel@lists.infradead.org, Catalin Marinas , Will Deacon , Ryan Roberts , Andrew Morton , David Hildenbrand , Jonathan Corbet , linux-kernel@vger.kernel.org, linux-doc@vger.kernel.org References: <20230707053331.510041-1-anshuman.khandual@arm.com> From: Anshuman Khandual In-Reply-To: X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230711_210151_214767_C4A8AF3A X-CRM114-Status: GOOD ( 20.95 ) 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 7/10/23 16:55, Mark Rutland wrote: > On Fri, Jul 07, 2023 at 11:03:27AM +0530, Anshuman Khandual wrote: >> These pte_dirty() changes make things explicitly clear, while improving the >> code readability. This optimizes HW dirty state transfer into SW dirty bit. >> This also adds a new arm64 documentation explaining overall pte dirty state >> management in detail. This series applies on the latest mainline kernel. > TBH, I think this is all swings and roundabouts, and I'm not sure this is > worthwhile. I appreciate that as-is some people find this confusing, but I Current situation for pte_dirty() management is confusing when there are two distinct mechanisms to track PTE dirty states, but both are forced to work together because - HW DBM cannot track non-writable dirty state (PTE_DBM == PTE_WRITE) - Runtime check for HW DBM is avoided > don't think the end result of this series is actually better, and it adds more > code/documentation to maintain. Agreed, it does add more code and documentation but still trying to understand why it is not worthwhile. Regardless, following patch does optimize a situation where we dont need to call pte_mkdirty() knowing it will be cleared afterwards. [RFC 2/4] arm64/mm: Call pte_sw_mkdirty() while preserving the HW dirty state > > In particular, I don't think that we should add Documentation/ files for this, > as it's very likely that won't be updated together with the code, and I think > it's more of a maintenance burden than a help. If we want some introductory There are many documentation files such as Documentation/arm64/memory.rst which needs to be updated when kernel virtual address layout changes again. I am just wondering - should not there be any documentation for internal implementation details, just because they need updating with code changes. > text to explain how the HW/SW dirty bits work, I think that should be a comment > block in , clearly associated with the code. Sure, will add that. > > Overall, I'd prefer to leave the code as-is. Even if we discount individual dirty clearing functions, why should not HW dirty bit transfer to SW dirty be optimized and wrapped around in a helper. _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel