mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Wouter Verhelst <w@uter.be>
To: Josef Bacik <jbacik@fb.com>
Cc: axboe@fb.com, linux-block@vger.kernel.org,
	linux-kernel@vger.kernel.org, kernel-team@fb.com,
	alex@alex.org.uk, nbd-general@lists.sourceforge.net
Subject: Re: [PATCH][V4] nbd: add multi-connection support
Date: Tue, 22 Nov 2016 18:19:11 +0100	[thread overview]
Message-ID: <20161122171911.bvzlhli24lscbqa3@grep.be> (raw)
In-Reply-To: <1479414450-7999-1-git-send-email-jbacik@fb.com>

Hi Josef,

[cc to nbd-general added]

On Thu, Nov 17, 2016 at 03:27:30PM -0500, Josef Bacik wrote:
> NBD can become contended on its single connection.  We have to serialize all
> writes and we can only process one read response at a time.  Fix this by
> allowing userspace to provide multiple connections to a single nbd device.  This
> coupled with block-mq drastically increases performance in multi-process cases.
> Thanks,
> 
> Signed-off-by: Josef Bacik <jbacik@fb.com>
> ---
> V3->V4:
> -Fixed a problem where fast completes (or early completes) would crash because
>  we were still accessing the bio's on the submit side.
> -Added a flag to disallow multi-connection support if the server doesn't
>  explicitly allow for them.
[...]
> +		if (num_connections > 1 &&
> +		    !(nbd->flags & NBD_FLAG_CAN_MULTI_CONN)) {
> +			dev_err(disk_to_dev(nbd->disk), "server does not support multiple connections per device.\n");
> +			goto out_err;
> +		}

I'm not sure whether the kernel needs to check this. I agree that the
flag can be useful, but it's probably something for userspace to check,
rather than for the kernel; I could imagine a --force parameter to be
useful in some corner cases.

Having said that, implementing such a parameter could also be done by
artificially adding particular flags, so I'm certainly not opposed to
this.

[...]
> +#define NBD_FLAG_CAN_MULTI_CONN	(1 << 6)	/* Server supports multiple connections per export. */

NAK, that is already specified in the protocol spec at
https://github.com/NetworkBlockDevice/nbd/blob/master/doc/proto.md to be
NBD_FLAG_SEND_WRITE_ZEROES. Bit 7 is also taken already, so please use
bit 8 instead.

(I'll reserve that bit in that document to be "export is multi-conn safe" in a
minute)

-- 
< ron> I mean, the main *practical* problem with C++, is there's like a dozen
       people in the world who think they really understand all of its rules,
       and pretty much all of them are just lying to themselves too.
 -- #debian-devel, OFTC, 2016-02-12

      reply	other threads:[~2016-11-22 17:35 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-11-17 20:27 Josef Bacik
2016-11-22 17:19 ` Wouter Verhelst [this message]

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=20161122171911.bvzlhli24lscbqa3@grep.be \
    --to=w@uter.be \
    --cc=alex@alex.org.uk \
    --cc=axboe@fb.com \
    --cc=jbacik@fb.com \
    --cc=kernel-team@fb.com \
    --cc=linux-block@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=nbd-general@lists.sourceforge.net \
    /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

all inboxes | Powered by JetHome®