mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] mm: remove unused clear_flush_young_ptes_notify()
@ 2026-11-09 18:41 Shivank Garg
  2026-11-09 20:50 ` David Hildenbrand (Arm)
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: Shivank Garg @ 2026-11-09 18:41 UTC (permalink / raw)
  To: David Hildenbrand, Lorenzo Stoakes, Liam R. Howlett,
	Vlastimil Babka, Mike Rapoport, Suren Baghdasaryan, Michal Hocko,
	Andrew Morton
  Cc: linux-mm, linux-kernel, Shivank Garg

clear_flush_young_ptes_notify()'s last user was removed in
commit f3c493d2f42b ("mm/rmap: handle device-exclusive entries in
folio_referenced_one()"), which open-codes clear_flush_young_ptes()
and mmu_notifier_clear_flush_young() in folio_referenced_one().

Remove both the CONFIG_MMU_NOTIFIER definition and the
!CONFIG_MMU_NOTIFIER alias.

Signed-off-by: Shivank Garg <shivankg@amd.com>
---
Applies cleanly on mm/core.git/for-next.
---
 mm/internal.h | 12 ------------
 1 file changed, 12 deletions(-)

diff --git a/mm/internal.h b/mm/internal.h
index b129510b92e2..b1f3a1a59bc0 100644
--- a/mm/internal.h
+++ b/mm/internal.h
@@ -1598,17 +1598,6 @@ static inline void maybe_rmap_unlock_action(struct vm_area_struct *vma,
 }
 
 #ifdef CONFIG_MMU_NOTIFIER
-static inline bool clear_flush_young_ptes_notify(struct vm_area_struct *vma,
-		unsigned long addr, pte_t *ptep, unsigned int nr)
-{
-	bool young;
-
-	young = clear_flush_young_ptes(vma, addr, ptep, nr);
-	young |= mmu_notifier_clear_flush_young(vma->vm_mm, addr,
-						addr + nr * PAGE_SIZE);
-	return young;
-}
-
 static inline bool pmdp_clear_flush_young_notify(struct vm_area_struct *vma,
 		unsigned long addr, pmd_t *pmdp)
 {
@@ -1641,7 +1630,6 @@ static inline bool pmdp_test_and_clear_young_notify(struct vm_area_struct *vma,
 
 #else /* CONFIG_MMU_NOTIFIER */
 
-#define clear_flush_young_ptes_notify	clear_flush_young_ptes
 #define pmdp_clear_flush_young_notify	pmdp_clear_flush_young
 #define test_and_clear_young_ptes_notify	test_and_clear_young_ptes
 #define pmdp_test_and_clear_young_notify	pmdp_test_and_clear_young

---
base-commit: 2683df3b7eac1d91380194955ad0c9751454610c
change-id: 20261109-clear-flush-young-notify-dac8b5496ec4

Best regards,
-- 
Shivank Garg <shivankg@amd.com>


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

* Re: [PATCH] mm: remove unused clear_flush_young_ptes_notify()
  2026-11-09 18:41 [PATCH] mm: remove unused clear_flush_young_ptes_notify() Shivank Garg
@ 2026-11-09 20:50 ` David Hildenbrand (Arm)
  2026-11-10  1:18 ` SJ Park
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 5+ messages in thread
From: David Hildenbrand (Arm) @ 2026-11-09 20:50 UTC (permalink / raw)
  To: Shivank Garg, Lorenzo Stoakes, Liam R. Howlett, Vlastimil Babka,
	Mike Rapoport, Suren Baghdasaryan, Michal Hocko, Andrew Morton
  Cc: linux-mm, linux-kernel

On 11/9/26 19:41, Shivank Garg wrote:
> clear_flush_young_ptes_notify()'s last user was removed in
> commit f3c493d2f42b ("mm/rmap: handle device-exclusive entries in
> folio_referenced_one()"), which open-codes clear_flush_young_ptes()
> and mmu_notifier_clear_flush_young() in folio_referenced_one().
> 
> Remove both the CONFIG_MMU_NOTIFIER definition and the
> !CONFIG_MMU_NOTIFIER alias.
> 
> Signed-off-by: Shivank Garg <shivankg@amd.com>
> ---
> Applies cleanly on mm/core.git/for-next.
> ---
>  mm/internal.h | 12 ------------
>  1 file changed, 12 deletions(-)
> 
> diff --git a/mm/internal.h b/mm/internal.h
> index b129510b92e2..b1f3a1a59bc0 100644
> --- a/mm/internal.h
> +++ b/mm/internal.h
> @@ -1598,17 +1598,6 @@ static inline void maybe_rmap_unlock_action(struct vm_area_struct *vma,
>  }
>  
>  #ifdef CONFIG_MMU_NOTIFIER
> -static inline bool clear_flush_young_ptes_notify(struct vm_area_struct *vma,
> -		unsigned long addr, pte_t *ptep, unsigned int nr)
> -{
> -	bool young;
> -
> -	young = clear_flush_young_ptes(vma, addr, ptep, nr);
> -	young |= mmu_notifier_clear_flush_young(vma->vm_mm, addr,
> -						addr + nr * PAGE_SIZE);
> -	return young;
> -}
> -
>  static inline bool pmdp_clear_flush_young_notify(struct vm_area_struct *vma,
>  		unsigned long addr, pmd_t *pmdp)
>  {
> @@ -1641,7 +1630,6 @@ static inline bool pmdp_test_and_clear_young_notify(struct vm_area_struct *vma,
>  
>  #else /* CONFIG_MMU_NOTIFIER */
>  
> -#define clear_flush_young_ptes_notify	clear_flush_young_ptes
>  #define pmdp_clear_flush_young_notify	pmdp_clear_flush_young
>  #define test_and_clear_young_ptes_notify	test_and_clear_young_ptes
>  #define pmdp_test_and_clear_young_notify	pmdp_test_and_clear_young
> 
> ---
> base-commit: 2683df3b7eac1d91380194955ad0c9751454610c
> change-id: 20261109-clear-flush-young-notify-dac8b5496ec4
> 
> Best regards,

Reviewed-by: David Hildenbrand (Arm) <david@kernel.org>

I'll wait a bit and will then queue this.

-- 
Cheers,

David

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

* Re: [PATCH] mm: remove unused clear_flush_young_ptes_notify()
  2026-11-09 18:41 [PATCH] mm: remove unused clear_flush_young_ptes_notify() Shivank Garg
  2026-11-09 20:50 ` David Hildenbrand (Arm)
