diff mbox

ceph: rbd option listing and tcp_nodelay support

Message ID alpine.DEB.2.10.1501220029310.28090@Ubuntu-VirtualBox (mailing list archive)
State New, archived
Headers show

Commit Message

Chaitanya Huilgol Jan. 21, 2015, 7 p.m. UTC
From: Chaitanya Huilgol <chaitanya.huilgol@sandisk.com>

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

Signed-off-by: Chaitanya Huilgol <chaitanya.huilgol@sandisk.com>
---
 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(-)

Comments

Ilya Dryomov Jan. 21, 2015, 7:18 p.m. UTC | #1
On Wed, Jan 21, 2015 at 10:00 PM, Chaitanya Huilgol
<chaitanya.huilgol@gmail.com> wrote:
> From: Chaitanya Huilgol <chaitanya.huilgol@sandisk.com>
>
> 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

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 majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Somnath Roy Jan. 21, 2015, 7:29 p.m. UTC | #2
SWx5YSwNClJlZ2FyZGluZyBzdXBwb3J0ZWQgYXR0cmlidXRlIGxpc3QsICBJIHRoaW5rIGl0IGNv
dWxkIGJlIGEgc3RlcCB0b3dhcmRzIGJldHRlciB1c2FiaWxpdHkgZXhwZXJpZW5jZSBkdXJpbmcg
cmJkIG1hcCBjb21tYW5kLiBQcmVzZW50bHksIGlmIHVzZXIgZ2l2ZXMgd3Jvbmcgb3B0aW9uIG9y
IHVuc3VwcG9ydGVkIG9wdGlvbiBpdCBqdXN0IGVycm9ycyBvdXQgc2F5aW5nICdzeXNmcyB3cml0
ZSBmYWlsZWQnIG9yIHNvLiBVc2VyIGhhcyBubyBpZGVhIHdoYXQgd2VudCB3cm9uZy4NCldlIGNh
biB1c2UgdGhpcyBzdXBwb3J0ZWQgbGlzdCBmcm9tIGtlcm5lbCBtb2R1bGUgZnJvbSByYmQgY2xp
IHRvIHNob3cgcHJvcGVyIGVycm9yIG1lc3NhZ2UgdG8gdGhlIHVzZXIuDQpBbm90aGVyIGZlYXR1
cmUgdGhhdCB3ZSBoYXZlIGltcGxlbWVudGVkIGlzIHJiZCBjbGkgdG8gY29uc3VsdCB0aGUgL2V0
Yy9jZXBoL2NlcGguY29uZiBhbmQgdGFrZSB0aGUgcmJkIGtlcm5lbCBzdXBwb3J0ZWQgb3B0aW9u
cyBmcm9tIHRoZXJlIGF1dG9tYXRpY2FsbHkgaWYgdXNlciBoYXMgbm90IHByb3ZpZGVkIGFueSBv
cHRpb24gZHVyaW5nIHJiZCBtYXAuIFVzZXIgcHJvdmlkZWQgb3B0a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HN0cmljdGx5IHByb2hpYml0ZWQuIElmIHlvdSBoYXZlIHJlY2VpdmVkIHRoaXMgY29t
bXVuaWNhdGlvbiBpbiBlcnJvciwgcGxlYXNlIG5vdGlmeSB0aGUgc2VuZGVyIGJ5IHRlbGVwaG9u
ZSBvciBlLW1haWwgKGFzIHNob3duIGFib3ZlKSBpbW1lZGlhdGVseSBhbmQgZGVzdHJveSBhbnkg
YW5kIGFsbCBjb3BpZXMgb2YgdGhpcyBtZXNzYWdlIGluIHlvdXIgcG9zc2Vzc2lvbiAod2hldGhl
ciBoYXJkIGNvcGllcyBvciBlbGVjdHJvbmljYWxseSBzdG9yZWQgY29waWVzKS4NCg0K
--
To unsubscribe from this list: send the line "unsubscribe ceph-devel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Ilya Dryomov Jan. 21, 2015, 7:46 p.m. UTC | #3
On Wed, Jan 21, 2015 at 10:29 PM, Somnath Roy <Somnath.Roy@sandisk.com> wrote:
> 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.

