From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:55157) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Sh3tS-0000l6-7y for qemu-devel@nongnu.org; Tue, 19 Jun 2012 15:15:15 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Sh3tQ-0004QR-6X for qemu-devel@nongnu.org; Tue, 19 Jun 2012 15:15:13 -0400 Received: from mx1.redhat.com ([209.132.183.28]:5657) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Sh3tP-0004Q3-TQ for qemu-devel@nongnu.org; Tue, 19 Jun 2012 15:15:12 -0400 Message-ID: <4FE0CF56.5020502@redhat.com> Date: Tue, 19 Jun 2012 13:13:26 -0600 From: Eric Blake MIME-Version: 1.0 References: <1340120601-24747-1-git-send-email-owasserm@redhat.com> <1340120601-24747-13-git-send-email-owasserm@redhat.com> In-Reply-To: <1340120601-24747-13-git-send-email-owasserm@redhat.com> Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="------------enigF2DBF561B4ED42FA78686D3D" Subject: Re: [Qemu-devel] [PATCH v12 12/13] Add set_cachesize command List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Orit Wasserman Cc: peter.maydell@linaro.org, aliguori@us.ibm.com, quintela@redhat.com, stefanha@gmail.com, qemu-devel@nongnu.org, mdroth@linux.vnet.ibm.com, blauwirbel@gmail.com, Petter Svard , Benoit Hudzia , avi@redhat.com, Aidan Shribman , pbonzini@redhat.com, chegu_vinod@hp.com This is an OpenPGP/MIME signed message (RFC 2440 and 3156) --------------enigF2DBF561B4ED42FA78686D3D Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable On 06/19/2012 09:43 AM, Orit Wasserman wrote: > Change XBZRLE cache size in bytes (the size should be a power of 2). > If XBZRLE cache size is too small there will be many cache miss. >=20 > Signed-off-by: Benoit Hudzia > Signed-off-by: Petter Svard > Signed-off-by: Aidan Shribman > Signed-off-by: Orit Wasserman > --- > +++ b/arch_init.c > @@ -24,6 +24,7 @@ > #include > #include > #include > +#include What for? > + > + { > + .name =3D "migrate_set_cachesize", > + .args_type =3D "value:o", > + .params =3D "value", > + .help =3D "set cache size (in bytes) for XBZRLE migratio= ns," > + "the cache size will be round down to the nearest power of 2.\= n" s/round/rounded/ > + "The cache size effects the number of cache misses." s/effects/affects/ > +++ b/migration.c > @@ -22,6 +22,7 @@ > #include "qemu_socket.h" > #include "block-migration.h" > #include "qmp-commands.h" > +#include What for? > =20 > //#define DEBUG_MIGRATION > =20 > @@ -43,7 +44,7 @@ enum { > =20 > #define MAX_THROTTLE (32 << 20) /* Migration speed throttling */= > =20 > -/* Migration XBZRLE cache size */ > +/* Migration XBZRLE default cache size */ Squash this change into the earlier patch that introduced the #define. > #define DEFAULT_MIGRATE_CACHE_SIZE (64 * 1024 * 1024) > =20 > static NotifierList migration_state_notifiers =3D > @@ -498,6 +499,26 @@ void qmp_migrate_cancel(Error **errp) > migrate_fd_cancel(migrate_get_current()); > } > =20 > +void qmp_migrate_set_cachesize(int64_t value, Error **errp) > +{ > + MigrationState *s =3D migrate_get_current(); > + > + /* Check for truncation */ > + if (value !=3D (size_t)value) { This fails to filter out a value of -1, at least on platforms where size_t and int64_t are the same size. It might be better to use explicit comparison: if (value < 0 || value > SIZE_MAX) > ## > +# @migrate_set_cachesize migrate-set-cachesize - QMP prefers '-' over '_' > +# > +# Set XBZRLE cache size > +# > +# @value: cache size in bytes > +# > +# The size will be round down to the nearest power of 2. s/round/rounded/ > + > +Set cache size to be used by XBZRLE migration, the cache size will be = round down s/round/rounded/ > +to the nearset power of 2 s/nearset/nearest/ > + > +Arguments: > + > +- "value": cache size in bytes (json-int) > + > +Example: > + > +-> { "execute": "migrate_set_cachesize", "arguments": { "value": 512M = } } 512M is not a valid json-int. Spell it out as 536870912. --=20 Eric Blake eblake@redhat.com +1-919-301-3266 Libvirt virtualization library http://libvirt.org --------------enigF2DBF561B4ED42FA78686D3D Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.12 (GNU/Linux) Comment: Public key at http://people.redhat.com/eblake/eblake.gpg Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/ iQEcBAEBCAAGBQJP4M9WAAoJEKeha0olJ0NqYAUH/RtmiLkr4sdEjenjRgJMZpZE JkaqGT6XF+om1NUG29bpvN+kx6VH/X8PAyZgc8BZt/O7Xinod+MGcGnVL1N+wwYB 4PjuFM2CIbHeIKyUCuCnpUQ4x90UVCUhTpEBCUEB+ethwtrkjE5zsH38tmuXkrnp 3/KX5k02gNYBFfztrUo6BIa1X4jX/rO1qla2GlmzMos6P/cBVXaKKqrTlXEL+Uxl I8KszGRC5ZxjrEZQNjHl0lJOgXWtCJ1TTnAns3TuvvHpMiDU7v+xyQ/DEZh65SLF I/W+IbkrX6iUro0ULln1UXVG3dwVpFCAYrFZrxfqc2N99wOxQS8G4P6nxcNWYGo= =ULkv -----END PGP SIGNATURE----- --------------enigF2DBF561B4ED42FA78686D3D--