From: Doug Ledford <dledford-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
To: Roland Dreier <roland-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>
Cc: "linux-rdma-u79uwXL29TY76Z2rM5mHXA@public.gmane.org"
<linux-rdma-u79uwXL29TY76Z2rM5mHXA@public.gmane.org>,
Sean Hefty <sean.hefty-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>,
Eli Cohen <eli-LDSdmyG8hGV8YrgS2mwiifqBs+8SCbDb@public.gmane.org>
Subject: Re: [PATCH] IB/cma: use cached gids
Date: Tue, 10 Sep 2013 21:37:49 -0400 [thread overview]
Message-ID: <522FC96D.3030206@redhat.com> (raw)
In-Reply-To: <CAG4TOxOTPPNdzpNmRkiwsjEcGEoVG1=H2e6YHddXFnAGXHFL6w-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
On 09/10/2013 09:17 PM, Roland Dreier wrote:
> On Sun, Sep 8, 2013 at 2:44 PM, Doug Ledford <dledford-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org> wrote:
>>
>> - ret = find_gid_port(cma_dev->device, &iboe_gid, port);
>> + ret = ib_find_cached_gid(cma_dev->device, &iboe_gid, &found_port, NULL);
>
> This type of change is kind of unfortunate -- I've been on a
> multi-year quest to get rid of the whole "ib...cached..." set of APIs,
So I was forewarned.
> since the part of the code that handles maintaining that cache is racy
> and hard to get the locking right with. It would be better if we
> could declare that the device driver's query GID methods had to be
> fast (non-sleeping) and use them directly (and device drivers could
> maintain a cache if they need to, maybe with a library to help them).
>
> But I guess that's a bigger project than fixing this immediate issue.
There are only two solutions to this that I can see:
1) Don't go to the card
2) Go to the card, but get the entire GID table in one operation (or at
most two if you need one to get the GID table length and then a second
to get the entire GID table in one go)
The current implementation goes to the card once to get the table
length, and then once for each table entry. That's what's killing us.
Personally, I don't want it ever to go to the card for this sort of
operation. We should be able to keep the card's idea of GIDs and our
idea of the same in sync. Getting this right might be hard, but it's
still the right thing to do.
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
prev parent reply other threads:[~2013-09-11 1:37 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-09-08 21:44 [PATCH] IB/cma: use cached gids Doug Ledford
[not found] ` <681df2ae830b20b81fef0c57c41f3bbce5c8c1cc.1378676509.git.dledford-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
2013-09-10 23:39 ` Hefty, Sean
2013-09-11 1:17 ` Roland Dreier
[not found] ` <CAG4TOxOTPPNdzpNmRkiwsjEcGEoVG1=H2e6YHddXFnAGXHFL6w-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2013-09-11 1:37 ` Doug Ledford [this message]
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=522FC96D.3030206@redhat.com \
--to=dledford-h+wxahxf7alqt0dzr+alfa@public.gmane.org \
--cc=eli-LDSdmyG8hGV8YrgS2mwiifqBs+8SCbDb@public.gmane.org \
--cc=linux-rdma-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=roland-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org \
--cc=sean.hefty-ral2JQCrhuEAvxtiuMwx3w@public.gmane.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
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).