lkml.org 
[lkml]   [2021]   [Jul]   [29]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
SubjectRe: [PATCH v2 01/13] KVM: s390: pv: avoid stall notifications for some UVCs
Date
On Wed, Jul 28 2021, Claudio Imbrenda <imbrenda@linux.ibm.com> wrote:

> Improve make_secure_pte to avoid stalls when the system is heavily
> overcommitted. This was especially problematic in kvm_s390_pv_unpack,
> because of the loop over all pages that needed unpacking.
>
> Also fix kvm_s390_pv_init_vm to avoid stalls when the system is heavily
> overcommitted.
>
> Signed-off-by: Claudio Imbrenda <imbrenda@linux.ibm.com>
> ---
> arch/s390/kernel/uv.c | 11 ++++++++---
> arch/s390/kvm/pv.c | 2 +-
> 2 files changed, 9 insertions(+), 4 deletions(-)
>
> diff --git a/arch/s390/kernel/uv.c b/arch/s390/kernel/uv.c
> index aeb0a15bcbb7..fd0faa51c1bb 100644
> --- a/arch/s390/kernel/uv.c
> +++ b/arch/s390/kernel/uv.c
> @@ -196,11 +196,16 @@ static int make_secure_pte(pte_t *ptep, unsigned long addr,
> if (!page_ref_freeze(page, expected))
> return -EBUSY;
> set_bit(PG_arch_1, &page->flags);
> - rc = uv_call(0, (u64)uvcb);
> + rc = __uv_call(0, (u64)uvcb);
> page_ref_unfreeze(page, expected);
> - /* Return -ENXIO if the page was not mapped, -EINVAL otherwise */
> - if (rc)
> + /*
> + * Return -ENXIO if the page was not mapped, -EINVAL for other errors.
> + * If busy or partially completed, return -EAGAIN.
> + */
> + if (rc == 1)
> rc = uvcb->rc == 0x10a ? -ENXIO : -EINVAL;
> + else if (rc > 1)
> + rc = -EAGAIN;
> return rc;
> }

Possibly dumb question: when does the call return > 1?
gmap_make_secure() will do a wait_on_page_writeback() for -EAGAIN, is
that always the right thing to do?

\
 
 \ /
  Last update: 2021-07-29 12:49    [W:0.188 / U:0.036 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site