From patchwork Mon May 16 00:55:56 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Baolin Wang X-Patchwork-Id: 12850193 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 D38B1C433F5 for ; Mon, 16 May 2022 00:58:11 +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:MIME-Version:List-Subscribe:List-Help: List-Post:List-Archive:List-Unsubscribe:List-Id:Message-Id:Date:Subject:Cc:To :From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References: List-Owner; bh=194Qr++St35ofR+hVhvdYoFfyQN4hqLCXNg0TnOSpPE=; b=ctA1fTkD4wc+Nc i1DE8C0EYEaC5/QToWBL04oVLZuEPTDD/7OWozWvXTAH8Ez6qmq+a6mK61HhNuLlLkjqi6g0HUKYI PvQpX1yTVsQRkL8XDJKe/7AIAUg9jTQFbSBc06IaZgygJ6Yv12qyxV4Ro6atPiut5dZk6rMJdVwVY lulWl8TZA/lOTrnm36DMeP6SAm/gH66Qf+T2lXuWPc3hxUGXmJEhUTMX2mE/Pjh57nTJtKXqhwJjr pyrrUIvR33N+YmgL8MKNX6MtpLwVJoCzFvpJJ4xTPVQrsWw4Dk2umsqbnR2SF/k1FP0w+rR+bp7lj Ad4zq/kLqLBGZ9vCJLWw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1nqP2s-005SGB-DF; Mon, 16 May 2022 00:57:10 +0000 Received: from out30-57.freemail.mail.aliyun.com ([115.124.30.57]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1nqP1x-005Rf0-6d for linux-arm-kernel@lists.infradead.org; Mon, 16 May 2022 00:56:15 +0000 X-Alimail-AntiSpam: AC=PASS; BC=-1|-1; BR=01201311R181e4; CH=green; DM=||false|; DS=||; FP=0|-1|-1|-1|0|-1|-1|-1; HT=e01e04423; MF=baolin.wang@linux.alibaba.com; NM=1; PH=DS; RN=12; SR=0; TI=SMTPD_---0VDCFs5t_1652662565; Received: from localhost(mailfrom:baolin.wang@linux.alibaba.com fp:SMTPD_---0VDCFs5t_1652662565) by smtp.aliyun-inc.com(127.0.0.1); Mon, 16 May 2022 08:56:05 +0800 From: Baolin Wang To: catalin.marinas@arm.com, will@kernel.org Cc: mike.kravetz@oracle.com, akpm@linux-foundation.org, songmuchun@bytedance.com, willy@infradead.org, anshuman.khandual@arm.com, christophe.leroy@csgroup.eu, baolin.wang@linux.alibaba.com, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linux-mm@kvack.org Subject: [PATCH v3 0/2] Implement arm64 specific huge_ptep_get() Date: Mon, 16 May 2022 08:55:56 +0800 Message-Id: X-Mailer: git-send-email 1.8.3.1 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220515_175613_456494_A97B6C03 X-CRM114-Status: GOOD ( 11.16 ) 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: , MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Hi, As Mike pointed out [1], the huge_ptep_get() will only return one specific pte value for the CONT-PTE or CONT-PMD size hugetlb on ARM64 system, which will not take into account the subpages' dirty or young bits of a CONT-PTE/PMD size hugetlb page. That will make us miss dirty or young flags of a CONT-PTE/PMD size hugetlb page for those functions that want to check the dirty or young flags of a hugetlb page. For example, the gather_hugetlb_stats() will get inaccurate dirty hugetlb page statistics, and the DAMON for hugetlb monitoring will also get inaccurate access statistics. To fix this issue, this patch set introduces an ARM64 specific huge_ptep_get() implementation, which will take into account any subpages' dirty or young bits. [1] https://lore.kernel.org/linux-mm/85bd80b4-b4fd-0d3f-a2e5-149559f2f387@oracle.com/ Changes from v2: - Fix some typos and update the commit message suggested by Anshuman. - Improve some coding style issues. - Add reviewed tag from Anshuman. Changes from v1: - Rebase on next-20220512. - Update commit message suggested by Muchun. - Add reviewed tag from Muchun. Changes from RFC: - Implement arm64 specific huge_ptep_get() instead of introducing a new interface. - Add a new patch to convert huge_ptep_get() in hugetlbpage.c Baolin Wang (2): arm64/hugetlb: Use ptep_get() to get the pte value of a huge page arm64/hugetlb: Implement arm64 specific huge_ptep_get() arch/arm64/include/asm/hugetlb.h | 2 ++ arch/arm64/mm/hugetlbpage.c | 30 ++++++++++++++++++++++++++---- 2 files changed, 28 insertions(+), 4 deletions(-)