History

nbd: add multi-connection support

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,

Josef Bacik committed 9 years ago

Commit 9561a7a1 parent e00f4f42 files · +243 −148Browse files

Showing the changes to include/uapi/linux (1 of 2 files). Show all

Unified · Split

include/uapi/linux/nbd.h+5−4
@@ -38,11 +38,12 @@ enum { · 37 unmodified lines
38};38};
39 39
40/* values for flags field */40/* values for flags field */
41#define NBD_FLAG_HAS_FLAGS (1 << 0) /* nbd-server supports flags */41#define NBD_FLAG_HAS_FLAGS (1 << 0) /* nbd-server supports flags */
42#define NBD_FLAG_READ_ONLY (1 << 1) /* device is read-only */42#define NBD_FLAG_READ_ONLY (1 << 1) /* device is read-only */
43#define NBD_FLAG_SEND_FLUSH (1 << 2) /* can flush writeback cache */43#define NBD_FLAG_SEND_FLUSH (1 << 2) /* can flush writeback cache */
44/* there is a gap here to match userspace */44/* there is a gap here to match userspace */
45#define NBD_FLAG_SEND_TRIM (1 << 5) /* send trim/discard */45#define NBD_FLAG_SEND_TRIM (1 << 5) /* send trim/discard */
46#define NBD_FLAG_CAN_MULTI_CONN (1 << 7) /* Server supports multiple connections per export. */
46 47
47/* userspace doesn't need the nbd_device structure */48/* userspace doesn't need the nbd_device structure */
48 49