All of lore.kernel.org
 help / color / mirror / Atom feed
* [RFC PATCH 0/3] Introduce new huge_ptep_get_access_flags() interface
@ 2022-05-08  8:58 ` Baolin Wang
  0 siblings, 0 replies; 27+ messages in thread
From: Baolin Wang @ 2022-05-08  8:58 UTC (permalink / raw)
  To: catalin.marinas, will, arnd, mike.kravetz, akpm, sj
  Cc: baolin.wang, linux-arm-kernel, linux-kernel, linux-arch,
	linux-fsdevel, linux-mm

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, one approach is that we can define an ARM64 specific huge_ptep_get()
implementation, which will take into account any subpages' dirty or young bits.
However we should add a new parameter for ARM64 specific huge_ptep_get() to check
how many continuous PTEs or PMDs in this CONT-PTE/PMD size hugetlb, that means we
should convert all the places using huge_ptep_get(), meanwhile most places using
huge_ptep_get() did not care about the dirty or young flags at all.

So instead of changing the prototype of huge_ptep_get(), this patch set introduces
a new huge_ptep_get_access_flags() interface and define an ARM64 specific implementation,
that will take into account any subpages' dirty or young bits for CONT-PTE/PMD size
hugetlb page. And we can only change to use huge_ptep_get_access_flags() for those
functions that care about the dirty or young flags of a hugetlb page.

[1] https://lore.kernel.org/linux-mm/85bd80b4-b4fd-0d3f-a2e5-149559f2f387@oracle.com/

Baolin Wang (3):
  arm64/hugetlb: Introduce new huge_ptep_get_access_flags() interface
  fs/proc/task_mmu: Change to use huge_ptep_get_access_flags()
  mm/damon/vaddr: Change to use huge_ptep_get_access_flags()

 arch/arm64/include/asm/hugetlb.h |  2 ++
 arch/arm64/mm/hugetlbpage.c      | 24 ++++++++++++++++++++++++
 fs/proc/task_mmu.c               |  3 ++-
 include/asm-generic/hugetlb.h    |  7 +++++++
 mm/damon/vaddr.c                 |  5 +++--
 5 files changed, 38 insertions(+), 3 deletions(-)

-- 
1.8.3.1


^ permalink raw reply	[flat|nested] 27+ messages in thread

end of thread, other threads:[~2022-05-09  4:26 UTC | newest]

Thread overview: 27+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
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 ` [RFC PATCH 2/3] fs/proc/task_mmu: Change to use huge_ptep_get_access_flags() Baolin Wang
2022-05-08  8:58   ` 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

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.