@ 2026-11-10  1:18 ` SJ Park
  2026-11-10 12:32 ` David Hildenbrand
  2026-11-10 12:48 ` Lorenzo Stoakes (ARM)
  3 siblings, 0 replies; 5+ messages in thread
From: SJ Park @ 2026-11-10  1:18 UTC (permalink / raw)
  To: Shivank Garg
  Cc: SJ Park, David Hildenbrand, Lorenzo Stoakes, Liam R. Howlett,
	Vlastimil Babka, Mike Rapoport, Suren Baghdasaryan, Michal Hocko,
	Andrew Morton, linux-mm, linux-kernel

On Mon, 9 Nov 2026 18:41:55 +0000 Shivank Garg <shivankg@amd.com> wrote:

> clear_flush_young_ptes_notify()'s last user was removed in
> commit f3c493d2f42b ("mm/rmap: handle device-exclusive entries in
> folio_referenced_one()"), which open-codes clear_flush_young_ptes()
> and mmu_notifier_clear_flush_young() in folio_referenced_one().
> 
> Remove both the CONFIG_MMU_NOTIFIER definition and the
> !CONFIG_MMU_NOTIFIER alias.

Looks good to me.

> 
> Signed-off-by: Shivank Garg <shivankg@amd.com>

Reviewed-by: SJ Park <sj@kernel.org>


Thanks,
SJ

[...]

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

* Re: [PATCH] mm: remove unused clear_flush_young_ptes_notify()
  2026-11-09 18:41 [PATCH] mm: remove unused clear_flush_young_ptes_notify() Shivank Garg
  2026-11-09 20:50 ` David Hildenbrand (Arm)
  2026-11-10  1:18 ` SJ Park
@ 2026-11-10 12:32 ` David Hildenbrand
  2026-11-10 12:48 ` Lorenzo Stoakes (ARM)
  3 siblings, 0 replies; 5+ messages in thread
From: David Hildenbrand @ 2026-11-10 12:32 UTC (permalink / raw)
  To: David Hildenbrand, Lorenzo Stoakes, Liam R. Howlett,
	Vlastimil Babka, Mike Rapoport, Suren Baghdasaryan, Michal Hocko,
	Andrew Morton, Shivank Garg
  Cc: linux-mm, linux-kernel

On Mon, 09 Nov 2026 18:41:55 +0000, Shivank Garg wrote:
> clear_flush_young_ptes_notify()'s last user was removed in
> commit f3c493d2f42b ("mm/rmap: handle device-exclusive entries in
> folio_referenced_one()"), which open-codes clear_flush_young_ptes()
> and mmu_notifier_clear_flush_young() in folio_referenced_one().
> 
> Remove both the CONFIG_MMU_NOTIFIER definition and the
> !CONFIG_MMU_NOTIFIER alias.
> 
> [...]

Applied, thanks!

tree: mm/core.git
branch: core-7.5.misc

Applied patches will appear soon in mm-next, followed by linux-next.

Please report any outstanding bugs that were missed during review, so we
can either drop the patch series or decide how to fix it up.

It is encouraged to provide Acked-bys, Reviewed-bys, and Tested-bys even
though the patches have already been applied. If possible, patch trailers
will be updated.

Note that commit hashes shown below are subject to change due to rebase,
trailer updates or similar. Further, this is not a guarantee that the
patches will go upstream. If in doubt, please check the listed branch.

[1/1] mm: remove unused clear_flush_young_ptes_notify()
      https://git.kernel.org/mm/core/c/c6d408f2

-- 
Cheers,

David


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

* Re: [PATCH] mm: remove unused clear_flush_young_ptes_notify()
  2026-11-09 18:41 [PATCH] mm: remove unused clear_flush_young_ptes_notify() Shivank Garg
                   ` (2 preceding siblings ...)
  2026-11-10 12:32 ` David Hildenbrand
@ 2026-11-10 12:48 ` Lorenzo Stoakes (ARM)
  3 siblings, 0 replies; 5+ messages in thread
