lkml.org 
[lkml]   [2022]   [May]   [16]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [PATCH v10 04/19] KVM: s390: pv: refactor s390_reset_acc
From
Date
On Thu, 2022-04-14 at 10:02 +0200, Claudio Imbrenda wrote:
> Refactor s390_reset_acc so that it can be reused in upcoming patches.
>
> We don't want to hold all the locks used in a walk_page_range for too
> long, and the destroy page UVC does take some time to complete.
> Therefore we quickly gather the pages to destroy, and then destroy
> them
> without holding all the locks.
>
> The new refactored function optionally allows to return early without
> completing if a fatal signal is pending (and return and appropriate
> error code). Two wrappers are provided to call the new function.
>
> Signed-off-by: Claudio Imbrenda <imbrenda@linux.ibm.com>
> Reviewed-by: Janosch Frank <frankja@linux.ibm.com>

Reviewed-by: Nico Boehr <nrb@linux.ibm.com>

But see below with one naming suggestion you might want to take into
account.

[...]
> diff --git a/arch/s390/mm/gmap.c b/arch/s390/mm/gmap.c
> index e8904cb9dc38..a3a1f90f6ec1 100644
> --- a/arch/s390/mm/gmap.c
> +++ b/arch/s390/mm/gmap.c
> @@ -2676,44 +2676,81 @@ void s390_reset_cmma(struct mm_struct *mm)
>  }
>  EXPORT_SYMBOL_GPL(s390_reset_cmma);
>  
> -/*
> - * make inaccessible pages accessible again
> - */
> -static int __s390_reset_acc(pte_t *ptep, unsigned long addr,
> -                           unsigned long next, struct mm_walk *walk)
> +#define DESTROY_LOOP_THRESHOLD 32

maybe GATHER_NUM_PAGE_REFS_TO_TAKE?

\
 
 \ /
  Last update: 2022-05-16 10:05    [W:0.421 / U:0.096 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site