From: "Jan Beulich" Subject: Re: [PATCH] switch rangeset's lock to rwlock Date: Mon, 22 Sep 2014 11:34:44 +0100 Message-ID: <542017640200007800036D0B@mail.emea.novell.com> References: <5413094B020000780003480E@mail.emea.novell.com> <20140918104316.GD65000@deinos.phlegethon.org> <541AE8FC02000078000362D1@mail.emea.novell.com> <20140918130258.GB81607@deinos.phlegethon.org> <541AFB130200007800036360@mail.emea.novell.com> <1411378972.18331.14.camel@kazak.uk.xensource.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from mail6.bemta5.messagelabs.com ([195.245.231.135]) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1XW0xH-0003WR-A2 for xen-devel@lists.xenproject.org; Mon, 22 Sep 2014 10:34:51 +0000 In-Reply-To: <1411378972.18331.14.camel@kazak.uk.xensource.com> Content-Disposition: inline List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: Ian Campbell Cc: xen-devel , Tim Deegan , Keir Fraser , Ian Jackson List-Id: xen-devel@lists.xenproject.org >>> On 22.09.14 at 11:42, wrote: > On Thu, 2014-09-18 at 14:32 +0100, Jan Beulich wrote: >> >>> On 18.09.14 at 15:02, wrote: >> > I wouldn't be inclined to tinker with them unless we had a measurement >> > justifying the change. After all, the rangeset operations are not >> > long-running ones and we'd be adding some overhead. >> >> Well, that's a pretty weak argument: The vHPET lock doesn't >> protect long running operations either, yet its conversion to rwlock >> did yield a significant improvement. > > That implies the measurement Tim is asking about... > >> But yes, unless rangesets >> participate in something that may get used heavily by a guest, >> changing the lock kind would likely not have a significant effect. >> Otoh figuring out that lock contention is a problem involves a non- >> eglectible amount of work, preemption of which seems at least >> desirable. >> >> In fact, in the latest runs with those many-vCPU Windows guests I >> see signs of contention even on vpt's pl_time_lock (8 out of 64 vCPU-s >> racing for it). > > ... as does this, but that isn't affected by this change, is it? No, it was merely another statement towards a locked region being short running not being an argument for there not being potential (severe) contention. > I suppose constructing a test for the rangeset getting hit by e.g. the > ioreq server would be tricky to do unless you happen to already have a > disaggregated qemu setup (which I suppose you don't). Correct. > What are the potential negative affects if our gut feeling about the > accesses patterns of the rangesets are wrong? Is the rwlock potentially > slower than the existing lock for the read or uncontended or some other > case? The only downside is that the raw lock structure is 4 bytes instead of 2 for the simply spin lock. Jan