From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:42656) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YvhtO-0003lM-AJ for qemu-devel@nongnu.org; Fri, 22 May 2015 04:01:19 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YvhtI-0004vZ-87 for qemu-devel@nongnu.org; Fri, 22 May 2015 04:01:18 -0400 Received: from mx1.redhat.com ([209.132.183.28]:57089) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YvhtI-0004vP-0z for qemu-devel@nongnu.org; Fri, 22 May 2015 04:01:12 -0400 Received: from int-mx13.intmail.prod.int.phx2.redhat.com (int-mx13.intmail.prod.int.phx2.redhat.com [10.5.11.26]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id t4M81ATn024919 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL) for ; Fri, 22 May 2015 04:01:10 -0400 Date: Fri, 22 May 2015 09:01:08 +0100 From: Stefan Hajnoczi Message-ID: <20150522080108.GA19677@stefanha-thinkpad.redhat.com> References: <1432214398-14990-1-git-send-email-pbonzini@redhat.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="AhhlLboLdkugWU4S" Content-Disposition: inline In-Reply-To: <1432214398-14990-1-git-send-email-pbonzini@redhat.com> Subject: Re: [Qemu-devel] [PATCH] exec: optimize phys_page_set_level List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Paolo Bonzini Cc: qemu-devel@nongnu.org, mst@redhat.com --AhhlLboLdkugWU4S Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Thu, May 21, 2015 at 03:19:58PM +0200, Paolo Bonzini wrote: > phys_page_set_level is writing zeroes to a struct that has just been > filled in by phys_map_node_alloc. Instead, tell phys_map_node_alloc > whether to fill in the page "as a leaf" or "as a non-leaf". >=20 > memcpy is faster than struct assignment, which copies each bitfield > individually. Arguably a compiler bug, but memcpy is super-special > cased anyway so what could go wrong? >=20 > This cuts the cost of phys_page_set_level from 25% to 5% when > booting qboot. >=20 > Signed-off-by: Paolo Bonzini > --- > exec.c | 24 ++++++++++-------------- > 1 file changed, 10 insertions(+), 14 deletions(-) Reviewed-by: Stefan Hajnoczi --AhhlLboLdkugWU4S Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iQEcBAEBAgAGBQJVXuJEAAoJEJykq7OBq3PIXLsIAJzIzmtGELrCN6wy+THUpLJZ /EPmCyJLe2dDH1Kzr/Twq/Myyf7J8CMtatXSmKO/yfhpLmfc3O6bF83e61nFX3gG bN52zPbovJMh17PsVBRd1XTyrK5tCgyiQy2otqEgIWvosweoJksq4z3P3zQTRvBT dTN3y0ovp6tXtETxY+7PIOJ0SMUWlp2pOHGqoRKnmR3DcrX05K+kIhpuz/ckrPA7 UahPISQGaLSdoF+uh7BlJGHdermCsUbt+nZTPqAPEmiMYcGhBSBGL13pyncd8CWu WZopKclV288zQ6VpV3eO/A2RZFsRaig1VVpCrrSfesTHX6vkiimRPk9yodcOGzU= =SuJr -----END PGP SIGNATURE----- --AhhlLboLdkugWU4S--