> 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.

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
--
To unsubscribe from this list: send the line "unsubscribe ceph-devel" in
the body of a message to majordom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1pbmF0aW9uLCBkaXN0cmlidXRpb24sIG9yIGNvcHlpbmcgb2Yg
dGhpcyBtZXNzYWdlIGlzIHN0cmljdGx5IHByb2hpYml0ZWQuIElmIHlvdSBoYXZlIHJlY2VpdmVk
IHRoaXMgY29tbXVuaWNhdGlvbiBpbiBlcnJvciwgcGxlYXNlIG5vdGlmeSB0aGUgc2VuZGVyIGJ5
IHRlbGVwaG9uZSBvciBlLW1haWwgKGFzIHNob3duIGFib3ZlKSBpbW1lZGlhdGVseSBhbmQgZGVz
dHJveSBhbnkgYW5kIGFsbCBjb3BpZXMgb2YgdGhpcyBtZXNzYWdlIGluIHlvdXIgcG9zc2Vzc2lv
biAod2hldGhlciBoYXJkIGNvcGllcyBvciBlbGVjdHJvbmljYWxseSBzdG9yZWQgY29waWVzKS4N
Cg0K
--
To unsubscribe from this list: send the line "unsubscribe ceph-devel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Chaitanya Huilgol Jan. 22, 2015, 2:33 a.m. UTC | #5
SGkgSWx5YSwNCg0KVGhhbmtzIGZvciB0aGUgaW5pdGlhbCByZXZpZXcsIEkgd2lsbCBzZW5kIHRo
cmVlIHNlcGFyYXRlIHBhdGNoZXMgZm9yIHRoaXMuDQpUaGUgcHJpbWFyeSByZWFzb24gZm9yIHRo
ZSBvcHRpb25zIGxpc3RpbmcgaXMgdG8gYWRkIGF1dG9tYXRpYyBvcHRpb24gc2V0dGluZyBmcm9t
IGNlcGguY29uZiB3aXRob3V0IHVzZXIgaW50ZXJ2ZW50aW9uLiBXaXRob3V0IHRoaXMgdGhlIHJi
ZCBjbGkgY2Fubm90IG1ha2UgYW4gaW5mb3JtZWQgZGVjaXNpb24gb24gcGFzc2luZyBhbiBvcHRp
b24gYXV0b21hdGljYWxseSB0byB0aGUga2VybmVsLiBUaGUgY2hhbmdlcyBmb3IgdGhlc2UgaW4g
dGhlIHJiZCBjbGkgYXJlIGNvbXBsZXRlZCBhbmQgdG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B6WisgICAgIN2iaiIgICEgaQ0K
--
To unsubscribe from this list: send the line "unsubscribe ceph-devel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Ilya Dryomov Jan. 22, 2015, 8:54 a.m. UTC | #6
On Wed, Jan 21, 2015 at 11:02 PM, Somnath Roy <Somnath.Roy@sandisk.com> wrote:
> <<inline
>
> -----Original Message-----
> From: Ilya Dryomov [mailto:ilya.dryomov@inktank.com]
> 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
>
> On Wed, Jan 21, 2015 at 10:29 PM, Somnath Roy <Somnath.Roy@sandisk.com> wrote:
>> 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.
>
>> 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.
>
> 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)

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 majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Chaitanya Huilgol Jan. 22, 2015, 9:54 a.m. UTC | #7
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: ceph-devel-owner@vger.kernel.org [mailto:ceph-devel-owner@vger.kernel.org] 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

On Wed, Jan 21, 2015 at 11:02 PM, Somnath Roy <Somnath.Roy@sandisk.com> wrote:
> <<inline

>

> -----Original Message-----

> From: Ilya Dryomov [mailto:ilya.dryomov@inktank.com]

> 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

>

> On Wed, Jan 21, 2015 at 10:29 PM, Somnath Roy <Somnath.Roy@sandisk.com> wrote:

>> 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.

>

>> 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.

>

> 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)


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 majordomo@vger.kernel.org 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).
Ilya Dryomov Jan. 22, 2015, 12:50 p.m. UTC | #8
On Thu, Jan 22, 2015 at 12:54 PM, Chaitanya Huilgol
<Chaitanya.Huilgol@sandisk.com> wrote:
> 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)

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
--
To unsubscribe from this list: send the line "unsubscribe ceph-devel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Chaitanya Huilgol Jan. 22, 2015, 1:33 p.m. UTC | #9
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:ilya.dryomov@inktank.com]

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

