Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp3537451imu; Fri, 18 Jan 2019 12:08:48 -0800 (PST) X-Google-Smtp-Source: ALg8bN5mK1MTZHFdDvP2CmrqgH/YaE13P8l+1qbswF1tKWuEAzUJE2npZLmDgx3HKMhlOIokkbc+ X-Received: by 2002:a63:2141:: with SMTP id s1mr19156920pgm.148.1547842127983; Fri, 18 Jan 2019 12:08:47 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1547842127; cv=none; d=google.com; s=arc-20160816; b=VGhMbsUQh9ldCabkV6GWtGtfJJhUMoNr/ORjf6hcGeO6QZZpgwLLCFTnDaLcaz+yrQ CaYzvwRZBmPquAIwL+JcjdceX8FycmEiFW0WU20tzkqTUTQWjXb8a1PFEVah03k6f5MQ UM4H67ld58xXZL4O/UIX0HwCHqTcUa56+Jnh0sCqKpqipZouN5Yf6mp9xABHlBy+lZUw LBbIBgo0bNFDo+cMHhRXaSg8TRnKH2/+CfponNDRzViZjit9xEv88rfGH9QWuFwufONB SQojRSX/XfQdTB/JouDDs3TnWj7eD486zNXz/Me6sT2f1TziHYBmovNQacg4d7Hb/e8N Bvdw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=bHjbrvtdU6CrPUk89GCBDU4LVJNmWhYTlrCLtZRBcPs=; b=n1QnaXjyUHVJ2FV8JaDeD2jtxkk8xVeAw5h0O+bAG2e+mClhNpBMbYmWLkeHRdmLvx l23nz0eZVLf1GFAqpvJIGFKwox+rMTdG5aauKVzsNrP0FpzUHrNIK0hTxqlmofZr9zAP +bCgyKBMfJmYYItK5KJkwiImf2RV3lLTP3LVp5SXNb/vsA8gqRabHFvTRHYTLbkW3IGe hDHhhBXfOR6/51iimKCveE5F/1eeVFDMjsvx/zDJ6191m/Fm/u/Q43kqMVBZSy/qdSLp t2CXvgIuR49jmAA9ffJ97GJofNXpHJ/C4JdZSHySwyLIwPuD5cmlz4vcjZCE6kFmz6XN vyFQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@infradead.org header.s=bombadil.20170209 header.b=f2QUHo4p; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id f90si3261105plb.362.2019.01.18.12.08.29; Fri, 18 Jan 2019 12:08:47 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=fail header.i=@infradead.org header.s=bombadil.20170209 header.b=f2QUHo4p; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729410AbfARUHN (ORCPT + 99 others); Fri, 18 Jan 2019 15:07:13 -0500 Received: from bombadil.infradead.org ([198.137.202.133]:44590 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729371AbfARUHN (ORCPT ); Fri, 18 Jan 2019 15:07:13 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20170209; h=In-Reply-To:Content-Type:MIME-Version :References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=bHjbrvtdU6CrPUk89GCBDU4LVJNmWhYTlrCLtZRBcPs=; b=f2QUHo4pL53dLQi/z9+sCmeX9 8vkB/UO6buu/oSkxnfyfJbqUmenZSS+tEzn2TwWVU5noLLGQzD4m4D16omnnjAetqPT18QqppelAa 1Nr/bVapfNNXCTz3gsQPy6vFEUYjjqbtiO7k4z1lMO3pcSF5pn6zvaJ2Lf4rQjZCBXnsL3i8iDU/k Z1LmlGuIuJeHhWcdewajoxGqIJMH3zzs7yRK8jKi+EwTMk0o4bcOO+0n2doRZcfjgoGVvAA9EW4o1 yEpPtgNJ17UJVjCNyu2APMWcRHzYNz2GncrrtMz1NA/8hnnM9zsLclfo5wcTQCujRDuVg++6UTN7G iC+7t1pFQ==; Received: from j217100.upc-j.chello.nl ([24.132.217.100] helo=hirez.programming.kicks-ass.net) by bombadil.infradead.org with esmtpsa (Exim 4.90_1 #2 (Red Hat Linux)) id 1gkaPs-00012H-4n; Fri, 18 Jan 2019 20:07:00 +0000 Received: by hirez.programming.kicks-ass.net (Postfix, from userid 1000) id A5F25201955B8; Fri, 18 Jan 2019 21:06:57 +0100 (CET) Date: Fri, 18 Jan 2019 21:06:57 +0100 From: Peter Zijlstra To: Waiman Long Cc: James Morse , Zhenzhong Duan , LKML , SRINIVAS , Borislav Petkov , Steven Rostedt Subject: Re: Question about qspinlock nest Message-ID: <20190118200657.GE27931@hirez.programming.kicks-ass.net> References: <910e9fb6-d0df-4711-fe2b-244b3c20eb82@redhat.com> <20190110201217.GH2861@worktop.programming.kicks-ass.net> <20190114131613.GB10486@hirez.programming.kicks-ass.net> <830db851-d5cb-4081-8d72-e3f3a0a282df@arm.com> <20190118100229.GB27931@hirez.programming.kicks-ass.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.10.1 (2018-07-13) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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?