ceph: rbd option listing and tcp_nodelay support
PATCH 1/1 ceph: rbd option listing and tcp_nodelay support
From: Chaitanya Huilgol <[email protected]>
Option keys supported by libceph and rbd modules is readable as a comma separated string via /sys/bus/rbd/options read-only interface. This will allow user app (rbd cli) to check for supported option keys before passing options to the kernel and remain compatible with older kernels which do not support a particular feature.
Messenger specific options moved to messenger layer. tcp_nodelay(default)/no_tcp_nodelay option added for setting TCP_NODELAY on messenger socket connections. Covers both rbd and cephfs
--- drivers/block/rbd.c | 21 +++++++++++++++++ fs/ceph/super.c | 5 +++- include/linux/ceph/libceph.h | 5 ++-- include/linux/ceph/messenger.h | 26 +++++++++++++++++++-- net/ceph/ceph_common.c | 52 ++++++++++++++++++++++++++++++++++++++---- net/ceph/messenger.c | 33 ++++++++++++++++++++++----- 6 files changed, 126 insertions(+), 16 deletions(-)
drivers/block/rbd.c +21 -0
@@ -423,6 +423,7 @@ static ssize_t rbd_add_single_major(struct bus_type *bus, const char *buf, size_t count);static ssize_t rbd_remove_single_major (struct bus_type *bus,const char *buf,size_t count); +static ssize_t rbd_enumerate_options (struct bus_type *bus,char *buf);static int rbd_dev_image_probe (struct rbd_device *rbd_dev,bool mapping);static void rbd_spec_put (struct rbd_spec *spec);
@@ -440,12 +441,14 @@ static BUS_ATTR(add, S_IWUSR, NULL, rbd_add); static BUS_ATTR(remove, S_IWUSR, NULL, rbd_remove); static BUS_ATTR(add_single_major, S_IWUSR, NULL, rbd_add_single_major); static BUS_ATTR(remove_single_major, S_IWUSR, NULL, rbd_remove_single_major); +static BUS_ATTR(options, S_IRUSR, rbd_enumerate_options, NULL);static struct attribute *rbd_bus_attrs[] = { &bus_attr_add.attr, &bus_attr_remove.attr, &bus_attr_add_single_major.attr, &bus_attr_remove_single_major.attr, + &bus_attr_options.attr,NULL , };
@@ -746,6 +749,12 @@ static match_table_t rbd_opts_tokens = { {-1, NULL} }; +/* +* Supported options comma separated string. Readable by the rbd cli, so that +* an informed decision can be made on passing options to the kernel modules. +*/ +static const char *rbd_supported_option_keys ="rw" ; +struct rbd_options {bool read_only; };
@@ -5569,6 +5578,18 @@ static ssize_t rbd_remove_single_major(struct bus_type *bus,return do_rbd_remove (bus, buf, count); } +static ssize_t rbd_enumerate_options (struct bus_type *bus, +char *buf) +{ +ssize_t sz; + sz =snprintf (buf,PAGE_SIZE ,"%s" , rbd_supported_option_keys); +if ((sz +1 ) <PAGE_SIZE ) { + sz +=snprintf (buf + sz,PAGE_SIZE - sz,",%s" , +ceph_get_supported_options ()); + } + sz +=1 ;/* '0' String Termination */ +return sz; +}/* * create control files in sysfs * /sys/bus/rbd/...
fs/ceph/super.c +4 -1
@@ -423,7 +423,10 @@ static int ceph_show_options(struct seq_file *m, struct dentry *root)seq_printf (m,",fsid=%pU" , &opt->fsid);if (opt->flags &CEPH_OPT_NOSHARE )seq_puts (m,",noshare" ); -if (opt->flags &CEPH_OPT_NOCRC ) +if (ceph_test_msgr_opt (&opt->msgr_options, +CEPH_MSGR_OPT_NO_TCP_NODELAY )) +seq_puts (m,",no_tcp_nodelay" ); +if (ceph_test_msgr_opt (&opt->msgr_options,CEPH_MSGR_OPT_NOCRC ))seq_puts (m,",nocrc" );if (opt->name)
include/linux/ceph/libceph.h +3 -2
@@ -28,8 +28,7 @@#define CEPH_OPT_FSID (1<<0)#define CEPH_OPT_NOSHARE (1<<1)/* don't share client with other sbs */ #define CEPH_OPT_MYIP (1<<2)/* specified my ip */ -#define CEPH_OPT_NOCRC (1<<3)/* no data crc on writes */ -#define CEPH_OPT_NOMSGAUTH (1<<4)/* not require cephx message signature */ +#define CEPH_OPT_NOMSGAUTH (1<<3)/* not require cephx message signature */ #define CEPH_OPT_DEFAULT (0)
@@ -42,6 +41,7 @@ struct ceph_options {int flags;struct ceph_fsid fsid;struct ceph_entity_addr my_addr; +struct ceph_messenger_options msgr_options;int mount_timeout;int osd_idle_ttl;int osd_keepalive_timeout;
@@ -190,6 +190,7 @@ extern struct ceph_options *ceph_parse_options(char *options, const char *dev_name, const char *dev_name_end, int (*parse_extra_token)(char *c, void *private), void *private); +extern const char *ceph_get_supported_options (void );extern void ceph_destroy_options (struct ceph_options *opt);extern int ceph_compare_options (struct ceph_options *new_opt,struct ceph_client *client);
include/linux/ceph/messenger.h +24 -2
@@ -51,12 +51,34 @@ struct ceph_connection_operations {/* use format string %s%d */ #define ENTITY_NAME (n) ceph_entity_type_name((n).type), le64_to_cpu((n).num) +/* +* Messenger specific ceph options +*/ +struct ceph_messenger_options { +u32 flags; +}; + +#define CEPH_MSGR_OPT_NOCRC (1<<0)/* no data crc on writes */ +#define CEPH_MSGR_OPT_NO_TCP_NODELAY (1<<1)/* No TCP_NODELAY on con sock */ +#define CEPH_MSGR_OPT_DEFAULT (0) + +#define ceph_messenger_options_init (_msgr_opts) \ + ((_msgr_opts)->flags = CEPH_MSGR_OPT_DEFAULT) + +#define ceph_set_msgr_opt (_msgr_opts, _opt) \ + ((_msgr_opts)->flags |= _opt) +#define ceph_clr_msgr_opt (_msgr_opts, _opt) \ + ((_msgr_opts)->flags &= ~(_opt)) +#define ceph_test_msgr_opt (_msgr_opts, _opt) \ + (!!((_msgr_opts)->flags & (_opt))) + +struct ceph_messenger {struct ceph_entity_inst inst;/* my name+address */ struct ceph_entity_addr my_enc_addr;atomic_t stopping; -bool nocrc; +struct ceph_messenger_options *options;/* * the global_seq counts connections i (attempt to) initiate
@@ -264,7 +286,7 @@ extern void ceph_messenger_init(struct ceph_messenger *msgr,struct ceph_entity_addr *myaddr, u64 supported_features, u64 required_features, - bool nocrc); + struct ceph_messenger_options *msgr_options); extern void ceph_con_init(struct ceph_connection *con, void *private, const struct ceph_connection_operations *ops,
net/ceph/ceph_common.c +47 -5
105 lines not on this page · raw message
net/ceph/messenger.c +27 -6
@@ -469,6 +469,21 @@ static void set_sock_callbacks(struct socket *sock,/* * socket helpers */ +static void ceph_tcp_set_sock_options (struct ceph_connection *con) +{ +int rc; + +if (!ceph_test_msgr_opt (con->msgr->options, +CEPH_MSGR_OPT_NO_TCP_NODELAY )) { +/* Not requested to disable TCP_NODELAY, set it by default */ +int optval =1 ; + rc =kernel_setsockopt (con->sock,IPPROTO_TCP ,TCP_NODELAY , + (char *)&optval,sizeof (optval)); +if (rc !=0 ) { +pr_warn ("Warn: CEPH_CON_OPT: TCP_NODELAY: Fails=%d\n" , rc); + } + } +}/* * initiate connection to a remote socket.
@@ -513,6 +528,9 @@ static int ceph_tcp_connect(struct ceph_connection *con)sk_set_memalloc (sock->sk); con->sock = sock; +/* process socket options if any */ +ceph_tcp_set_sock_options (con); +return 0 ; }
@@ -749,7 +767,6 @@ void ceph_con_init(struct ceph_connection *con, void *private, }EXPORT_SYMBOL (ceph_con_init); -/* * We maintain a global counter to order connection attempts. Get * a unique seq greater than @gt.
@@ -1511,7 +1528,8 @@ static int write_partial_message_data(struct ceph_connection *con) {struct ceph_msg *msg = con->out_msg;struct ceph_msg_data_cursor *cursor = &msg->cursor; -bool do_datacrc = !con->msgr->nocrc; +bool do_datacrc = !ceph_test_msgr_opt (con->msgr->options, +CEPH_MSGR_OPT_NOCRC );u32 crc;dout ("%s %p msg %p\n" , __func__, con, msg);
@@ -2212,7 +2230,8 @@ static int read_partial_msg_data(struct ceph_connection *con) {struct ceph_msg *msg = con->in_msg;struct ceph_msg_data_cursor *cursor = &msg->cursor; -const bool do_datacrc = !con->msgr->nocrc; +const bool do_datacrc = !ceph_test_msgr_opt (con->msgr->options, +CEPH_MSGR_OPT_NOCRC );struct page *page;size_t page_offset;size_t length;
@@ -2258,7 +2277,8 @@ static int read_partial_message(struct ceph_connection *con)int end;int ret;unsigned int front_len, middle_len, data_len; -bool do_datacrc = !con->msgr->nocrc; +bool do_datacrc = !ceph_test_msgr_opt (con->msgr->options, +CEPH_MSGR_OPT_NOCRC );bool need_sign = (con->peer_features &CEPH_FEATURE_MSG_AUTH );u64 seq;u32 crc;
@@ -2922,7 +2942,7 @@ void ceph_messenger_init(struct ceph_messenger *msgr,struct ceph_entity_addr *myaddr, u64 supported_features, u64 required_features, - bool nocrc) + struct ceph_messenger_options *msgr_options) { msgr->supported_features = supported_features; msgr->required_features = required_features;
@@ -2936,7 +2956,8 @@ void ceph_messenger_init(struct ceph_messenger *msgr, msgr->inst.addr.type =0 ;get_random_bytes (&msgr->inst.addr.nonce,sizeof (msgr->inst.addr.nonce));encode_my_addr (msgr); - msgr->nocrc = nocrc; +BUG_ON (msgr_options ==NULL ); + msgr->options = msgr_options;atomic_set (&msgr->stopping,0 );
Signature · 1 line
1.9.1
Quoted 12 lines · Chaitanya Huilgol
From: Chaitanya Huilgol <[email protected]>
Option keys supported by libceph and rbd modules is readable as a comma separated string via
/sys/bus/rbd/optionsread-only interface. This will allow user app (rbd cli) to check for supported option keys before passing options to the kernel and remain compatible with older kernels which do not support a particular feature.
Messenger specific options moved to messenger layer. tcp_nodelay(default)/no_tcp_nodelay option added for settingTCP_NODELAYon messenger socket connections. Covers both rbd and cephfs
Hi Chaitanya,
Just couple high level comments - I'll take a closer look tomorrow.
Option listing and tcp_nodelay should be two separate patches
rbd: add option sysfs attiribute
libceph: add tcp_nodelay option
or something like that. The "Messenger specific options moved to messenger layer" part should probably be a separate patch as well.
More importantly, I'm missing the whole point of exporting supported rbd options. Adding a new libceph option does not break compatibility in either way, as old kernels will simply fail to map/mount if a bad (unknown, let through by new rbd cli) option is encountered.
Thanks,
Ilya
Ilya,
Regarding supported attribute list, I think it could be a step towards better usability experience during rbd map command. Presently, if user gives wrong option or unsupported option it just errors out saying 'sysfs write failed' or so. User has no idea what went wrong. We can use this supported list from kernel module from rbd cli to show proper error message to the user.
Another feature that we have implemented is rbd cli to consult the /etc/ceph/ceph.conf and take the rbd kernel supported options from there automatically if user has not provided any option during rbd map. User provided option during rbd map will always get priority though. Let me know your thought on this.
Thanks & Regards
Somnath
-----Original Message-----
From: [email protected] [mailto:[email protected]] On Behalf Of Ilya Dryomov
Sent: Wednesday, January 21, 2015 11:19 AM
To: Chaitanya Huilgol
Cc: Ceph Development
Subject: Re: [PATCH] ceph: rbd option listing and tcp_nodelay support
Quoted 11 lines · Chaitanya Huilgol
From: Chaitanya Huilgol <[email protected]>
Option keys supported by libceph and rbd modules is readable as a comma separated string via
/sys/bus/rbd/optionsread-only interface. This will allow user app (rbd cli) to check for supported option keys before passing options to the kernel and remain compatible with older kernels which do not support a particular feature. Messenger specific options moved to messenger layer. tcp_nodelay(default)/no_tcp_nodelay option added for settingTCP_NODELAYon messenger socket connections. Covers both rbd and cephfs
Hi Chaitanya,
Just couple high level comments - I'll take a closer look tomorrow.
Option listing and tcp_nodelay should be two separate patches
rbd: add option sysfs attiribute
libceph: add tcp_nodelay option
or something like that. The "Messenger specific options moved to messenger layer" part should probably be a separate patch as well.
More importantly, I'm missing the whole point of exporting supported rbd options. Adding a new libceph option does not break compatibility in either way, as old kernels will simply fail to map/mount if a bad (unknown, let through by new rbd cli) option is encountered.
Thanks,
Ilya
--
To unsubscribe from this list: send the line "unsubscribe ceph-devel" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
________________________________
PLEASE NOTE: The information contained in this electronic mail message is intended only for the use of the designated recipient(s) named above. If the reader of this message is not the intended recipient, you are hereby notified that you have received this message in error and that any review, dissemination, distribution, or copying of this message is strictly prohibited. If you have received this communication in error, please notify the sender by telephone or e-mail (as shown above) immediately and destroy any and all copies of this message in your possession (whether hard copies or electronically stored copies).
Quoted 2 lines · Somnath Roy
Ilya,
Regarding supported attribute list, I think it could be a step towards better usability experience during rbd map command. Presently, if user gives wrong option or unsupported option it just errors out saying 'sysfs write failed' or so. User has no idea what went wrong.
# rbd map -o foobar test rbd: unknown map option 'foobar' rbd: couldn't parse map options
# rbd map -o fsid=foobar test rbd: invalid fsid value 'foobar' rbd: couldn't parse map options
Since about a year ago, rbd cli would try to parse supplied options. Of course, the list of options it knows about is static, but your attribute wouldn't solve that problem (or rather it will, but only for simple boolean yes/no options, like crc or tcp_nodelay) because we also try to sanity check the value, as the above fsid example shows.
Quoted 2 lines
We can use this supported list from kernel module from rbd cli to show proper error message to the user.
Another feature that we have implemented is rbd cli to consult the/etc/ceph/ceph.confand take the rbd kernel supported options from there automatically if user has not provided any option during rbd map. User provided option during rbd map will always get priority though.
Did you mean "and take rbd kernel map options", i.e. take default map options from ceph.conf? I think that's a good idea.
Thanks,
Ilya
<<inline
-----Original Message-----
From: Ilya Dryomov [mailto:[email protected]]
Sent: Wednesday, January 21, 2015 11:47 AM
To: Somnath Roy
Cc: Chaitanya Huilgol; Ceph Development
Subject: Re: [PATCH] ceph: rbd option listing and tcp_nodelay support
Quoted 2 lines · Somnath Roy
Ilya,
Regarding supported attribute list, I think it could be a step towards better usability experience during rbd map command. Presently, if user gives wrong option or unsupported option it just errors out saying 'sysfs write failed' or so. User has no idea what went wrong.
# rbd map -o foobar test rbd: unknown map option 'foobar' rbd: couldn't parse map options
# rbd map -o fsid=foobar test rbd: invalid fsid value 'foobar' rbd: couldn't parse map options
Since about a year ago, rbd cli would try to parse supplied options.
Of course, the list of options it knows about is static, but your attribute wouldn't solve that problem (or rather it will, but only for simple boolean yes/no options, like crc or tcp_nodelay) because we also try to sanity check the value, as the above fsid example shows.
[Somnath] Hmm..I missed that it seems. Yes, for Boolean attributes kernel compatibility check should be able to flag that.
Quoted 2 lines
We can use this supported list from kernel module from rbd cli to show proper error message to the user.
Another feature that we have implemented is rbd cli to consult the/etc/ceph/ceph.confand take the rbd kernel supported options from there automatically if user has not provided any option during rbd map. User provided option during rbd map will always get priority though.
Did you mean "and take rbd kernel map options", i.e. take default map options from ceph.conf? I think that's a good idea. [Somnath] Yes, whatever is common, like crc (ms_nocrc in ceph.conf) , tcp_nodelay (ms_tcp_nodelay in ceph.conf) Thanks,
Ilya
________________________________
PLEASE NOTE: The information contained in this electronic mail message is intended only for the use of the designated recipient(s) named above. If the reader of this message is not the intended recipient, you are hereby notified that you have received this message in error and that any review, dissemination, distribution, or copying of this message is strictly prohibited. If you have received this communication in error, please notify the sender by telephone or e-mail (as shown above) immediately and destroy any and all copies of this message in your possession (whether hard copies or electronically stored copies).
Hi Ilya,
Thanks for the initial review, I will send three separate patches for this.
The primary reason for the options listing is to add automatic option setting from ceph.conf without user intervention. Without this the rbd cli cannot make an informed decision on passing an option automatically to the kernel. The changes for these in the rbd cli are completed and tested and we will soon be sending a pull request for that, currently tcp_nodelay is the only auto option being added, but the changes are generic enough for other options to be added as well. Note that the option listing is only for the option keys indicating if an option is supported for eg, crc & nocrc options are represented by "crc" option key. Let me know if we want to change this to list out all the options as-is.
User provided options override the auto options and are not verified for compatibility with the kernel.
Also, we are expecting few more options to come with the RDMA support and hence needed a separate options placeholder for the messenger layer (For eg type of connection to be initiated (RDMA vs TCP/IP).
If you have any other preliminary comments, please do send them and I will incorporate them in the revised separate patches.
Regards,
Chaitanya
-----Original Message-----
From: [email protected] [mailto:[email protected]] On Behalf Of Somnath Roy
Sent: Thursday, January 22, 2015 1:32 AM
To: Ilya Dryomov
Cc: Chaitanya Huilgol; Ceph Development
Subject: RE: [PATCH] ceph: rbd option listing and tcp_nodelay support
<<inline
-----Original Message-----
From: Ilya Dryomov [mailto:[email protected]]
Sent: Wednesday, January 21, 2015 11:47 AM
To: Somnath Roy
Cc: Chaitanya Huilgol; Ceph Development
Subject: Re: [PATCH] ceph: rbd option listing and tcp_nodelay support
Quoted 2 lines · Somnath Roy
Ilya,
Regarding supported attribute list, I think it could be a step towards better usability experience during rbd map command. Presently, if user gives wrong option or unsupported option it just errors out saying 'sysfs write failed' or so. User has no idea what went wrong.
# rbd map -o foobar test rbd: unknown map option 'foobar' rbd: couldn't parse map options
# rbd map -o fsid=foobar test rbd: invalid fsid value 'foobar' rbd: couldn't parse map options
Since about a year ago, rbd cli would try to parse supplied options.
Of course, the list of options it knows about is static, but your attribute wouldn't solve that problem (or rather it will, but only for simple boolean yes/no options, like crc or tcp_nodelay) because we also try to sanity check the value, as the above fsid example shows.
[Somnath] Hmm..I missed that it seems. Yes, for Boolean attributes kernel compatibility check should be able to flag that.
Quoted 2 lines
We can use this supported list from kernel module from rbd cli to show proper error message to the user.
Another feature that we have implemented is rbd cli to consult the/etc/ceph/ceph.confand take the rbd kernel supported options from there automatically if user has not provided any option during rbd map. User provided option during rbd map will always get priority though.
Did you mean "and take rbd kernel map options", i.e. take default map options from ceph.conf? I think that's a good idea. [Somnath] Yes, whatever is common, like crc (ms_nocrc in ceph.conf) , tcp_nodelay (ms_tcp_nodelay in ceph.conf) Thanks,
Ilya
________________________________
PLEASE NOTE: The information contained in this electronic mail message is intended only for the use of the designated recipient(s) named above. If the reader of this message is not the intended recipient, you are hereby notified that you have received this message in error and that any review, dissemination, distribution, or copying of this message is strictly prohibited. If you have received this communication in error, please notify the sender by telephone or e-mail (as shown above) immediately and destroy any and all copies of this message in your possession (whether hard copies or electronically stored copies).
N r y b X ǧv ^ ){.n + z ]z {ay ʇڙ ,j f h z w j:+v w j m zZ+ ݢj" ! i
Quoted 24 lines · Somnath Roy
<<inline
-----Original Message-----
From: Ilya Dryomov [mailto:[email protected]]
Sent: Wednesday, January 21, 2015 11:47 AM
To: Somnath Roy
Cc: Chaitanya Huilgol; Ceph Development
Subject: Re: [PATCH] ceph: rbd option listing andtcp_nodelaysupportQuoted 2 lines · Somnath Roy
Ilya,
Regarding supported attribute list, I think it could be a step towards better usability experience during rbd map command. Presently, if user gives wrong option or unsupported option it just errors out saying 'sysfs write failed' or so. User has no idea what went wrong.# rbd map -o foobar test rbd: unknown map option 'foobar' rbd: couldn't parse map options# rbd map -o fsid=foobar test rbd: invalid fsid value 'foobar' rbd: couldn't parse map optionsSince about a year ago, rbd cli would try to parse supplied options.
Of course, the list of options it knows about is static, but your attribute wouldn't solve that problem (or rather it will, but only for simple boolean yes/no options, like crc ortcp_nodelay) because we also try to sanity check the value, as the above fsid example shows.
Quoted 7 lines
[Somnath] Hmm..I missed that it seems. Yes, for Boolean attributes kernel compatibility check should be able to flag that.
Quoted 2 lines
We can use this supported list from kernel module from rbd cli to show proper error message to the user.
Another feature that we have implemented is rbd cli to consult the/etc/ceph/ceph.confand take the rbd kernel supported options from there automatically if user has not provided any option during rbd map. User provided option during rbd map will always get priority though.Did you mean "and take rbd kernel map options", i.e. take default map options from ceph.conf? I think that's a good idea. [Somnath] Yes, whatever is common, like crc (
ms_nocrcin ceph.conf) ,tcp_nodelay(ms_tcp_nodelayin ceph.conf)
I was thinking more along the lines of a static "rbd default map options" field in ceph.conf, e.g.
rbd default map options = "nocrc,tcp_nodelay"
which can then be overwritten by rbd map -o.
The thing is, kernel msgr will always be a stripped down version of userspace msgr, and on top of that we are bound to have some kernel client specific options. Having both "rbd default map options" and pulling out values for whatever options are common sounds like it can be a bit confusing - we will have three layers of options settings to deal with (common options, rbd_default_map_options, rbd map -o). Sage, do you think it's worth it?
Thanks,
Ilya
Hi Ilya,
We have two options here,
(1) Have kernel export supported options and pass on supported options from ceph.conf automatically if user has not specified the same via rbd -o - this is what is done in the current patch Or
(2) As suggested by you, Have a default map options in ceph.conf and pass all options which have not be overridden by rbd -o
As I understand, there is no need to do both - we need to choose between the two.
After your suggestion, I am leaning towards option-2 as it give more krbd specific control. However, the onus now rests on the user to add default options based on what the kernel supports (for this we can still provide the options listing via the sysbus interface, say with 'rbd map supported_options' cli)
Regards,
Chaitanya
-----Original Message-----
From: [email protected] [mailto:[email protected]] On Behalf Of Ilya Dryomov
Sent: Thursday, January 22, 2015 2:24 PM
To: Somnath Roy; Sage Weil
Cc: Chaitanya Huilgol; Ceph Development
Subject: Re: [PATCH] ceph: rbd option listing and tcp_nodelay support
Quoted 24 lines · Somnath Roy
<<inline
-----Original Message-----
From: Ilya Dryomov [mailto:[email protected]]
Sent: Wednesday, January 21, 2015 11:47 AM
To: Somnath Roy
Cc: Chaitanya Huilgol; Ceph Development
Subject: Re: [PATCH] ceph: rbd option listing andtcp_nodelaysupportQuoted 2 lines · Somnath Roy
Ilya,
Regarding supported attribute list, I think it could be a step towards better usability experience during rbd map command. Presently, if user gives wrong option or unsupported option it just errors out saying 'sysfs write failed' or so. User has no idea what went wrong.# rbd map -o foobar test rbd: unknown map option 'foobar' rbd: couldn't parse map options# rbd map -o fsid=foobar test rbd: invalid fsid value 'foobar' rbd: couldn't parse map optionsSince about a year ago, rbd cli would try to parse supplied options.
Of course, the list of options it knows about is static, but your attribute wouldn't solve that problem (or rather it will, but only for simple boolean yes/no options, like crc ortcp_nodelay) because we also try to sanity check the value, as the above fsid example shows.
Quoted 8 lines
[Somnath] Hmm..I missed that it seems. Yes, for Boolean attributes kernel compatibility check should be able to flag that.
Quoted 2 lines
We can use this supported list from kernel module from rbd cli to show proper error message to the user.
Another feature that we have implemented is rbd cli to consult the/etc/ceph/ceph.confand take the rbd kernel supported options from there automatically if user has not provided any option during rbd map. User provided option during rbd map will always get priority though.Did you mean "and take rbd kernel map options", i.e. take default map options from ceph.conf? I think that's a good idea. [Somnath] Yes, whatever is common, like crc (
ms_nocrcin ceph.conf) ,tcp_nodelay(ms_tcp_nodelayin ceph.conf)
I was thinking more along the lines of a static "rbd default map options" field in ceph.conf, e.g.
rbd default map options = "nocrc,tcp_nodelay"
which can then be overwritten by rbd map -o.
The thing is, kernel msgr will always be a stripped down version of userspace msgr, and on top of that we are bound to have some kernel client specific options. Having both "rbd default map options" and pulling out values for whatever options are common sounds like it can be a bit confusing - we will have three layers of options settings to deal with (common options, rbd_default_map_options, rbd map -o). Sage, do you think it's worth it?
Thanks,
Ilya
--
To unsubscribe from this list: send the line "unsubscribe ceph-devel" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
________________________________
PLEASE NOTE: The information contained in this electronic mail message is intended only for the use of the designated recipient(s) named above. If the reader of this message is not the intended recipient, you are hereby notified that you have received this message in error and that any review, dissemination, distribution, or copying of this message is strictly prohibited. If you have received this communication in error, please notify the sender by telephone or e-mail (as shown above) immediately and destroy any and all copies of this message in your possession (whether hard copies or electronically stored copies).
Quoted 9 lines · Chaitanya Huilgol
Hi Ilya,
We have two options here,
(1) Have kernel export supported options and pass on supported options from ceph.conf automatically if user has not specified the same via rbd -o - this is what is done in the current patch Or
(2) As suggested by you, Have a default map options in ceph.conf and pass all options which have not be overridden by rbd -oAs I understand, there is no need to do both - we need to choose between the two.
After your suggestion, I am leaning towards option-2 as it give more krbd specific control. However, the onus now rests on the user to add default options based on what the kernel supports (for this we can still provide the options listing via the sysbus interface, say with 'rbd mapsupported_options' cli)
And the question then is: do we really need this supported_options cli? rbd map options are treated very much like filesystem mount options - the set of supported options is determined by the kernel version and is documented in rbd(8) man page.
(There aren't any kernel version details in there currently, but that's simply because all existing options have been added in bulk a long time ago, and we can fix that omission with the addition of tcp_nodelay.)
Thanks,
Ilya
Ok, I think for now we should first get the core feature support in, if the changes in the messenger layer look fine, then I will generate two patches
- messenger specific options
- tcp_nodelay support
As a next set we can implement the krbd_default_map_options in the ceph.conf and pass it down.
Let me know.
Regards,
Chaitanya
-----Original Message-----
From: Ilya Dryomov [mailto:[email protected]]
Sent: Thursday, January 22, 2015 6:20 PM
To: Chaitanya Huilgol
Cc: Somnath Roy; Sage Weil; Chaitanya Huilgol; Ceph Development
Subject: Re: [PATCH] ceph: rbd option listing and tcp_nodelay support
Quoted 9 lines · Chaitanya Huilgol
Hi Ilya,
We have two options here,
(1) Have kernel export supported options and pass on supported options from ceph.conf automatically if user has not specified the same via rbd -o - this is what is done in the current patch Or
(2) As suggested by you, Have a default map options in ceph.conf and pass all options which have not be overridden by rbd -o
Quoted 6 lines
As I understand, there is no need to do both - we need to choose between the two. After your suggestion, I am leaning towards option-2 as it give more krbd specific control. However, the onus now rests on the user to add default options based on what the kernel supports (for this we can still provide the options listing via the sysbus interface, say with 'rbd map
supported_options' cli)
And the question then is: do we really need this supported_options cli?
rbd map options are treated very much like filesystem mount options - the set of supported options is determined by the kernel version and is documented in rbd(8) man page.
(There aren't any kernel version details in there currently, but that's simply because all existing options have been added in bulk a long time ago, and we can fix that omission with the addition of tcp_nodelay.)
Thanks,
Ilya
________________________________
PLEASE NOTE: The information contained in this electronic mail message is intended only for the use of the designated recipient(s) named above. If the reader of this message is not the intended recipient, you are hereby notified that you have received this message in error and that any review, dissemination, distribution, or copying of this message is strictly prohibited. If you have received this communication in error, please notify the sender by telephone or e-mail (as shown above) immediately and destroy any and all copies of this message in your possession (whether hard copies or electronically stored copies).
Quoted 7 lines · Chaitanya Huilgol
Ok, I think for now we should first get the core feature support in, if the changes in the messenger layer look fine, then I will generate two patches
- messenger specific options
-tcp_nodelaysupportAs a next set we can implement the
krbd_default_map_optionsin the ceph.conf and pass it down.Let me know.
Honestly, I don't see the point of splitting options the way you did either. There is just too much boilerplate for something as simple as couple of flags: a struct with a single field to which ceph_messenger then has a pointer, all the msgr opt macros (why?), the fact that libceph options are now split between libceph.h and messenger.h, etc.
I'd just pass struct ceph_options * to ceph_messenger_init() and be done with it.
Thanks,
Ilya
Well, there was no ceph_options pointer in the messenger layer and no_crc flag was being passed into the messenger as an additional flag and maintained within the messenger again as bool no_crc, I inferred that it was intentional and we did not want the generic options in the messenger layer. If it is fine to have messenger point back to the ceph_options, then that’s the easiest way to do it. Also, we would have some additional option coming in with RDMA support (xio messenger) which would be very messenger specific, so having a messenger options had made sense.
Regards,
Chaitanya
-----Original Message-----
From: Ilya Dryomov [mailto:[email protected]]
Sent: Thursday, January 22, 2015 7:59 PM
To: Chaitanya Huilgol
Cc: Somnath Roy; Sage Weil; Chaitanya Huilgol; Ceph Development
Subject: Re: [PATCH] ceph: rbd option listing and tcp_nodelay support
Quoted 9 lines · Chaitanya Huilgol
Ok, I think for now we should first get the core feature support in, if the changes in the messenger layer look fine, then I will generate two patches
- messenger specific options
-tcp_nodelaysupportAs a next set we can implement the
krbd_default_map_optionsin the ceph.conf and pass it down.Let me know.
Honestly, I don't see the point of splitting options the way you did either. There is just too much boilerplate for something as simple as couple of flags: a struct with a single field to which ceph_messenger then has a pointer, all the msgr opt macros (why?), the fact that libceph options are now split between libceph.h and messenger.h, etc.
I'd just pass struct ceph_options * to ceph_messenger_init() and be done with it.
Thanks,
Ilya
________________________________
PLEASE NOTE: The information contained in this electronic mail message is intended only for the use of the designated recipient(s) named above. If the reader of this message is not the intended recipient, you are hereby notified that you have received this message in error and that any review, dissemination, distribution, or copying of this message is strictly prohibited. If you have received this communication in error, please notify the sender by telephone or e-mail (as shown above) immediately and destroy any and all copies of this message in your possession (whether hard copies or electronically stored copies).
Quoted 2 lines · Chaitanya Huilgol
Well, there was no
ceph_optionspointer in the messenger layer andno_crcflag was being passed into the messenger as an additional flag and maintained within the messenger again as boolno_crc, I inferred that it was intentional and we did not want the generic options in the messenger layer. If it is fine to have messenger point back to theceph_options, then that’s the easiest way to do it. Also, we would have some additional option coming in with RDMA support (xio messenger) which would be very messenger specific, so having a messenger options had made sense.
OK, we'll see how to refactor it nicely then.
Given that tcp_nodelay is just a bool, for now I'd suggest the simplest and least invasive patch:
- add bool tcp_nodelay field to ceph_messenger
- add bool tcp_nodelay parameter to ceph_messenger_init()
- call ceph_messenger_init() with ceph_test_opt(client, TCP_NODELAY)
Thanks,
Ilya
--
To unsubscribe from this list: send the line "unsubscribe ceph-devel" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html
Ok, will make the changes and send it as a single tcp_nodelay patch. One final clarification, do we want the TCP_NODELAY set by default or only when requested?
-----Original Message-----
From: Ilya Dryomov [mailto:[email protected]]
Sent: Thursday, January 22, 2015 8:38 PM
To: Chaitanya Huilgol
Cc: Somnath Roy; Sage Weil; Ceph Development
Subject: Re: [PATCH] ceph: rbd option listing and tcp_nodelay support
Quoted 2 lines · Chaitanya Huilgol
Well, there was no
ceph_optionspointer in the messenger layer andno_crcflag was being passed into the messenger as an additional flag and maintained within the messenger again as boolno_crc, I inferred that it was intentional and we did not want the generic options in the messenger layer. If it is fine to have messenger point back to theceph_options, then that’s the easiest way to do it. Also, we would have some additional option coming in with RDMA support (xio messenger) which would be very messenger specific, so having a messenger options had made sense.
OK, we'll see how to refactor it nicely then.
Given that tcp_nodelay is just a bool, for now I'd suggest the simplest and least invasive patch:
- add bool tcp_nodelay field to ceph_messenger
- add bool tcp_nodelay parameter to ceph_messenger_init()
- call ceph_messenger_init() with ceph_test_opt(client, TCP_NODELAY)
Thanks,
Ilya
________________________________
PLEASE NOTE: The information contained in this electronic mail message is intended only for the use of the designated recipient(s) named above. If the reader of this message is not the intended recipient, you are hereby notified that you have received this message in error and that any review, dissemination, distribution, or copying of this message is strictly prohibited. If you have received this communication in error, please notify the sender by telephone or e-mail (as shown above) immediately and destroy any and all copies of this message in your possession (whether hard copies or electronically stored copies).
Quoted 1 line · Chaitanya Huilgol
Ok, will make the changes and send it as a single
tcp_nodelaypatch. One final clarification, do we want theTCP_NODELAYset by default or only when requested?
On by default I think.
Thanks,
Ilya
Quoted 9 lines · Chaitanya Huilgol
Hi Ilya,
We have two options here,
(1) Have kernel export supported options and pass on supported options from ceph.conf automatically if user has not specified the same via rbd -o - this is what is done in the current patch Or
(2) As suggested by you, Have a default map options in ceph.conf and pass all options which have not be overridden by rbd -oAs I understand, there is no need to do both - we need to choose between the two.
After your suggestion, I am leaning towards option-2 as it give more krbd specific control. However, the onus now rests on the user to add default options based on what the kernel supports (for this we can still provide the options listing via the sysbus interface, say with 'rbd mapsupported_options' cli)
I also think #2 is simpler and less surprising for the user. I think we can keep it simple!
sage
Yes, I agree with you on this Ilya. That will be less confusing to the user.
Thanks & Regards
Somnath
-----Original Message-----
From: Ilya Dryomov [mailto:[email protected]]
Sent: Thursday, January 22, 2015 12:54 AM
To: Somnath Roy; Sage Weil
Cc: Chaitanya Huilgol; Ceph Development
Subject: Re: [PATCH] ceph: rbd option listing and tcp_nodelay support
Quoted 24 lines · Somnath Roy
<<inline
-----Original Message-----
From: Ilya Dryomov [mailto:[email protected]]
Sent: Wednesday, January 21, 2015 11:47 AM
To: Somnath Roy
Cc: Chaitanya Huilgol; Ceph Development
Subject: Re: [PATCH] ceph: rbd option listing andtcp_nodelaysupportQuoted 2 lines · Somnath Roy
Ilya,
Regarding supported attribute list, I think it could be a step towards better usability experience during rbd map command. Presently, if user gives wrong option or unsupported option it just errors out saying 'sysfs write failed' or so. User has no idea what went wrong.# rbd map -o foobar test rbd: unknown map option 'foobar' rbd: couldn't parse map options# rbd map -o fsid=foobar test rbd: invalid fsid value 'foobar' rbd: couldn't parse map optionsSince about a year ago, rbd cli would try to parse supplied options.
Of course, the list of options it knows about is static, but your attribute wouldn't solve that problem (or rather it will, but only for simple boolean yes/no options, like crc ortcp_nodelay) because we also try to sanity check the value, as the above fsid example shows.
Quoted 8 lines
[Somnath] Hmm..I missed that it seems. Yes, for Boolean attributes kernel compatibility check should be able to flag that.
Quoted 2 lines
We can use this supported list from kernel module from rbd cli to show proper error message to the user.
Another feature that we have implemented is rbd cli to consult the/etc/ceph/ceph.confand take the rbd kernel supported options from there automatically if user has not provided any option during rbd map. User provided option during rbd map will always get priority though.Did you mean "and take rbd kernel map options", i.e. take default map options from ceph.conf? I think that's a good idea. [Somnath] Yes, whatever is common, like crc (
ms_nocrcin ceph.conf) ,tcp_nodelay(ms_tcp_nodelayin ceph.conf)
I was thinking more along the lines of a static "rbd default map options" field in ceph.conf, e.g.
rbd default map options = "nocrc,tcp_nodelay"
which can then be overwritten by rbd map -o.
The thing is, kernel msgr will always be a stripped down version of userspace msgr, and on top of that we are bound to have some kernel client specific options. Having both "rbd default map options" and pulling out values for whatever options are common sounds like it can be a bit confusing - we will have three layers of options settings to deal with (common options, rbd_default_map_options, rbd map -o). Sage, do you think it's worth it?
Thanks,
Ilya
________________________________
PLEASE NOTE: The information contained in this electronic mail message is intended only for the use of the designated recipient(s) named above. If the reader of this message is not the intended recipient, you are hereby notified that you have received this message in error and that any review, dissemination, distribution, or copying of this message is strictly prohibited. If you have received this communication in error, please notify the sender by telephone or e-mail (as shown above) immediately and destroy any and all copies of this message in your possession (whether hard copies or electronically stored copies).