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: 12850167 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 kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id 5339DC433F5 for ; Mon, 16 May 2022 00:56:14 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 694FD6B0073; Sun, 15 May 2022 20:56:13 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 643556B0075; Sun, 15 May 2022 20:56:13 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 50B2F6B0078; Sun, 15 May 2022 20:56:13 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0012.hostedemail.com [216.40.44.12]) by kanga.kvack.org (Postfix) with ESMTP id 411E96B0073 for ; Sun, 15 May 2022 20:56:13 -0400 (EDT) Received: from smtpin31.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay02.hostedemail.com (Postfix) with ESMTP id 6EAB532371 for ; Mon, 16 May 2022 00:56:12 +0000 (UTC) X-FDA: 79469789784.31.F90A599 Received: from out30-45.freemail.mail.aliyun.com (out30-45.freemail.mail.aliyun.com [115.124.30.45]) by imf07.hostedemail.com (Postfix) with ESMTP id 6DADE400AE for ; Mon, 16 May 2022 00:56:03 +0000 (UTC) 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 Authentication-Results: imf07.hostedemail.com; dkim=none; spf=pass (imf07.hostedemail.com: domain of baolin.wang@linux.alibaba.com designates 115.124.30.45 as permitted sender) smtp.mailfrom=baolin.wang@linux.alibaba.com; dmarc=pass (policy=none) header.from=alibaba.com X-Rspam-User: X-Rspamd-Server: rspam05 X-Rspamd-Queue-Id: 6DADE400AE X-Stat-Signature: 58grjjbata135j5yfunmq31e8tsyesei X-HE-Tag: 1652662563-478063 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: 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(-)