From: Lorenzo Stoakes (ARM) @ 2026-11-10 12:48 UTC (permalink / raw)
  To: Shivank Garg
  Cc: David Hildenbrand, Liam R. Howlett, Vlastimil Babka,
	Mike Rapoport, Suren Baghdasaryan, Michal Hocko, Andrew Morton,
	linux-mm, linux-kernel

On Mon, Nov 09, 2026 at 06:41:55PM +0000, Shivank Garg wrote:
> clear_flush_young_ptes_notify()'s last user was removed in
> commit f3c493d2f42b ("mm/rmap: handle device-exclusive entries in
> folio_referenced_one()"), which open-codes clear_flush_young_ptes()
> and mmu_notifier_clear_flush_young() in folio_referenced_one().
>
> Remove both the CONFIG_MMU_NOTIFIER definition and the
> !CONFIG_MMU_NOTIFIER alias.
>
> Signed-off-by: Shivank Garg <shivankg@amd.com>

LGTM

Reviewed-by: Lorenzo Stoakes (ARM) <ljs@kernel.org>

> ---
> Applies cleanly on mm/core.git/for-next.
> ---
>  mm/internal.h | 12 ------------
>  1 file changed, 12 deletions(-)
>
> diff --git a/mm/internal.h b/mm/internal.h
> index b129510b92e2..b1f3a1a59bc0 100644
> --- a/mm/internal.h
> +++ b/mm/internal.h
> @@ -1598,17 +1598,6 @@ static inline void maybe_rmap_unlock_action(struct vm_area_struct *vma,
>  }
>
>  #ifdef CONFIG_MMU_NOTIFIER
> -static inline bool clear_flush_young_ptes_notify(struct vm_area_struct *vma,
> -		unsigned long addr, pte_t *ptep, unsigned int nr)
> -{
> -	bool young;
> -
> -	young = clear_flush_young_ptes(vma, addr, ptep, nr);
> -	young |= mmu_notifier_clear_flush_young(vma->vm_mm, addr,
> -						addr + nr * PAGE_SIZE);
> -	return young;
> -}
> -
>  static inline bool pmdp_clear_flush_young_notify(struct vm_area_struct *vma,
>  		unsigned long addr, pmd_t *pmdp)
>  {
> @@ -1641,7 +1630,6 @@ static inline bool pmdp_test_and_clear_young_notify(struct vm_area_struct *vma,
>
>  #else /* CONFIG_MMU_NOTIFIER */
>
> -#define clear_flush_young_ptes_notify	clear_flush_young_ptes
>  #define pmdp_clear_flush_young_notify	pmdp_clear_flush_young
>  #define test_and_clear_young_ptes_notify	test_and_clear_young_ptes
>  #define pmdp_test_and_clear_young_notify	pmdp_test_and_clear_young
>
> ---
> base-commit: 2683df3b7eac1d91380194955ad0c9751454610c
> change-id: 20261109-clear-flush-young-notify-dac8b5496ec4
>
> Best regards,
> --
> Shivank Garg <shivankg@amd.com>
>

--
Cheers, Lorenzo

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

end of thread, other threads:[~2026-11-10 12:48 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-11-09 18:41 [PATCH] mm: remove unused clear_flush_young_ptes_notify() Shivank Garg
2026-11-09 20:50 ` David Hildenbrand (Arm)
2026-11-10  1:18 ` SJ Park
2026-11-10 12:32 ` David Hildenbrand
2026-11-10 12:48 ` Lorenzo Stoakes (ARM)

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®