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

Re: [Xen-devel] Relevance of global lock (/var/lock/xl) in xl tool


  • To: Anthony PERARD <anthony.perard@xxxxxxxxxx>
  • From: Michał Leszczyński <michal.leszczynski@xxxxxxx>
  • Date: Mon, 10 Jun 2019 21:57:34 +0200
  • Autocrypt: addr=michal.leszczynski@xxxxxxx; keydata= mQINBFubrQQBEADOpFn1BA3poV6QnE8EWxuLut9s3z6fyuLZWglWhm2BEki7OSqPVhc1DAEh XmonG73h7iMBhy9j+B0+YquxqWRQRLlF9kZzfawsPwabXj4pIGT2pDF1YQM5b2Y1x63CS49s 1c/KfA1TjqgoOEl/crX351Y4NlyEBWzlS7KW4R73zr/S9r7lEO3C8QtCh6K2BxEBUPE9Bmy8 EdvLnH3TeBtuM7wLvUdfIyLFJrQcRy+EceKKK5s8ZJtfFTJE1+skJovJn8uo46vp2NlFxX8s gFEeW0X+YcDOQn3KU02w6HA9eBj7Fkl9DaQqx+dAORw6Q0e/0MXSs1tfblwk1cEQXA1VU2oW F7mroKWufRTPpewTpwR00sO/9uYRJs7kPNbJ8f1c4UpclvimqpBw4Tr8RSN3puZ+BJztzNOl a/kklCmRRRyEI91JvIeNTSBdHwCEAzCP9mmBgmD0sRCLXjtd4Qz/BBr0v3eQGePqPvBqylDc VywVlELyWnf1qkJuaULo6opq43sE0pD0OsIH2Ngr1I2Abzix2AGHcLU5KHqJOf6q7lal+O36 TKoDUxHKMpHLx4sni//kW41GYe7C7oKw2ACQtlpJAch8EUZrSxotSNvQJkt6QgKWckMradPf c99sStqeCF9xC2AW1CaXk7rb8pyljl/wjkyEnzO9wr2I+NCm+wARAQABtDFNaWNoYcWCIExl c3pjennFhHNraSA8bWljaGFsLmxlc3pjenluc2tpQGNlcnQucGw+iQJUBBMBCgA+FiEEi8ZW qhvgeJY9d57ZKtZpXG3wbKoFAlubrQQCGyMFCQlmAYAFCwkIBwIGFQoJCAsCBBYCAwECHgEC F4AACgkQKtZpXG3w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AAw pnKSUZgLdIxAmMNsRA==
  • Cc: xen-devel@xxxxxxxxxxxxxxxxxxxx
  • Delivery-date: Mon, 10 Jun 2019 19:58:24 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>
  • Openpgp: preference=signencrypt

Hello,

I've tested the scenario with restoring too many domains having lock commented out. It turns out that in case when there is no memory left for XEN to allocate, all pending xl restore commands will simply fail with an internal error.

As far as I understand, it's not going to do any damage unless I request too much memory?

If so, then there is some place for improvement, i.e. to make xl acquire the lock, allocate memory, release the lock and then start restoring the domain state. Maybe I could provide some pull request if I would manage to implement such behavior.


Best regards,
Michał Leszczyński


On 10.06.2019 11:41, Anthony PERARD wrote:
On Fri, Jun 07, 2019 at 02:06:30PM +0200, Michał Leszczyński wrote:
Hello,
Hi,

when either "xl restore" or "xl create" command is invoked, a global lock is acquired here:

https://github.com/xen-project/xen/blob/master/tools/xl/xl_vmcontrol.c#L876

I'm trying to figure out what is the exact importance of this lock? Is it really critical for XL operation? I have a pretty powerful machine on which I want to run a few dozen of short-lived VMs. This lock is seriously slowing me down, not letting to restore more than one domain at once. Turns out that everything still works fine (and much faster) when I comment-out the lock in the abovementioned place, but I'm not sure if it's a correct impression.

Does anyone know if there is a situation in which Xen would screw up without this lock?
Here is the reason for the lock:
https://xenbits.xen.org/gitweb/?p=xen.git;a=commit;h=ea4dce89d478d62341cd2f9d8944e215f7086144

  xl: free memory before building a domain
  Free the needed amount of memory before proceeding with the domain
  build.
  Use a filelock to prevent other xl instances from conflicting during
  this operation.

So there are probably configurations where the lock isn't useful, or
there are better ways to reserve memory for domain creation.

-- 
Pozdrawiam
Michał Leszczyński
CERT Polska/NASK
+48 532 461 124
_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxxx
https://lists.xenproject.org/mailman/listinfo/xen-devel

 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.