All of lore.kernel.org
 help / color / mirror / Atom feed
From: Ian Campbell <ian.campbell@citrix.com>
To: Mike Latimer <mlatimer@suse.com>, xen-devel@lists.xen.org
Cc: George.Dunlap@eu.citrix.com, wei.liu2@citrix.com,
	roger.pau@citrix.com, ian.jackson@eu.citrix.com,
	stefano.stabellini@eu.citrix.com
Subject: Re: [PATCH v2 1/1] tools/hotplug: Scan xenstore once when attaching shared images files
Date: Fri, 2 Oct 2015 13:49:24 +0100	[thread overview]
Message-ID: <1443790164.11707.89.camel@citrix.com> (raw)
In-Reply-To: <a326168830d66a118e3193c3c1b5109d29762d35.1443724916.git.mlatimer@suse.com>

On Thu, 2015-10-01 at 13:07 -0600, Mike Latimer wrote:
> 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.
> 
> Prior to this patch, the entire xenstore database is walked for every instance
> of every loopback device pointing to the same shared image file. This process
> causes the block attachment process to becomes exponentially slower with every
> additional attachment of a shared image.
> 
> Rather than scanning all of xenstore for every instance of a shared loopback
> device, this patch creates a list of the major and minor numbers from all
> matching loopback devices. After generating this list, Xenstore is walked
> once, and major and minor numbers from every vbd are checked against the list.
> If a match is found, the mode of that vbd is checked for compatibility with
> the mode of the device being attached.
> 
> Signed-off-by: Mike Latimer <mlatimer@suse.com>

This looks good to me apart from one thing which is that these:
[...]
>        then
> -        echo 'local'
> +        echo "local $d"
> 
[...]
>            then
> -            echo 'guest'
> +            echo "guest $d"
[...]
>              then
> -              echo 'guest'
> +              echo "guest $d"

Are invalidating this comment on the check_sharing function regarding what
it returns:

# Prints one of
#
#    'local': the device may not be used because it is mounted in the current
#             (i.e. the privileged domain) in a way incompatible with the
#             requested mode;
#    'guest': the device may not be used because it already mounted by a guest
#             in a way incompatible with the requested mode; or
#    'ok':    the device may be used.

Ian.

  reply	other threads:[~2015-10-02 12:49 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-10-01 19:07 [PATCH v2 0/1] Block script performance with shared image files Mike Latimer
2015-10-01 19:07 ` [PATCH v2 1/1] tools/hotplug: Scan xenstore once when attaching shared images files Mike Latimer
2015-10-02 12:49   ` Ian Campbell [this message]
2015-10-05 16:38   ` Ian Jackson

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=1443790164.11707.89.camel@citrix.com \
    --to=ian.campbell@citrix.com \
    --cc=George.Dunlap@eu.citrix.com \
    --cc=ian.jackson@eu.citrix.com \
    --cc=mlatimer@suse.com \
    --cc=roger.pau@citrix.com \
    --cc=stefano.stabellini@eu.citrix.com \
    --cc=wei.liu2@citrix.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.