[PATCH mm-unstable v2 02/10] mm/kvm: use mmu_notifier_ops->test_clear_young()

Jason Gunthorpe jgg at ziepe.ca
Thu Jun 1 05:20:08 AEST 2023


On Fri, May 26, 2023 at 05:44:27PM -0600, Yu Zhao wrote:
> Replace test_young() and clear_young() with test_clear_young().
> 
> Signed-off-by: Yu Zhao <yuzhao at google.com>
> ---
>  include/linux/mmu_notifier.h | 29 ++-----------------
>  include/trace/events/kvm.h   | 15 ----------
>  mm/mmu_notifier.c            | 42 ----------------------------
>  virt/kvm/kvm_main.c          | 54 ------------------------------------
>  4 files changed, 2 insertions(+), 138 deletions(-)
> 
> diff --git a/include/linux/mmu_notifier.h b/include/linux/mmu_notifier.h
> index dfdbb370682d..c8f35fc08703 100644
> --- a/include/linux/mmu_notifier.h
> +++ b/include/linux/mmu_notifier.h
> @@ -104,26 +104,6 @@ struct mmu_notifier_ops {
>  				 unsigned long start,
>  				 unsigned long end);
>  
> -	/*
> -	 * clear_young is a lightweight version of clear_flush_young. Like the
> -	 * latter, it is supposed to test-and-clear the young/accessed bitflag
> -	 * in the secondary pte, but it may omit flushing the secondary tlb.
> -	 */
> -	int (*clear_young)(struct mmu_notifier *subscription,
> -			   struct mm_struct *mm,
> -			   unsigned long start,
> -			   unsigned long end);
> -
> -	/*
> -	 * test_young is called to check the young/accessed bitflag in
> -	 * the secondary pte. This is used to know if the page is
> -	 * frequently used without actually clearing the flag or tearing
> -	 * down the secondary mapping on the page.
> -	 */
> -	int (*test_young)(struct mmu_notifier *subscription,
> -			  struct mm_struct *mm,
> -			  unsigned long address);
> -
>  	int (*test_clear_young)(struct mmu_notifier *mn, struct mm_struct *mm,
>  				unsigned long start, unsigned long end,
>  				bool clear, unsigned long *bitmap);

Oh, you split the patch. This MMU notifier stuff seems OK for both
patches then, and KVM is the only user:

Reviewed-by: Jason Gunthorpe <jgg at nvidia.com>

Jason


More information about the Linuxppc-dev mailing list