xen-devel.lists.xenproject.org archive mirror
 help / color / mirror / Atom feed
From: Mike Latimer <mlatimer@suse.com>
To: xen-devel@lists.xen.org
Subject: [PATCH 0/1] Block script performance with shared image files
Date: Wed, 30 Sep 2015 15:10:53 -0600	[thread overview]
Message-ID: <cover.1443644398.git.mlatimer@suse.com> (raw)

As mentioned in a previous thread[1], the hotplug block script suffers
from an exponential performance degredation when attaching shared image
files due to scanning xenstore multiple times.

During the attachment of a loopback mounted image file, the mode of all
curent instances of this device already attached to other domains must be
checked. This requires finding all loopback devices pointing to the inode
of the shared image file, and then comparing the major and minor number of
these devices to the major and minor number of every vbd device found in the
xenstore database. Scanning all of xenstore is performed for every instance
of every loopback device pointing to the same shared image file, and becomes
slower and slower with every additional instance.

Rather than scanning the entire xenstore database for every instance of a
shared loopback device, the attached patch creates a list of the major and
minor numbers from all matching loopback devices. Xenstore is then walked
once, and major and minor numbers from every vbd are checked against the list.

I think this is a reasonable approach to this issue, and the benefits can be
seen with as few as 10 domains sharing the same image file.

Thanks,
Mike

[1]http://lists.xenproject.org/archives/html/xen-devel/2015-09/msg03551.html

Mike Latimer (1):
  tools/hotplug: Scan xenstore once when attaching shared images files

 tools/hotplug/Linux/block | 67 +++++++++++++++++++++++++++++------------------
 1 file changed, 41 insertions(+), 26 deletions(-)

-- 
1.8.4.5

             reply	other threads:[~2015-09-30 21:10 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-09-30 21:10 Mike Latimer [this message]
2015-09-30 21:10 ` [PATCH 1/1] tools/hotplug: Scan xenstore once when attaching shared images files Mike Latimer
2015-10-01  9:51   ` George Dunlap
2015-10-01  9:58     ` George Dunlap
2015-10-01 14:32     ` Mike Latimer
2015-10-01 15:16     ` Mike Latimer
2015-10-01 15:27       ` George Dunlap

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=cover.1443644398.git.mlatimer@suse.com \
    --to=mlatimer@suse.com \
    --cc=xen-devel@lists.xen.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).