From patchwork Fri Jul 7 05:33:27 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Anshuman Khandual X-Patchwork-Id: 11725 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:9f45:0:b0:3ea:f831:8777 with SMTP id v5csp3039602vqx; Thu, 6 Jul 2023 22:37:13 -0700 (PDT) X-Google-Smtp-Source: APBJJlG1nXjNFNriWSK5lYILoe12WWXfVKGlzSXeV5F3DNWUiZynPZZSMdpfSmUuuk391KIjevq7 X-Received: by 2002:a05:6358:2609:b0:134:c37f:4b60 with SMTP id l9-20020a056358260900b00134c37f4b60mr4305424rwc.32.1688708232977; Thu, 06 Jul 2023 22:37:12 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1688708232; cv=none; d=google.com; s=arc-20160816; b=v4CCIhL/cJ9Iorf4TlSL7v4mTzhtyZ84CFjk/eYpZ9wqCnxgnuQWGqXryZYA4rZ1Bf W+wXpjFF0rN1jTHodCapDoMiCKiRYlNj4bz7O4uCbgjpwvfV0V4ijjkSz9liVD+GzElT nDKIyGXQsudr2fx1jMboybdqGGoVjp9ShYiBM9ZWGsBrVjlfzh1nH56sGc5be7fKPjeE mLanmKhxWgaXgQPZhYh4NpQ+GPAFaxmTro7EWyBwMEBGlQQntHiY7H/hxRHUls+qH+dU A0tAt+sCcZ2V0jM0izhXQXM/6+cwUJNfZ7lnqdkUoKdp8xJTzsXk3Z531zitZH1FA2CE LsLg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from; bh=Ila06ZoIudNWB24oRchymB+LfcgWr1qsLdSzszmFK/k=; fh=v8WkW07D8QHzh6geYHFbL/t66J83/bx/yAuOgJXvUtg=; b=E2H32ld8h7eERxL5lbAIMTUbB/LsLI3ldOXdL2aw7feqKqgkbPZ8zQiRVOhg4/SnrD baKK8vNnynlnlWuUfxufU/7NG8yFqWdrGqTQMf73+XbaTBAPWfDmzxpSokFYpIncj9v8 VMD3E2WOleExuhwzLpWB92P8Wq4ChXzO1xaHzeNTFtHylISekvWpAHLj/jrWRC7bkCvI cdADnqNnK3/YzZ65ZoGEajt8vlbTJtUV6FguCjykicpbH2QLIYmYs2/b0F8MlCfIRsLw K+bsbZ3frgQqJ2hTsFiVcoJmnCIE8QtY+AYJscQLnqdjXD6y+ClgUOqve6eF9XR/vZYL P6JQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id n7-20020a6543c7000000b0053b8874ceddsi1140615pgp.148.2023.07.06.22.37.00; Thu, 06 Jul 2023 22:37:12 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230022AbjGGFds (ORCPT + 99 others); Fri, 7 Jul 2023 01:33:48 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47298 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229529AbjGGFdq (ORCPT ); Fri, 7 Jul 2023 01:33:46 -0400 Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 86EBA171D; Thu, 6 Jul 2023 22:33:44 -0700 (PDT) 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 DE846D75; Thu, 6 Jul 2023 22:34:25 -0700 (PDT) Received: from a077893.arm.com (unknown [10.163.48.50]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPA id 2B8CE3F740; Thu, 6 Jul 2023 22:33:38 -0700 (PDT) From: Anshuman Khandual To: linux-arm-kernel@lists.infradead.org Cc: Anshuman Khandual , Catalin Marinas , Will Deacon , Ryan Roberts , Mark Rutland , Andrew Morton , David Hildenbrand , Jonathan Corbet , linux-kernel@vger.kernel.org, linux-doc@vger.kernel.org Subject: [RFC 0/4] arm64/mm: Clean up pte_dirty() state management Date: Fri, 7 Jul 2023 11:03:27 +0530 Message-Id: <20230707053331.510041-1-anshuman.khandual@arm.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 X-Spam-Status: No, score=-4.2 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_MED, SPF_HELO_NONE,SPF_NONE,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1770738923964447983?= X-GMAIL-MSGID: =?utf-8?q?1770738923964447983?= 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. Cc: Catalin Marinas Cc: Will Deacon Cc: Ryan Roberts Cc: Mark Rutland Cc: Andrew Morton Cc: David Hildenbrand Cc: Jonathan Corbet Cc: linux-arm-kernel@lists.infradead.org Cc: linux-kernel@vger.kernel.org Cc: linux-doc@vger.kernel.org Anshuman Khandual (4): arm64/mm: Add SW and HW dirty state helpers arm64/mm: Call pte_sw_mkdirty() while preserving the HW dirty state arm64/mm: Add pte_preserve_hw_dirty() docs: arm64: Add help document for pte dirty state management Documentation/arch/arm64/index.rst | 1 + Documentation/arch/arm64/pte-dirty.rst | 95 ++++++++++++++++++++++++++ arch/arm64/include/asm/pgtable.h | 66 ++++++++++++++---- 3 files changed, 147 insertions(+), 15 deletions(-) create mode 100644 Documentation/arch/arm64/pte-dirty.rst