Re: [PATCH v2 01/13] KVM: s390: pv: avoid stall notifications for some UVCs

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Thu, 29 Jul 2021 12:49:03 +0200
Cornelia Huck <cohuck@xxxxxxxxxx> wrote:

> On Wed, Jul 28 2021, Claudio Imbrenda <imbrenda@xxxxxxxxxxxxx> 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@xxxxxxxxxxxxx>
> > ---
> >  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?

this is exactly what Janosch meant :)

the next version will have #defines for the 4 possible CC values.

in short:
0 OK
1 error
2 busy (nothing done, try again)
3 partial (something done but not all, try again)

> gmap_make_secure() will do a wait_on_page_writeback() for -EAGAIN, is
> that always the right thing to do?

it's the easiest way to get to a place where we will be able to
reschedule if needed.

wait_on_page_writeback will probably do nothing in that case because
the page is not in writeback.

(a few minutes later)

actually I have checked, it seems that the -EAGAIN gets eventually
propagated to places where it's not checked properly!

this will need some more fixing




[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Kernel Development]     [Kernel Newbies]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite Info]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Samba]     [Linux Media]     [Device Mapper]

  Powered by Linux