From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([140.186.70.92]:58256) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RAmem-0001x3-CL for qemu-devel@nongnu.org; Mon, 03 Oct 2011 13:50:27 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1RAmej-000640-9Q for qemu-devel@nongnu.org; Mon, 03 Oct 2011 13:50:24 -0400 Received: from fmmailgate03.web.de ([217.72.192.234]:56714) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RAmei-00063M-Qg for qemu-devel@nongnu.org; Mon, 03 Oct 2011 13:50:21 -0400 Message-ID: <4E89F5D4.3080700@web.de> Date: Mon, 03 Oct 2011 19:50:12 +0200 From: Jan Kiszka MIME-Version: 1.0 References: <1317640994-16559-1-git-send-email-harsh@linux.vnet.ibm.com> <4E89A789.8080302@web.de> <87boty2dar.fsf@skywalker.in.ibm.com> In-Reply-To: <87boty2dar.fsf@skywalker.in.ibm.com> Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="------------enig1FA7611C83ED3E24ECFC815A" Sender: jan.kiszka@web.de Subject: Re: [Qemu-devel] [PATCH 0/2] Introduce QemuRWLock List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: "Aneesh Kumar K.V" Cc: stefanha@gmail.com, Harsh Prateek Bora , qemu-devel@nongnu.org This is an OpenPGP/MIME signed message (RFC 2440 and 3156) --------------enig1FA7611C83ED3E24ECFC815A Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable On 2011-10-03 19:30, Aneesh Kumar K.V wrote: > On Mon, 03 Oct 2011 14:16:09 +0200, Jan Kiszka wrot= e: > Non-text part: multipart/signed >> On 2011-10-03 13:23, Harsh Prateek Bora wrote: >>> SynthFS uses rwlocks, which raise the need of a generic QemuRWLock AP= Is. >>> This patchset introduces the same making necessary changes to relevan= t code. >> >> Is the impact of using a plain mutex measurable with 9pfs? Usually it >> takes very heavy write sections or highly concurrent read sections to >> actually make a difference. Looking at the cited code, I would dare to= >> rule out the former (even more if the malloc was moved out of the >> critical section). But I cannot assess the latter. >> >> If it does matter, I would vote for introducing RCU directly. >=20 > I haven't done any measurements. The lock is taken in write mode > when creating new file system object and is taken in read mode during > lookup(walk) and readdir. Considering we allow creation of objects only= > during init, it mostly will be taken in read mode. Currently there is n= o > deletion of object. We didn't want those parallel reads to be > mutually exclusive. That still doesn't answer if it justifies a new locking mechanism. RW locks are rarely useful, a nightmare for RT, and widely obsolete when RCU is available. >=20 > For RCU are you suggesting to work with userspace RCU implementation at= =20 > http://lttng.org/urcu See http://thread.gmane.org/gmane.comp.emulators.qemu/113529. That would also help my TCG locking optimization where I had to hack away some ram_list changes for lock-less read access (http://thread.gmane.org/gmane.comp.emulators.qemu/1188079). Jan --------------enig1FA7611C83ED3E24ECFC815A Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.16 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/ iEYEARECAAYFAk6J9dgACgkQitSsb3rl5xR2pgCdGiKxZ28bYb3gNDoQtsLSRM/o cNAAniQPqMCBtwfFqhVINLvwlechJE8u =RLcP -----END PGP SIGNATURE----- --------------enig1FA7611C83ED3E24ECFC815A--