[libvirt] [PATCH 4/6] qemu: Reduce memlock limit after detaching hostdev

Peter Krempa pkrempa at redhat.com
Wed Nov 18 16:22:41 UTC 2015


On Wed, Nov 18, 2015 at 17:04:55 +0100, Andrea Bolognani wrote:
> On Wed, 2015-11-18 at 16:17 +0100, Peter Krempa wrote:
> > > +    /* QEMU might no longer need to lock as much memory, eg. we just detached
> > > +     * a VFIO device, so adjust the limit here */
> > > +    if (qemuDomainRequiresMlock(vm->def))
> > > +        if (virProcessSetMaxMemLock(vm->pid,
> > > +                                    qemuDomainGetMlockLimitBytes(vm->def)) < 0)
> > > +        VIR_WARN("Failed to adjust locked memory limit");
> > > +
> > 
> > Hmmm, looks like we should reset it to default (64KiB afaik) if it was
> > required before and is not required any more. Otherwise we would not
> > decrease the limit after unplugging the last VFIO device (on x86).
> 
> I agree, and I planned to do something about that in a
> follow-up patch as this change alone is already a small
> improvement over the status quo.
> 
> Would you prefer it if I pulled this patch from the series
> for now and posted it again once it supports restoring the
> limit back to the default once the last VFIO device has been
> removed from the guest? I'd be okay with that.

Hmm, yeah, I'd prefer to do it the first time the right way.

Peter
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: Digital signature
URL: <http://listman.redhat.com/archives/libvir-list/attachments/20151118/d9e27a2c/attachment-0001.sig>


More information about the libvir-list mailing list