From: Chuck Lever <chuck.lever@oracle.com>
To: Bruce Fields <bfields@fieldses.org>
Cc: Trond Myklebust <trondmy@hammerspace.com>,
Linux NFS Mailing List <linux-nfs@vger.kernel.org>
Subject: Re: [PATCH] SUNRPC: Don't allow compiler optimisation of svc_xprt_release_slot()
Date: Mon, 14 Jan 2019 12:24:24 -0500 [thread overview]
Message-ID: <F21839E5-A5DB-4BC8-8F3B-2AD02D4B2652@oracle.com> (raw)
In-Reply-To: <20190112005613.GA29181@fieldses.org>
> On Jan 11, 2019, at 7:56 PM, Bruce Fields <bfields@fieldses.org> wrote:
>
> On Fri, Jan 11, 2019 at 05:27:30PM -0500, Chuck Lever wrote:
>>
>>
>>> On Jan 11, 2019, at 5:10 PM, Bruce Fields <bfields@fieldses.org> wrote:
>>>
>>> On Fri, Jan 11, 2019 at 04:54:01PM -0500, Chuck Lever wrote:
>>>>> On Jan 11, 2019, at 4:52 PM, Chuck Lever <chuck.lever@oracle.com> wrote:
>>>>>> So, I think we need your patch plus something like this.
>>>>>>
>>>>>> Chuck, maybe you could help me with the "XXX: Chuck:" parts?
>>>>>
>>>>> I haven't been following. Why do you think those are necessary?
>>>
>>> I'm worried something like this could happen:
>>>
>>> CPU 1 CPU 2
>>> ----- -----
>>>
>>> set XPT_DATA dec xpt_nr_rqsts
>>>
>>> svc_xprt_enqueue svc_xprt_enqueue
>>>
>>> And both decide nothing should be done if neither sees the change that
>>> the other made.
>>>
>>> Maybe I'm still missing some reason that couldn't happen.
>>>
>>> Even if it can happen, it's an unlikely race that will likely be fixed
>>> when another event comes along a little later, which would explain why
>>> we've never seen any reports.
>>>
>>>>> We've had set_bit and atomic_{inc,dec} in this code for ages,
>>>>> and I've never noticed a problem.
>>>>>
>>>>> Rather than adding another CPU pipeline bubble in the RDMA code,
>>>>> though, could you simply move the set_bit() call site inside the
>>>>> critical sections?
>>>>
>>>> er, inside the preceding critical section. Just reverse the order
>>>> of the spin_unlock and the set_bit.
>>>
>>> That'd do it, thanks!
>>
>> I can try that here and see if it results in a performance regression.
>
> Thanks, I've got a version with a typo fixed at
>
> git://linux-nfs.org/~bfields/linux.git nfsd-next
Applied all four patches here. I don't see any performance regressions,
but my server has only a single last-level CPU cache.
--
Chuck Lever
next prev parent reply other threads:[~2019-01-14 17:24 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-01-03 14:17 [PATCH] SUNRPC: Don't allow compiler optimisation of svc_xprt_release_slot() Trond Myklebust
2019-01-03 22:45 ` J Bruce Fields
2019-01-03 23:40 ` Trond Myklebust
2019-01-04 17:39 ` bfields
2019-01-07 21:32 ` bfields
2019-01-07 22:06 ` Trond Myklebust
2019-01-08 15:01 ` bfields
2019-01-08 16:21 ` Trond Myklebust
2019-01-09 16:51 ` bfields
2019-01-09 17:41 ` Trond Myklebust
2019-01-11 21:12 ` bfields
2019-01-11 21:52 ` Chuck Lever
2019-01-11 21:54 ` Chuck Lever
2019-01-11 22:10 ` Bruce Fields
2019-01-11 22:27 ` Chuck Lever
2019-01-12 0:56 ` Bruce Fields
2019-01-14 17:24 ` Chuck Lever [this message]
2019-01-25 20:30 ` Bruce Fields
2019-01-25 21:32 ` Chuck Lever
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=F21839E5-A5DB-4BC8-8F3B-2AD02D4B2652@oracle.com \
--to=chuck.lever@oracle.com \
--cc=bfields@fieldses.org \
--cc=linux-nfs@vger.kernel.org \
--cc=trondmy@hammerspace.com \
/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).