Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1527756

Re: [PATCH][V4] nbd: add multi-connection support

Path csiph.com!1.us.feeder.erje.net!feeder.erje.net!2.eu.feeder.erje.net!feeds.phibee-telecom.net!news.panservice.it!bofh.it!news.nic.it!robomod
From Wouter Verhelst <w@uter.be>
Newsgroups linux.kernel
Subject Re: [PATCH][V4] nbd: add multi-connection support
Date Tue, 22 Nov 2016 18:40:02 +0100
Message-ID <sGnd0-1Py-43@gated-at.bofh.it> (permalink)
References <sGnd0-1Py-45@gated-at.bofh.it>
X-Greylist delayed 967 seconds by postgrey-1.27 at vger.kernel.org; Tue, 22 Nov 2016 12:35:24 EST
MIME-Version 1.0
Content-Type text/plain; charset=us-ascii
Content-Disposition inline
X-Speed Gates' Law: Every 18 months, the speed of software halves.
Organization none
User-Agent NeoMutt/20161104 (1.7.1)
Sender robomod@news.nic.it
List-ID <linux-kernel.vger.kernel.org>
X-Mailing-List linux-kernel@vger.kernel.org
Approved robomod@news.nic.it
Lines 50
X-Original-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
X-Original-Date Tue, 22 Nov 2016 18:19:11 +0100
X-Original-Message-ID <20161122171911.bvzlhli24lscbqa3@grep.be>
X-Original-References <1479414450-7999-1-git-send-email-jbacik@fb.com>
X-Original-Sender linux-kernel-owner@vger.kernel.org
Xref csiph.com linux.kernel:1527756

Show key headers only | View raw


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

Back to linux.kernel | Previous | Next | Find similar | Unroll thread


Thread

Re: [PATCH][V4] nbd: add multi-connection support Wouter Verhelst <w@uter.be> - 2016-11-22 18:40 +0100

csiph-web