From mboxrd@z Thu Jan 1 00:00:00 1970 From: Ian Campbell Subject: Re: Shared image files and block script performance Date: Wed, 30 Sep 2015 11:35:20 +0100 Message-ID: <1443609320.16718.177.camel@citrix.com> References: <7906712.vmDJM0hI90@mlatimer1.dnsdhcp.provo.novell.com> <1443518732.16718.16.camel@citrix.com> <1931582.zTGj9PHWO8@mlatimer1.dnsdhcp.provo.novell.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <1931582.zTGj9PHWO8@mlatimer1.dnsdhcp.provo.novell.com> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: Mike Latimer Cc: xen-devel@lists.xen.org List-Id: xen-devel@lists.xenproject.org On Tue, 2015-09-29 at 15:18 -0600, Mike Latimer wrote: > Hi Ian, > > On Tuesday, September 29, 2015 10:25:32 AM Ian Campbell wrote: > > On Mon, 2015-09-28 at 17:14 -0600, Mike Latimer wrote: > > > Any better options or ideas? > > > > Is part of the problem that shell is a terrible choice for this kind of > > check? > > There is some truth to that... ;) > > > Would shelling out to a helper utility allow this to be written in > > something better? > > A helper utility would be useful, however, I'm seeing a huge amount of gain > with nothing more than a little code motion. Specifically, if shared_list is > generated within the check_sharing function, the (potentially) large list of > devices is not too painful to work with. > > For example, the attached patch works well in my environment, and removes the > exponential slowdown. The main change is that $devmm becomes a comma delimited > list of devices (major:minor) to check against the vbd's found in xenstore. A > few minor changes are required along the way, but nothing significant. The > comma delimited list might become problematic at very large numbers (hundreds) > of a single shared device, but I don't think it will be a problem in practice. > Even if it has limitations, this approach offers significant improvements in > performance. > > I'll continue to test this patch here, but I'm interested in your opinion. If you have a patch which improves things then I think you should just go ahead formally submit it (http://wiki.xen.org/wiki/Submitting_Xen_Patches). Ian.