On Thu, Jan 22, 2015 at 12:54 PM, Chaitanya Huilgol <Chaitanya.Huilgol@sandisk.com> wrote:
> 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)


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).
Ilya Dryomov Jan. 22, 2015, 2:28 p.m. UTC | #10
On Thu, Jan 22, 2015 at 4:33 PM, Chaitanya Huilgol
<Chaitanya.Huilgol@sandisk.com> wrote:
> 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.

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
--
To unsubscribe from this list: send the line "unsubscribe ceph-devel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Chaitanya Huilgol Jan. 22, 2015, 2:39 p.m. UTC | #11
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:ilya.dryomov@inktank.com]

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

On Thu, Jan 22, 2015 at 4:33 PM, Chaitanya Huilgol <Chaitanya.Huilgol@sandisk.com> wrote:
> 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.


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).
Sage Weil Jan. 22, 2015, 2:40 p.m. UTC | #12
On Thu, 22 Jan 2015, Chaitanya Huilgol wrote:
> 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)

I also think #2 is simpler and less surprising for the user.  I think we 
can keep it simple!

sage
--
To unsubscribe from this list: send the line "unsubscribe ceph-devel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Ilya Dryomov Jan. 22, 2015, 3:08 p.m. UTC | #13
On Thu, Jan 22, 2015 at 5:39 PM, Chaitanya Huilgol
<Chaitanya.Huilgol@sandisk.com> wrote:
> 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.

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 majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Chaitanya Huilgol Jan. 22, 2015, 4:48 p.m. UTC | #14
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:ilya.dryomov@inktank.com]

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

On Thu, Jan 22, 2015 at 5:39 PM, Chaitanya Huilgol <Chaitanya.Huilgol@sandisk.com> wrote:
> 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.


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).
Ilya Dryomov Jan. 22, 2015, 4:52 p.m. UTC | #15
On Thu, Jan 22, 2015 at 7:48 PM, Chaitanya Huilgol
<Chaitanya.Huilgol@sandisk.com> wrote:
> 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?

On by default I think.

Thanks,

                Ilya
--
To unsubscribe from this list: send the line "unsubscribe ceph-devel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Somnath Roy Jan. 22, 2015, 5:42 p.m. UTC | #16
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:ilya.dryomov@inktank.com]

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

On Wed, Jan 21, 2015 at 11:02 PM, Somnath Roy <Somnath.Roy@sandisk.com> wrote:
> <<inline

>

> -----Original Message-----

> From: Ilya Dryomov [mailto:ilya.dryomov@inktank.com]

> 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

>

> On Wed, Jan 21, 2015 at 10:29 PM, Somnath Roy <Somnath.Roy@sandisk.com> wrote:

>> 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.

>

>> 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.

>

> 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)


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).
diff mbox

Patch

