From: Baolin Wang <baolin.wang@linux.alibaba.com> To: catalin.marinas@arm.com, will@kernel.org, arnd@arndb.de, mike.kravetz@oracle.com, akpm@linux-foundation.org, sj@kernel.org Cc: baolin.wang@linux.alibaba.com, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linux-arch@vger.kernel.org, linux-fsdevel@vger.kernel.org, linux-mm@kvack.org Subject: [RFC PATCH 2/3] fs/proc/task_mmu: Change to use huge_ptep_get_access_flags() Date: Sun, 8 May 2022 16:58:53 +0800 [thread overview] Message-ID: <62de656111dcdb8d189698316f1c2721753d7c7a.1651998586.git.baolin.wang@linux.alibaba.com> (raw) In-Reply-To: <cover.1651998586.git.baolin.wang@linux.alibaba.com> In-Reply-To: <cover.1651998586.git.baolin.wang@linux.alibaba.com> The ARM64 platform can support CONT-PTE/PMD size hugetlb, which can contain seravel continuous pte or pmd entries. However current huge_ptep_get() only return one specific pte value for the CONT-PTE or CONT-PMD size hugetlb, which did not take into accounts the subpages' dirty or young flags. So the gather_hugetlb_stats() will miss some dirty hugetlb statistics. Thus change to use huge_ptep_get_access_flags() taking into accounts the subpages' dirty or young flags of a CONT-PTE/PMD size hugetlb, to make the hugetlb statistics more accurate. Signed-off-by: Baolin Wang <baolin.wang@linux.alibaba.com> --- fs/proc/task_mmu.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/fs/proc/task_mmu.c b/fs/proc/task_mmu.c index f9c9abb..3f224a7 100644 --- a/fs/proc/task_mmu.c +++ b/fs/proc/task_mmu.c @@ -1880,7 +1880,8 @@ static int gather_pte_stats(pmd_t *pmd, unsigned long addr, static int gather_hugetlb_stats(pte_t *pte, unsigned long hmask, unsigned long addr, unsigned long end, struct mm_walk *walk) { - pte_t huge_pte = huge_ptep_get(pte); + pte_t huge_pte = huge_ptep_get_access_flags(pte, + huge_page_size(hstate_vma(walk->vma))); struct numa_maps *md; struct page *page; -- 1.8.3.1
WARNING: multiple messages have this Message-ID (diff)
From: Baolin Wang <baolin.wang@linux.alibaba.com> To: catalin.marinas@arm.com, will@kernel.org, arnd@arndb.de, mike.kravetz@oracle.com, akpm@linux-foundation.org, sj@kernel.org Cc: baolin.wang@linux.alibaba.com, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linux-arch@vger.kernel.org, linux-fsdevel@vger.kernel.org, linux-mm@kvack.org Subject: [RFC PATCH 2/3] fs/proc/task_mmu: Change to use huge_ptep_get_access_flags() Date: Sun, 8 May 2022 16:58:53 +0800 [thread overview] Message-ID: <62de656111dcdb8d189698316f1c2721753d7c7a.1651998586.git.baolin.wang@linux.alibaba.com> (raw) In-Reply-To: <cover.1651998586.git.baolin.wang@linux.alibaba.com> In-Reply-To: <cover.1651998586.git.baolin.wang@linux.alibaba.com> The ARM64 platform can support CONT-PTE/PMD size hugetlb, which can contain seravel continuous pte or pmd entries. However current huge_ptep_get() only return one specific pte value for the CONT-PTE or CONT-PMD size hugetlb, which did not take into accounts the subpages' dirty or young flags. So the gather_hugetlb_stats() will miss some dirty hugetlb statistics. Thus change to use huge_ptep_get_access_flags() taking into accounts the subpages' dirty or young flags of a CONT-PTE/PMD size hugetlb, to make the hugetlb statistics more accurate. Signed-off-by: Baolin Wang <baolin.wang@linux.alibaba.com> --- fs/proc/task_mmu.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/fs/proc/task_mmu.c b/fs/proc/task_mmu.c index f9c9abb..3f224a7 100644 --- a/fs/proc/task_mmu.c +++ b/fs/proc/task_mmu.c @@ -1880,7 +1880,8 @@ static int gather_pte_stats(pmd_t *pmd, unsigned long addr, static int gather_hugetlb_stats(pte_t *pte, unsigned long hmask, unsigned long addr, unsigned long end, struct mm_walk *walk) { - pte_t huge_pte = huge_ptep_get(pte); + pte_t huge_pte = huge_ptep_get_access_flags(pte, + huge_page_size(hstate_vma(walk->vma))); struct numa_maps *md; struct page *page; -- 1.8.3.1 _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
next prev parent reply other threads:[~2022-05-08 8:59 UTC|newest] Thread overview: 27+ messages / expand[flat|nested] mbox.gz Atom feed top 2022-05-08 8:58 [RFC PATCH 0/3] Introduce new huge_ptep_get_access_flags() interface Baolin Wang 2022-05-08 8:58 ` Baolin Wang 2022-05-08 8:58 ` [RFC PATCH 1/3] arm64/hugetlb: " Baolin Wang 2022-05-08 8:58 ` Baolin Wang 2022-05-08 13:14 ` nh26223 2022-05-08 13:14 ` nh26223 2022-05-09 1:19 ` Baolin Wang 2022-05-09 1:19 ` Baolin Wang 2022-05-09 4:10 ` nh26223 2022-05-09 4:10 ` nh26223 2022-05-09 4:19 ` Baolin Wang 2022-05-09 4:19 ` Baolin Wang 2022-05-08 8:58 ` Baolin Wang [this message] 2022-05-08 8:58 ` [RFC PATCH 2/3] fs/proc/task_mmu: Change to use huge_ptep_get_access_flags() Baolin Wang 2022-05-08 8:58 ` [RFC PATCH 3/3] mm/damon/vaddr: " Baolin Wang 2022-05-08 8:58 ` Baolin Wang 2022-05-08 12:41 ` kernel test robot 2022-05-08 15:26 ` [RFC PATCH 0/3] Introduce new huge_ptep_get_access_flags() interface Muchun Song 2022-05-08 15:26 ` Muchun Song 2022-05-09 1:34 ` Baolin Wang 2022-05-09 1:34 ` Baolin Wang 2022-05-08 17:08 ` Matthew Wilcox 2022-05-08 17:08 ` Matthew Wilcox 2022-05-09 1:53 ` Baolin Wang 2022-05-09 1:53 ` Baolin Wang 2022-05-09 2:54 ` Muchun Song 2022-05-09 2:54 ` Muchun Song
Reply instructions: You may reply publicly to this message via plain-text email using any one of the following methods: * Save the following mbox file, import it into your mail client, and reply-to-all from there: mbox Avoid top-posting and favor interleaved quoting: https://en.wikipedia.org/wiki/Posting_style#Interleaved_style * Reply using the --to, --cc, and --in-reply-to switches of git-send-email(1): git send-email \ --in-reply-to=62de656111dcdb8d189698316f1c2721753d7c7a.1651998586.git.baolin.wang@linux.alibaba.com \ --to=baolin.wang@linux.alibaba.com \ --cc=akpm@linux-foundation.org \ --cc=arnd@arndb.de \ --cc=catalin.marinas@arm.com \ --cc=linux-arch@vger.kernel.org \ --cc=linux-arm-kernel@lists.infradead.org \ --cc=linux-fsdevel@vger.kernel.org \ --cc=linux-kernel@vger.kernel.org \ --cc=linux-mm@kvack.org \ --cc=mike.kravetz@oracle.com \ --cc=sj@kernel.org \ --cc=will@kernel.org \ /path/to/YOUR_REPLY https://kernel.org/pub/software/scm/git/docs/git-send-email.html * If your mail client supports setting the In-Reply-To header via mailto: links, try the mailto: linkBe sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes, see mirroring instructions on how to clone and mirror all data and code used by this external index.