Linux-RDMA Archive on lore.kernel.org
 help / color / Atom feed
From: Leon Romanovsky <leon@kernel.org>
To: Haakon Bugge <haakon.bugge@oracle.com>
Cc: Gioh Kim <gi-oh.kim@ionos.com>, Jinpu Wang <jinpu.wang@ionos.com>,
	OFED mailing list <linux-rdma@vger.kernel.org>,
	Bart Van Assche <bvanassche@acm.org>,
	Doug Ledford <dledford@redhat.com>,
	Jason Gunthorpe <jgg@ziepe.ca>,
	Haris Iqbal <haris.iqbal@ionos.com>,
	Gioh Kim <gi-oh.kim@cloud.ionos.com>
Subject: Re: [PATCHv2 for-next 1/3] RDMA/rtrs-clt: Print more info when an error happens
Date: Tue, 13 Apr 2021 09:43:17 +0300
Message-ID: <YHU9hZfkNEDy94+s@unreal> (raw)
In-Reply-To: <1DFC1F4B-FF53-4AA8-B5FB-9F57B378339E@oracle.com>

On Tue, Apr 13, 2021 at 05:31:24AM +0000, Haakon Bugge wrote:
> 
> 
> > On 12 Apr 2021, at 19:34, Leon Romanovsky <leon@kernel.org> wrote:
> > 
> > On Mon, Apr 12, 2021 at 04:00:55PM +0200, Gioh Kim wrote:
> >> On Mon, Apr 12, 2021 at 2:54 PM Jinpu Wang <jinpu.wang@ionos.com> wrote:
> >>> 
> >>> On Mon, Apr 12, 2021 at 2:41 PM Leon Romanovsky <leon@kernel.org> wrote:
> >>>> 
> >>>> On Mon, Apr 12, 2021 at 02:22:51PM +0200, Jinpu Wang wrote:
> >>>>> On Tue, Apr 6, 2021 at 2:41 PM Leon Romanovsky <leon@kernel.org> wrote:
> >>>>>> 
> >>>>>> On Tue, Apr 06, 2021 at 02:36:37PM +0200, Gioh Kim wrote:
> >>>>>>> From: Gioh Kim <gi-oh.kim@cloud.ionos.com>
> >>>>>>> 
> >>>>>>> Client prints only error value and it is not enough for debugging.
> >>>>>>> 
> >>>>>>> 1. When client receives an error from server:
> >>>>>>> the client does not only print the error value but also
> >>>>>>> more information of server connection.
> >>>>>>> 
> >>>>>>> 2. When client failes to send IO:
> >>>>>>> the client gets an error from RDMA layer. It also
> >>>>>>> print more information of server connection.
> >>>>>>> 
> >>>>>>> Signed-off-by: Gioh Kim <gi-oh.kim@ionos.com>
> >>>>>>> Signed-off-by: Jack Wang <jinpu.wang@ionos.com>
> >>>>>>> ---
> >>>>>>> drivers/infiniband/ulp/rtrs/rtrs-clt.c | 33 ++++++++++++++++++++++----
> >>>>>>> 1 file changed, 29 insertions(+), 4 deletions(-)
> >>>>>>> 
> >>>>>>> diff --git a/drivers/infiniband/ulp/rtrs/rtrs-clt.c b/drivers/infiniband/ulp/rtrs/rtrs-clt.c
> >>>>>>> index 5062328ac577..a534b2b09e13 100644
> >>>>>>> --- a/drivers/infiniband/ulp/rtrs/rtrs-clt.c
> >>>>>>> +++ b/drivers/infiniband/ulp/rtrs/rtrs-clt.c
> >>>>>>> @@ -437,6 +437,11 @@ static void complete_rdma_req(struct rtrs_clt_io_req *req, int errno,
> >>>>>>>      req->in_use = false;
> >>>>>>>      req->con = NULL;
> >>>>>>> 
> >>>>>>> +     if (unlikely(errno)) {
> >>>>>> 
> >>>>>> I'm sorry, but all your patches are full of these likely/unlikely cargo
> >>>>>> cult. Can you please provide supportive performance data or delete all
> >>>>>> likely/unlikely in all rtrs code?
> >>>>> 
> >>>>> Hi Leon,
> >>>>> 
> >>>>> All the likely/unlikely from the non-fast path was removed as you
> >>>>> suggested in the past.
> >>>>> This one is on IO path, my understanding is for the fast path, with
> >>>>> likely/unlikely macro,
> >>>>> the compiler will optimize the code for better branch prediction.
> >>>> 
> >>>> In theory yes, in practice. gcc 10 generated same assembly code when I
> >>>> placed likely() and replaced it with unlikely() later.
> >> 
> >> Even-thought gcc 10 generated the same assembly code,
> >> there is no guarantee for gcc 11 or gcc 12.
> >> 
> >> I am reviewing rtrs source file and have found some unnecessary likely/unlikely.
> >> But I think likely/unlikely are necessary for extreme cases.
> >> I will have a discussion with my colleagues and inform you of the result.
> > 
> > Please come with performance data.
> 
> I think the best way to gather performance data is not remove the likely/unlikely, but swap their definitions. Less coding and more pronounced difference - if any.

In theory, it will multiply by 2 gain/loss, which is nice to see if
likely/ulikely change something.

Thanks

> 
> 
> Thxs, Håkon
> 

  reply index

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-04-06 12:36 [PATCHv2 for-next 0/3] Improve debugging messages Gioh Kim
2021-04-06 12:36 ` [PATCHv2 for-next 1/3] RDMA/rtrs-clt: Print more info when an error happens Gioh Kim
2021-04-06 12:41   ` Leon Romanovsky
2021-04-09  9:57     ` Gioh Kim
2021-04-12 12:22     ` Jinpu Wang
2021-04-12 12:41       ` Leon Romanovsky
2021-04-12 12:53         ` Jinpu Wang
2021-04-12 14:00           ` Gioh Kim
2021-04-12 17:34             ` Leon Romanovsky
2021-04-13  5:31               ` Haakon Bugge
2021-04-13  6:43                 ` Leon Romanovsky [this message]
2021-04-13 13:11                   ` Gioh Kim
2021-04-13 19:31                     ` Leon Romanovsky
2021-04-13 22:52   ` Jason Gunthorpe
2021-04-06 12:36 ` [PATCHv2 for-next 2/3] RDMA/rtrs-srv: More debugging info when fail to send reply Gioh Kim
2021-04-06 12:36 ` [PATCHv2 for-next 3/3] RDMA/rtrs-clt: Simplify error message Gioh Kim
2021-04-13 22:52 ` [PATCHv2 for-next 0/3] Improve debugging messages Jason Gunthorpe

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=YHU9hZfkNEDy94+s@unreal \
    --to=leon@kernel.org \
    --cc=bvanassche@acm.org \
    --cc=dledford@redhat.com \
    --cc=gi-oh.kim@cloud.ionos.com \
    --cc=gi-oh.kim@ionos.com \
    --cc=haakon.bugge@oracle.com \
    --cc=haris.iqbal@ionos.com \
    --cc=jgg@ziepe.ca \
    --cc=jinpu.wang@ionos.com \
    --cc=linux-rdma@vger.kernel.org \
    /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

Linux-RDMA Archive on lore.kernel.org

Archives are clonable:
	git clone --mirror https://lore.kernel.org/linux-rdma/0 linux-rdma/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 linux-rdma linux-rdma/ https://lore.kernel.org/linux-rdma \
		linux-rdma@vger.kernel.org
	public-inbox-index linux-rdma

Example config snippet for mirrors

Newsgroup available over NNTP:
	nntp://nntp.lore.kernel.org/org.kernel.vger.linux-rdma


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git