diff --git a/drivers/block/rbd.c b/drivers/block/rbd.c
index e818c2a..507fd16 100644
--- a/drivers/block/rbd.c
+++ b/drivers/block/rbd.c
@@ -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/...
diff --git a/fs/ceph/super.c b/fs/ceph/super.c
index 50f06cd..4632ae4 100644
--- a/fs/ceph/super.c
+++ b/fs/ceph/super.c
@@ -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)
diff --git a/include/linux/ceph/libceph.h b/include/linux/ceph/libceph.h
index 8b11a79..9306a47 100644
--- a/include/linux/ceph/libceph.h
+++ b/include/linux/ceph/libceph.h
@@ -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);
diff --git a/include/linux/ceph/messenger.h b/include/linux/ceph/messenger.h
index d9d396c..471f622 100644
--- a/include/linux/ceph/messenger.h
+++ b/include/linux/ceph/messenger.h
@@ -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,
diff --git a/net/ceph/ceph_common.c b/net/ceph/ceph_common.c
index 5d5ab67..25f1515 100644
--- a/net/ceph/ceph_common.c
+++ b/net/ceph/ceph_common.c
@@ -239,6 +239,8 @@  enum {
 	Opt_nocrc,
 	Opt_cephx_require_signatures,
 	Opt_nocephx_require_signatures,
+	Opt_tcp_nodelay,
+	Opt_no_tcp_nodelay,
 };
 
 static match_table_t opt_tokens = {
@@ -259,8 +261,28 @@  static match_table_t opt_tokens = {
 	{Opt_nocrc, "nocrc"},
 	{Opt_cephx_require_signatures, "cephx_require_signatures"},
 	{Opt_nocephx_require_signatures, "nocephx_require_signatures"},
+	{Opt_tcp_nodelay, "tcp_nodelay"},
+	{Opt_no_tcp_nodelay, "no_tcp_nodelay"},
 	{-1, NULL}
 };
+/*
+ * Supported option keys. Readable by the rbd cli, so that an informed
+ * decision can be made on passing options to the kernel modules.
+ */
+static const char *libceph_supported_options_keys =
+	"osdtimeout,"
+	"osdkeepalive,"
+	"mount_timeout,"
+	"osd_idle_ttl,"
+	"fsid,"
+	"name,"
+	"secret,"
+	"key,"
+	"ip,"
+	"share,"
+	"crc,"
+	"cephx_require_signatures,"
+	"tcp_nodelay";
 
 void ceph_destroy_options(struct ceph_options *opt)
 {
@@ -320,8 +342,7 @@  out:
 	return err;
 }
 
-struct ceph_options *
-ceph_parse_options(char *options, const char *dev_name,
+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)
@@ -350,6 +371,7 @@  ceph_parse_options(char *options, const char *dev_name,
 	opt->osd_keepalive_timeout = CEPH_OSD_KEEPALIVE_DEFAULT;
 	opt->mount_timeout = CEPH_MOUNT_TIMEOUT_DEFAULT; /* seconds */
 	opt->osd_idle_ttl = CEPH_OSD_IDLE_TTL_DEFAULT;   /* seconds */
+	ceph_messenger_options_init(&opt->msgr_options);
 
 	/* get mon ip(s) */
 	/* ip1[:port1][,ip2[:port2]...] */
@@ -452,11 +474,14 @@  ceph_parse_options(char *options, const char *dev_name,
 			break;
 
 		case Opt_crc:
-			opt->flags &= ~CEPH_OPT_NOCRC;
+			ceph_clr_msgr_opt(&opt->msgr_options,
+				CEPH_MSGR_OPT_NOCRC);
 			break;
 		case Opt_nocrc:
-			opt->flags |= CEPH_OPT_NOCRC;
+			ceph_set_msgr_opt(&opt->msgr_options,
+				CEPH_MSGR_OPT_NOCRC);
 			break;
+
 		case Opt_cephx_require_signatures:
 			opt->flags &= ~CEPH_OPT_NOMSGAUTH;
 			break;
@@ -464,6 +489,15 @@  ceph_parse_options(char *options, const char *dev_name,
 			opt->flags |= CEPH_OPT_NOMSGAUTH;
 			break;
 
+		case Opt_tcp_nodelay:
+			ceph_clr_msgr_opt(&opt->msgr_options,
+				CEPH_MSGR_OPT_NO_TCP_NODELAY);
+			break;
+		case Opt_no_tcp_nodelay:
+			ceph_set_msgr_opt(&opt->msgr_options,
+				CEPH_MSGR_OPT_NO_TCP_NODELAY);
+			break;
+
 		default:
 			BUG_ON(token);
 		}
@@ -478,6 +512,14 @@  out:
 }
 EXPORT_SYMBOL(ceph_parse_options);
 
+
+const char* ceph_get_supported_options(void)
+{
+    return  libceph_supported_options_keys;
+}
+EXPORT_SYMBOL(ceph_get_supported_options);
+
+
 u64 ceph_client_id(struct ceph_client *client)
 {
 	return client->monc.auth->global_id;
@@ -521,7 +563,7 @@  struct ceph_client *ceph_create_client(struct ceph_options *opt, void *private,
 	ceph_messenger_init(&client->msgr, myaddr,
 		client->supported_features,
 		client->required_features,
-		ceph_test_opt(client, NOCRC));
+		&opt->msgr_options);
 
 	/* subsystems */
 	err = ceph_monc_init(&client->monc, client);
diff --git a/net/ceph/messenger.c b/net/ceph/messenger.c
index 33a2f20..9a056fe 100644
--- a/net/ceph/messenger.c
+++ b/net/ceph/messenger.c
@@ -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);