From: Jason Gunthorpe <jgunthorpe-ePGOBjL8dl3ta4EC/59zMFaTQe2KTcn/@public.gmane.org>
To: Doug Ledford <dledford-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
Cc: Devesh Sharma
<devesh.sharma-dY08KVG/lbpWk0Htik3J/w@public.gmane.org>,
linux-rdma-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
Subject: Re: [rdma-core v5 0/8] Broadcom User Space RoCE Driver
Date: Mon, 24 Apr 2017 15:51:40 -0600 [thread overview]
Message-ID: <20170424215140.GA14907@obsidianresearch.com> (raw)
In-Reply-To: <1493067443.3041.63.camel-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
On Mon, Apr 24, 2017 at 04:57:23PM -0400, Doug Ledford wrote:
> I'm not aware of anyway, which is always possible, I prefer to see
> mutexes instead of spin locks in user space because they are safer and
> more likely to result in forward progress in the event of
> contention.
It is true that if the callers of verbs adjust their thread priorities
we will certainly completely fail to make forward progess in the worst
case situations, as high priority waiters will no yield the CPU.
For this reason alone it is probably a really bad idea to use
spinlocks at all in library code.
However, AFAIK, default pthread mutexes well known to be much slower
than spinlocks for various cases. They have weird performance aspects
from the fairness policy on unlock we may not really want.
Perahps this is why Sean open-coded locks using atomics in rdmacm and
acm?
However, there are many kinds of mutex locks in glibc, and perhaps
something like PTHREAD_MUTEX_ADAPTIVE_NP gives performance close to a
spinlock?
Someone would have to benchmark different options and see.
Since we are so very performance sensitive, we might do well to
open-code our own locking primitive, similar to
PTHREAD_MUTEX_ADAPTIVE_NP, based on futexes. Inlining the
non-contended case alone would probably be notably helpful.
Jason
--
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
next prev parent reply other threads:[~2017-04-24 21:51 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-04-24 18:53 [rdma-core v5 0/8] Broadcom User Space RoCE Driver Devesh Sharma
[not found] ` <1493059995-636-1-git-send-email-devesh.sharma-dY08KVG/lbpWk0Htik3J/w@public.gmane.org>
2017-04-24 18:53 ` [rdma-core v5 1/8] libbnxt_re: introduce bnxtre user space RDMA provider Devesh Sharma
2017-04-24 18:53 ` [rdma-core v5 2/8] libbnxt_re: Add support for user memory regions Devesh Sharma
2017-04-24 18:53 ` [rdma-core v5 3/8] libbnxt_re: Add support for CQ and QP management Devesh Sharma
2017-04-24 18:53 ` [rdma-core v5 4/8] libbnxt_re: Add support for posting and polling Devesh Sharma
2017-04-24 18:53 ` [rdma-core v5 5/8] libbnxt_re: Allow apps to poll for flushed completions Devesh Sharma
2017-04-24 18:53 ` [rdma-core v5 6/8] libbnxt_re: Enable UD control path and wqe posting Devesh Sharma
2017-04-24 18:53 ` [rdma-core v5 7/8] libbnxt_re: Enable polling for UD completions Devesh Sharma
2017-04-24 18:53 ` [rdma-core v5 8/8] libbnxt_re: Add support for atomic operations Devesh Sharma
2017-04-24 20:57 ` [rdma-core v5 0/8] Broadcom User Space RoCE Driver Doug Ledford
[not found] ` <1493067443.3041.63.camel-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
2017-04-24 21:51 ` Jason Gunthorpe [this message]
[not found] ` <20170424215140.GA14907-ePGOBjL8dl3ta4EC/59zMFaTQe2KTcn/@public.gmane.org>
2017-04-24 23:47 ` Hefty, Sean
[not found] ` <1828884A29C6694DAF28B7E6B8A82373AB1169E4-P5GAC/sN6hkd3b2yrw5b5LfspsVTdybXVpNB7YpNyf8@public.gmane.org>
2017-04-25 15:28 ` Jason Gunthorpe
[not found] ` <20170425152843.GA17680-ePGOBjL8dl3ta4EC/59zMFaTQe2KTcn/@public.gmane.org>
2017-04-25 15:35 ` Hefty, Sean
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=20170424215140.GA14907@obsidianresearch.com \
--to=jgunthorpe-epgobjl8dl3ta4ec/59zmfatqe2ktcn/@public.gmane.org \
--cc=devesh.sharma-dY08KVG/lbpWk0Htik3J/w@public.gmane.org \
--cc=dledford-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org \
--cc=linux-rdma-u79uwXL29TY76Z2rM5mHXA@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