* + mm-damon-ops-common-refactor-to-use-ptepmdp_clear_young_notify.patch added to mm-unstable branch
@ 2023-06-02 20:55 Andrew Morton
0 siblings, 0 replies; only message in thread
From: Andrew Morton @ 2023-06-02 20:55 UTC (permalink / raw)
To: mm-commits, ziy, yuzhao, willy, urezki, sj, rppt, lstoakes,
kirill.shutemov, hch, hch, ryan.roberts, akpm
The patch titled
Subject: mm/damon/ops-common: refactor to use {pte|pmd}p_clear_young_notify()
has been added to the -mm mm-unstable branch. Its filename is
mm-damon-ops-common-refactor-to-use-ptepmdp_clear_young_notify.patch
This patch will shortly appear at
https://git.kernel.org/pub/scm/linux/kernel/git/akpm/25-new.git/tree/patches/mm-damon-ops-common-refactor-to-use-ptepmdp_clear_young_notify.patch
This patch will later appear in the mm-unstable branch at
git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm
Before you just go and hit "reply", please:
a) Consider who else should be cc'ed
b) Prefer to cc a suitable mailing list as well
c) Ideally: find the original patch on the mailing list and do a
reply-to-all to that, adding suitable additional cc's
*** Remember to use Documentation/process/submit-checklist.rst when testing your code ***
The -mm tree is included into linux-next via the mm-everything
branch at git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm
and is updated there every 2-3 working days
------------------------------------------------------
From: Ryan Roberts <ryan.roberts@arm.com>
Subject: mm/damon/ops-common: refactor to use {pte|pmd}p_clear_young_notify()
Date: Fri, 2 Jun 2023 10:29:48 +0100
With the fix in place to atomically test and clear young on ptes and pmds,
simplify the code to handle the clearing for both the primary mmu and the
mmu notifier with a single API call.
Link: https://lkml.kernel.org/r/20230602092949.545577-4-ryan.roberts@arm.com
Signed-off-by: Ryan Roberts <ryan.roberts@arm.com>
Acked-by: Yu Zhao <yuzhao@google.com>
Cc: Christoph Hellwig <hch@infradead.org>
Cc: Christoph Hellwig <hch@lst.de>
Cc: Kirill A. Shutemov <kirill.shutemov@linux.intel.com>
Cc: Lorenzo Stoakes <lstoakes@gmail.com>
Cc: Matthew Wilcox (Oracle) <willy@infradead.org>
Cc: Mike Rapoport (IBM) <rppt@kernel.org>
Cc: SeongJae Park <sj@kernel.org>
Cc: Uladzislau Rezki (Sony) <urezki@gmail.com>
Cc: Zi Yan <ziy@nvidia.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
---
mm/damon/ops-common.c | 22 ++--------------------
1 file changed, 2 insertions(+), 20 deletions(-)
--- a/mm/damon/ops-common.c~mm-damon-ops-common-refactor-to-use-ptepmdp_clear_young_notify
+++ a/mm/damon/ops-common.c
@@ -39,21 +39,12 @@ struct folio *damon_get_folio(unsigned l
void damon_ptep_mkold(pte_t *pte, struct vm_area_struct *vma, unsigned long addr)
{
- bool referenced = false;
struct folio *folio = damon_get_folio(pte_pfn(*pte));
if (!folio)
return;
- if (ptep_test_and_clear_young(vma, addr, pte))
- referenced = true;
-
-#ifdef CONFIG_MMU_NOTIFIER
- if (mmu_notifier_clear_young(vma->vm_mm, addr, addr + PAGE_SIZE))
- referenced = true;
-#endif /* CONFIG_MMU_NOTIFIER */
-
- if (referenced)
+ if (ptep_clear_young_notify(vma, addr, pte))
folio_set_young(folio);
folio_set_idle(folio);
@@ -63,21 +54,12 @@ void damon_ptep_mkold(pte_t *pte, struct
void damon_pmdp_mkold(pmd_t *pmd, struct vm_area_struct *vma, unsigned long addr)
{
#ifdef CONFIG_TRANSPARENT_HUGEPAGE
- bool referenced = false;
struct folio *folio = damon_get_folio(pmd_pfn(*pmd));
if (!folio)
return;
- if (pmdp_test_and_clear_young(vma, addr, pmd))
- referenced = true;
-
-#ifdef CONFIG_MMU_NOTIFIER
- if (mmu_notifier_clear_young(vma->vm_mm, addr, addr + HPAGE_PMD_SIZE))
- referenced = true;
-#endif /* CONFIG_MMU_NOTIFIER */
-
- if (referenced)
+ if (pmdp_clear_young_notify(vma, addr, pmd))
folio_set_young(folio);
folio_set_idle(folio);
_
Patches currently in -mm which might be from ryan.roberts@arm.com are
mm-vmalloc-must-set-pte-via-arch-code.patch
mm-damon-ops-common-atomically-test-and-clear-young-on-ptes-and-pmds.patch
mm-damon-ops-common-refactor-to-use-ptepmdp_clear_young_notify.patch
mm-fix-failure-to-unmap-pte-on-highmem-systems.patch
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2023-06-02 20:55 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-06-02 20:55 + mm-damon-ops-common-refactor-to-use-ptepmdp_clear_young_notify.patch added to mm-unstable branch Andrew Morton
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.