All of lore.kernel.org
 help / color / mirror / Atom feed
From: Waiman Long <longman@redhat.com>
To: Peter Zijlstra <peterz@infradead.org>
Cc: James Morse <james.morse@arm.com>,
	Zhenzhong Duan <zhenzhong.duan@oracle.com>,
	LKML <linux-kernel@vger.kernel.org>,
	SRINIVAS <srinivas.eeda@oracle.com>,
	Borislav Petkov <bp@alien8.de>,
	Steven Rostedt <rostedt@goodmis.org>
Subject: Re: Question about qspinlock nest
Date: Fri, 18 Jan 2019 16:30:25 -0500	[thread overview]
Message-ID: <04ff7bf3-b45a-787d-f89e-832389000c6f@redhat.com> (raw)
In-Reply-To: <20190118200657.GE27931@hirez.programming.kicks-ass.net>

On 01/18/2019 03:06 PM, Peter Zijlstra wrote:
> On Fri, Jan 18, 2019 at 09:50:12AM -0500, Waiman Long wrote:
>> On 01/18/2019 05:02 AM, Peter Zijlstra wrote:
>>>> e.g. We can't take an SError during the SError handler.
>>>>
>>>> But we can take this SError/NMI on another CPU while the first one is still
>>>> running the handler.
>>>>
>>>> These multiple NMIlike notifications mean having multiple locks/fixmap-slots,
>>>> one per notification. This is where the qspinlock node limit comes in, as we
>>>> could have more than 4 contexts.
>>> Right; so Waiman was going to do a patch that reverts to test-and-set or
>>> something along those lines once we hit the queue limit, which seems
>>> like a good way out. Actually hitting that nesting level should be
>>> exceedingly rare.
>> Yes, I am working on a patch to support arbitrary levels of nesting. It
>> is easy for PV qspinlock as lock stealing is supported.
>>
>> For native qspinlock, we cannot do lock stealing without incurring a
>> certain amount of overhead in the regular slowpath code. It was up to
>> 10% in my own testing. So I am exploring an alternative that can do the
>> job without incurring any noticeable performance degradation in the
>> slowpath. I ran into a race condition which I am still trying to find
>> out where that comes from. Hopefully, I will have something to post next
>> week.
> Where does the overhead come from? Surely that's not just checking that
> bound?

It is not about checking bound, it is about how to acquire the lock
without using an MCS node. The overhead comes from using atomic
instruction to acquire the lock instead of non-atomic one in order to
allow lock stealing.

Cheers,
Longman


  reply	other threads:[~2019-01-18 21:30 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-01-10  8:02 Question about qspinlock nest Zhenzhong Duan
2019-01-10 14:43 ` Waiman Long
2019-01-10 18:25   ` James Morse
2019-01-10 19:23     ` Waiman Long
2019-01-10 20:12     ` Peter Zijlstra
2019-01-11 18:32       ` James Morse
2019-01-14 13:16         ` Peter Zijlstra
2019-01-14 13:54           ` James Morse
2019-01-14 21:07             ` Waiman Long
2019-01-18 10:02             ` Peter Zijlstra
2019-01-18 10:24               ` Borislav Petkov
2019-01-18 14:50               ` Waiman Long
2019-01-18 20:06                 ` Peter Zijlstra
2019-01-18 21:30                   ` Waiman Long [this message]
     [not found]   ` <2eca6f60-3e8b-a389-27cb-8adbd9676607@oracle.com>
2019-01-11  9:16     ` Peter Zijlstra
2019-01-11 17:36       ` Borislav Petkov
2019-01-11 16:59     ` Waiman Long
2019-01-10 20:03 ` Peter Zijlstra
2019-01-14  9:25 Zhenzhong Duan

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=04ff7bf3-b45a-787d-f89e-832389000c6f@redhat.com \
    --to=longman@redhat.com \
    --cc=bp@alien8.de \
    --cc=james.morse@arm.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=peterz@infradead.org \
    --cc=rostedt@goodmis.org \
    --cc=srinivas.eeda@oracle.com \
    --cc=zhenzhong.duan@oracle.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 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.