All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jinpu Wang <jinpu.wang@cloud.ionos.com>
To: Leon Romanovsky <leon@kernel.org>
Cc: Danil Kipnis <danil.kipnis@cloud.ionos.com>,
	Jack Wang <jinpuwang@gmail.com>,
	linux-block@vger.kernel.org, linux-rdma@vger.kernel.org,
	Jens Axboe <axboe@kernel.dk>,
	Christoph Hellwig <hch@infradead.org>,
	Sagi Grimberg <sagi@grimberg.me>,
	Bart Van Assche <bvanassche@acm.org>,
	Doug Ledford <dledford@redhat.com>,
	Jason Gunthorpe <jgg@ziepe.ca>, Roman Penyaev <rpenyaev@suse.de>,
	Pankaj Gupta <pankaj.gupta@cloud.ionos.com>
Subject: Re: [PATCH v9 10/25] RDMA/rtrs: server: main functionality
Date: Thu, 5 Mar 2020 14:02:26 +0100	[thread overview]
Message-ID: <CAMGffEmHdhRj=Uk1H59eCdojajVOjDt+_EGq-U9hLwX_0WgJpg@mail.gmail.com> (raw)
In-Reply-To: <20200305123509.GF184088@unreal>

On Thu, Mar 5, 2020 at 1:35 PM Leon Romanovsky <leon@kernel.org> wrote:
>
> On Thu, Mar 05, 2020 at 01:28:39PM +0100, Jinpu Wang wrote:
> > On Thu, Mar 5, 2020 at 1:16 PM Leon Romanovsky <leon@kernel.org> wrote:
> > >
> > > On Thu, Mar 05, 2020 at 01:01:08PM +0100, Danil Kipnis wrote:
> > > > On Thu, 5 Mar 2020, 09:00 Leon Romanovsky, <leon@kernel.org> wrote:
> > > >
> > > > > On Wed, Mar 04, 2020 at 12:03:32PM +0100, Jinpu Wang wrote:
> > > > > > On Tue, Mar 3, 2020 at 5:59 PM Leon Romanovsky <leon@kernel.org> wrote:
> > > > > > >
> > > > > > > On Tue, Mar 03, 2020 at 05:41:27PM +0100, Jinpu Wang wrote:
> > > > > > > > On Tue, Mar 3, 2020 at 12:37 PM Leon Romanovsky <leon@kernel.org>
> > > > > wrote:
> > > > > > > > >
> > > > > > > > > On Fri, Feb 21, 2020 at 11:47:06AM +0100, Jack Wang wrote:
> > > > > > > > > > From: Jack Wang <jinpu.wang@cloud.ionos.com>
> > > > > > > > > >
> > > > > > > > > > This is main functionality of rtrs-server module, which accepts
> > > > > > > > > > set of RDMA connections (so called rtrs session),
> > > > > creates/destroys
> > > > > > > > > > sysfs entries associated with rtrs session and notifies upper
> > > > > layer
> > > > > > > > > > (user of RTRS API) about RDMA requests or link events.
> > > > > > > > > >
> > > > > > > > > > Signed-off-by: Danil Kipnis <danil.kipnis@cloud.ionos.com>
> > > > > > > > > > Signed-off-by: Jack Wang <jinpu.wang@cloud.ionos.com>
> > > > > > > > > > ---
> > > > > > > > > >  drivers/infiniband/ulp/rtrs/rtrs-srv.c | 2164
> > > > > ++++++++++++++++++++++++
> > > > > > > > > >  1 file changed, 2164 insertions(+)
> > > > > > > > > >  create mode 100644 drivers/infiniband/ulp/rtrs/rtrs-srv.c
> > > > > > > > > >
> > > > > > > > > > diff --git a/drivers/infiniband/ulp/rtrs/rtrs-srv.c
> > > > > b/drivers/infiniband/ulp/rtrs/rtrs-srv.c
> > > > > > > > > > new file mode 100644
> > > > > > > > > > index 000000000000..e60ee6dd675d
> > > > > > > > > > --- /dev/null
> > > > > > > > > > +++ b/drivers/infiniband/ulp/rtrs/rtrs-srv.c
> > > > > > > > > > @@ -0,0 +1,2164 @@
> > > > > > > > > > +// SPDX-License-Identifier: GPL-2.0-or-later
> > > > > > > > > > +/*
> > > > > > > > > > + * RDMA Transport Layer
> > > > > > > > > > + *
> > > > > > > > > > + * Copyright (c) 2014 - 2018 ProfitBricks GmbH. All rights
> > > > > reserved.
> > > > > > > > > > + * Copyright (c) 2018 - 2019 1&1 IONOS Cloud GmbH. All rights
> > > > > reserved.
> > > > > > > > > > + * Copyright (c) 2019 - 2020 1&1 IONOS SE. All rights reserved.
> > > > > > > > > > + */
> > > > > > > > > > +
> > > > > > > > > > +#undef pr_fmt
> > > > > > > > > > +#define pr_fmt(fmt) KBUILD_MODNAME " L" __stringify(__LINE__)
> > > > > ": " fmt
> > > > > > > > > > +
> > > > > > > > > > +#include <linux/module.h>
> > > > > > > > > > +#include <linux/mempool.h>
> > > > > > > > > > +
> > > > > > > > > > +#include "rtrs-srv.h"
> > > > > > > > > > +#include "rtrs-log.h"
> > > > > > > > > > +
> > > > > > > > > > +MODULE_DESCRIPTION("RDMA Transport Server");
> > > > > > > > > > +MODULE_LICENSE("GPL");
> > > > > > > > > > +
> > > > > > > > > > +/* Must be power of 2, see mask from mr->page_size in
> > > > > ib_sg_to_pages() */
> > > > > > > > > > +#define DEFAULT_MAX_CHUNK_SIZE (128 << 10)
> > > > > > > > > > +#define DEFAULT_SESS_QUEUE_DEPTH 512
> > > > > > > > > > +#define MAX_HDR_SIZE PAGE_SIZE
> > > > > > > > > > +#define MAX_SG_COUNT ((MAX_HDR_SIZE - sizeof(struct
> > > > > rtrs_msg_rdma_read)) \
> > > > > > > > > > +                   / sizeof(struct rtrs_sg_desc))
> > > > > > > > > > +
> > > > > > > > > > +/* We guarantee to serve 10 paths at least */
> > > > > > > > > > +#define CHUNK_POOL_SZ 10
> > > > > > > > > > +
> > > > > > > > > > +static struct rtrs_rdma_dev_pd dev_pd;
> > > > > > > > > > +static mempool_t *chunk_pool;
> > > > > > > > > > +struct class *rtrs_dev_class;
> > > > > > > > > > +
> > > > > > > > > > +static int __read_mostly max_chunk_size =
> > > > > DEFAULT_MAX_CHUNK_SIZE;
> > > > > > > > > > +static int __read_mostly sess_queue_depth =
> > > > > DEFAULT_SESS_QUEUE_DEPTH;
> > > > > > > > > > +
> > > > > > > > > > +static bool always_invalidate = true;
> > > > > > > > > > +module_param(always_invalidate, bool, 0444);
> > > > > > > > > > +MODULE_PARM_DESC(always_invalidate,
> > > > > > > > > > +              "Invalidate memory registration for contiguous
> > > > > memory regions before accessing.");
> > > > > > > > > > +
> > > > > > > > > > +module_param_named(max_chunk_size, max_chunk_size, int, 0444);
> > > > > > > > > > +MODULE_PARM_DESC(max_chunk_size,
> > > > > > > > > > +              "Max size for each IO request, when change the
> > > > > unit is in byte (default: "
> > > > > > > > > > +              __stringify(DEFAULT_MAX_CHUNK_SIZE) "KB)");
> > > > > > > > > > +
> > > > > > > > > > +module_param_named(sess_queue_depth, sess_queue_depth, int,
> > > > > 0444);
> > > > > > > > > > +MODULE_PARM_DESC(sess_queue_depth,
> > > > > > > > > > +              "Number of buffers for pending I/O requests to
> > > > > allocate per session. Maximum: "
> > > > > > > > > > +              __stringify(MAX_SESS_QUEUE_DEPTH) " (default: "
> > > > > > > > > > +              __stringify(DEFAULT_SESS_QUEUE_DEPTH) ")");
> > > > > > > > >
> > > > > > > > > We don't like module parameters in the RDMA.
> > > > > > > > Hi Leon,
> > > > > > > >
> > > > > > > > These paramters are affecting resouce usage/performance, I think
> > > > > would
> > > > > > > > be good to have them as module parameters,
> > > > > > > > so admin could choose based their needs.
> > > > > > >
> > > > > > > It is premature optimization before second user comes, also it is
> > > > > > > based on the assumption that everyone uses modules, which is not true.
> > > > > > The idea to have module parameters is to cover more use cases, IMHO.
> > > > > >
> > > > > > Even you builtin the module to the kernel, you can still change the
> > > > > > module parameters
> > > > > > by passing the "moduls_name.paramters" in kernel command line, eg:
> > > > > > kvm.nx_huge_pages=true
> > > > >
> > > > > I know about that, but it doesn't make them helpful.
> > > > >
> > > > > Thanks
> > > > >
> > > > Hi Leon,
> > > >
> > > > Queue_depth and max_chunksize parameters control the tradeoff between
> > > > throuput performance and memory consumption. We do use them to set
> > > > different values for storages equipped with SSDs (fast) and on storages
> > > > equipped with HDDs (slow). The last parameter always_invaldate enforces the
> > > > invalidation of an rdma buffer before its hand over to the block layer. We
> > > > set it to no in our datacenters, since they are closed and malicious
> > > > clients are not a threat in our scenario. In general case it defaults to
> > > > yes, as requested by Jason. Our admins need to have control over those
> > > > control knobs somehow... We could make sysfs entries out of them or
> > > > something, but would it really make sense?
> > >
> > > blk_queue_nonrot() inside your code?
> > It's exported function, and also used by other drivers like
> > md/dm/target core, right?
>
> I have no clue.
After discuss with Danil, I realized, maybe you meant to use
blk_queue_nonrot to report to client,
We already did it in rnbd-srv, we pass the nonrot attribute to
rnbd-clt, so rnbd-clt will know it.
But it's not related to the module paramters here.

Thanks!

  reply	other threads:[~2020-03-05 13:02 UTC|newest]

Thread overview: 89+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-02-21 10:46 [PATCH v9 00/25] RTRS (former IBTRS) RDMA Transport Library and RNBD (former IBNBD) RDMA Network Block Device Jack Wang
2020-02-21 10:46 ` [PATCH v9 01/25] sysfs: export sysfs_remove_file_self() Jack Wang
2020-03-01  0:24   ` Bart Van Assche
2020-03-02 14:37     ` Jinpu Wang
2020-02-21 10:46 ` [PATCH v9 02/25] RDMA/rtrs: public interface header to establish RDMA connections Jack Wang
2020-03-01  0:31   ` Bart Van Assche
2020-03-02  8:39     ` Jinpu Wang
2020-03-03  9:40   ` Leon Romanovsky
2020-03-03 14:05     ` Jinpu Wang
2020-03-03 14:16       ` Leon Romanovsky
2020-03-03 14:23         ` Jinpu Wang
2020-02-21 10:46 ` [PATCH v9 03/25] RDMA/rtrs: private headers with rtrs protocol structs and helpers Jack Wang
2020-03-01  0:37   ` Bart Van Assche
2020-03-02  9:21     ` Jinpu Wang
2020-03-03  9:45   ` Leon Romanovsky
2020-03-03 13:52     ` Jinpu Wang
2020-03-03 14:05       ` Jason Gunthorpe
2020-03-03 16:13         ` Jinpu Wang
2020-02-21 10:47 ` [PATCH v9 04/25] RDMA/rtrs: core: lib functions shared between client and server modules Jack Wang
2020-03-01  0:47   ` Bart Van Assche
2020-03-02  8:40     ` Jinpu Wang
2020-03-03  9:57   ` Leon Romanovsky
2020-03-04 11:21     ` Jinpu Wang
2020-02-21 10:47 ` [PATCH v9 05/25] RDMA/rtrs: client: private header with client structs and functions Jack Wang
2020-03-01  0:51   ` Bart Van Assche
2020-03-02 13:49     ` Jinpu Wang
2020-03-02 16:13       ` Bart Van Assche
2020-03-02 16:18         ` Jinpu Wang
2020-02-21 10:47 ` [PATCH v9 06/25] RDMA/rtrs: client: main functionality Jack Wang
2020-03-01  1:33   ` Bart Van Assche
2020-03-02 13:20     ` Danil Kipnis
2020-03-03 16:04       ` Bart Van Assche
2020-03-04 16:43         ` Jinpu Wang
2020-03-04 16:49           ` Jason Gunthorpe
2020-03-05 11:26             ` Jinpu Wang
2020-03-05 13:27               ` Jason Gunthorpe
2020-03-05 13:37                 ` Jinpu Wang
2020-03-05 13:54                   ` Jason Gunthorpe
2020-03-06 13:33                     ` Jinpu Wang
2020-02-21 10:47 ` [PATCH v9 07/25] RDMA/rtrs: client: statistics functions Jack Wang
2020-03-03 11:28   ` Leon Romanovsky
2020-03-03 11:46     ` Jinpu Wang
2020-02-21 10:47 ` [PATCH v9 08/25] RDMA/rtrs: client: sysfs interface functions Jack Wang
2020-02-21 10:47 ` [PATCH v9 09/25] RDMA/rtrs: server: private header with server structs and functions Jack Wang
2020-02-21 10:47 ` [PATCH v9 10/25] RDMA/rtrs: server: main functionality Jack Wang
2020-03-01  1:42   ` Bart Van Assche
2020-03-02 14:39     ` Jinpu Wang
2020-03-03 11:37   ` Leon Romanovsky
2020-03-03 16:41     ` Jinpu Wang
2020-03-03 16:59       ` Leon Romanovsky
2020-03-04 11:03         ` Jinpu Wang
2020-03-05  8:00           ` Leon Romanovsky
     [not found]             ` <CAHg0Huyc=pn1=WSKGLjm+c8AcchyQ8q7JS-0ToQyiBRgpGG=jA@mail.gmail.com>
2020-03-05 12:16               ` Leon Romanovsky
2020-03-05 12:28                 ` Jinpu Wang
2020-03-05 12:35                   ` Leon Romanovsky
2020-03-05 13:02                     ` Jinpu Wang [this message]
2020-02-21 10:47 ` [PATCH v9 11/25] RDMA/rtrs: server: statistics functions Jack Wang
2020-02-21 10:47 ` [PATCH v9 12/25] RDMA/rtrs: server: sysfs interface functions Jack Wang
2020-02-21 10:47 ` [PATCH v9 13/25] RDMA/rtrs: include client and server modules into kernel compilation Jack Wang
2020-02-21 10:47 ` [PATCH v9 14/25] RDMA/rtrs: a bit of documentation Jack Wang
2020-02-21 10:47 ` [PATCH v9 15/25] block/rnbd: private headers with rnbd protocol structs and helpers Jack Wang
2020-03-01  2:12   ` Bart Van Assche
2020-03-02 16:37     ` Jinpu Wang
2020-02-21 10:47 ` [PATCH v9 16/25] block/rnbd: client: private header with client structs and functions Jack Wang
2020-03-01  2:26   ` Bart Van Assche
2020-03-02 14:59     ` Jinpu Wang
2020-02-21 10:47 ` [PATCH v9 17/25] block/rnbd: client: main functionality Jack Wang
2020-03-01  2:46   ` Bart Van Assche
2020-03-02 14:58     ` Jinpu Wang
2020-02-21 10:47 ` [PATCH v9 18/25] block/rnbd: client: sysfs interface functions Jack Wang
2020-02-21 10:47 ` [PATCH v9 19/25] block/rnbd: server: private header with server structs and functions Jack Wang
2020-03-01  2:47   ` Bart Van Assche
2020-03-02 10:07     ` Danil Kipnis
2020-02-21 10:47 ` [PATCH v9 20/25] block/rnbd: server: main functionality Jack Wang
2020-03-01  2:58   ` Bart Van Assche
2020-03-02  9:58     ` Danil Kipnis
2020-03-03  5:57       ` Bart Van Assche
2020-02-21 10:47 ` [PATCH v9 21/25] block/rnbd: server: functionality for IO submission to file or block dev Jack Wang
2020-03-01  3:09   ` Bart Van Assche
2020-03-02 10:06     ` Danil Kipnis
2020-03-03 16:20       ` Jinpu Wang
2020-03-03 16:28         ` Bart Van Assche
2020-03-03 16:43           ` Jinpu Wang
2020-02-21 10:47 ` [PATCH v9 22/25] block/rnbd: server: sysfs interface functions Jack Wang
2020-02-21 10:47 ` [PATCH v9 23/25] block/rnbd: include client and server modules into kernel compilation Jack Wang
2020-02-21 10:47 ` [PATCH v9 24/25] block/rnbd: a bit of documentation Jack Wang
2020-02-21 10:47 ` [PATCH v9 25/25] MAINTAINERS: Add maintainers for RNBD/RTRS modules Jack Wang
2020-03-03  9:28 ` [PATCH v9 00/25] RTRS (former IBTRS) RDMA Transport Library and RNBD (former IBNBD) RDMA Network Block Device Leon Romanovsky
2020-03-04 14:06   ` Jinpu Wang

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='CAMGffEmHdhRj=Uk1H59eCdojajVOjDt+_EGq-U9hLwX_0WgJpg@mail.gmail.com' \
    --to=jinpu.wang@cloud.ionos.com \
    --cc=axboe@kernel.dk \
    --cc=bvanassche@acm.org \
    --cc=danil.kipnis@cloud.ionos.com \
    --cc=dledford@redhat.com \
    --cc=hch@infradead.org \
    --cc=jgg@ziepe.ca \
    --cc=jinpuwang@gmail.com \
    --cc=leon@kernel.org \
    --cc=linux-block@vger.kernel.org \
    --cc=linux-rdma@vger.kernel.org \
    --cc=pankaj.gupta@cloud.ionos.com \
    --cc=rpenyaev@suse.de \
    --cc=sagi@grimberg.me \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.