Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp2106438yba; Wed, 3 Apr 2019 01:10:07 -0700 (PDT) X-Google-Smtp-Source: APXvYqzFMuZFOBEEKLC2sklVaYE7DfCKrs0RVsurj7Ua3Nv3iV/6wNrn8SxXmLkT87wKLbgzxgos X-Received: by 2002:a17:902:e684:: with SMTP id cn4mr51449250plb.71.1554279007585; Wed, 03 Apr 2019 01:10:07 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1554279007; cv=none; d=google.com; s=arc-20160816; b=CsCEHUaV8TxyrPmp6niFuvMbjEJ8WKZT9ffYqyMyrAj7CevK4yJn+x0GpzpFbqQcXK b3EEvjfEXzH00d0XLVuaBYT3Eq2cM27WZY40MXsJIjkoZDPjeq6T5Z8PS5gfUrMOLzcZ pkLOfJkIdUAVOM6Rl2jVeWFy0LL0GLg2C6MTTVoEag5L7qw3akGlwsS7aZkYf7sFEQ50 CnnDzECLt3f8x4EYXgmkki2bRVkIgxG3D2BtQDkJ7mQNWc0aIEvwf3xLZvIjmB9rjm2f ie4ry2cqBBtBByiQo4DWIBV+z2sV2ZrzcwRcNY2RtPyKgVHtfIa0Jgo3LSFr8B7jaLXG 6MuA== 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=oZjPV8oWUa6XiQbycdnKQnPe90Y17J4aTwcP/iWRVO8=; b=ZGBGXEvaRze5BC1Gm6swBVrjU3ASh+fVASjHkH3yYcjIct9yiotSzlmUUbXbLl183/ bTSOUOwYxIf9d16uti9hJ1VAiJbxlmYY92GaEB3EcyZrgNiBAqcRp5SDC0xutMo5VuLw watOnpaRMZiDwKU7uq9JCDjvguTSFu0W9H3dXVuE9QZwo00KC9Hia/+46RUEiN9L42Os JnNZo7P332GMWQ8Swi4e1B0/+hJ7JCVjSo4N0UQDTawjfqpMsHzkE9Tb4r1XAN8RX+V4 XLHGfrw5nk45VoZ/PNI33vJlvQD2bKIGnFAgcpUSw7ESDyAjtCvamDxSSbJMmgIWqYtZ 7qJg== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@infradead.org header.s=bombadil.20170209 header.b=mlvdrSIz; 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 19si11441617pgl.402.2019.04.03.01.09.52; Wed, 03 Apr 2019 01:10:07 -0700 (PDT) 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=mlvdrSIz; 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 S1728884AbfDCIIc (ORCPT + 99 others); Wed, 3 Apr 2019 04:08:32 -0400 Received: from bombadil.infradead.org ([198.137.202.133]:54250 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726084AbfDCIIb (ORCPT ); Wed, 3 Apr 2019 04:08:31 -0400 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=oZjPV8oWUa6XiQbycdnKQnPe90Y17J4aTwcP/iWRVO8=; b=mlvdrSIzLRpXlpGOuPJFPRQp4 ZoOJB8hGPAHFQ8twdANBRRK1VvfSScVJZG4NxQNTlC90/1Y5AVEyCbmyaQFijylJXD/pBqunjymSx Pc7AKO9AcZ1nIvRZnBNep96ymlR/TBUcjXw2mAmCcNA1XqdrfRa/Xk9vwfABRUgmJgD7HkrmKaU26 S9bQ0S3XhxL8dkn3FLKLCLpHVO0CeSZCIyBbkjnoVJ7iW840J0OJFfSO7sJPakg1tpMXASI+ErACo ziEJ3kSPaU+rIGao6gghU4fuAYPaJW3VxH7RHMMkt/w/UZc/TsF9trZ6cje0zhyYLNqZeHmpXIZFi mwOTAlavg==; 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 1hBawf-0002hr-SU; Wed, 03 Apr 2019 08:08:30 +0000 Received: by hirez.programming.kicks-ass.net (Postfix, from userid 1000) id 3E3B4213A0C8E; Wed, 3 Apr 2019 10:08:28 +0200 (CEST) Date: Wed, 3 Apr 2019 10:08:28 +0200 From: Peter Zijlstra To: Josh Poimboeuf Cc: Thomas Gleixner , LKML , x86@kernel.org, Andy Lutomirski Subject: Re: [patch 15/14] x86/dumpstack/64: Speedup in_exception_stack() Message-ID: <20190403080828.GN12232@hirez.programming.kicks-ass.net> References: <20190331214020.836098943@linutronix.de> <20190331215136.039902969@linutronix.de> <20190402154329.scp7i7uqevubgwrz@treble> <20190402155149.c23ivzzc5hyykokl@treble> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20190402155149.c23ivzzc5hyykokl@treble> 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 Tue, Apr 02, 2019 at 10:51:49AM -0500, Josh Poimboeuf wrote: > On Tue, Apr 02, 2019 at 05:48:56PM +0200, Thomas Gleixner wrote: > > > With the above "(stk <= begin || stk >= end)" check, removing the loop > > > becomes not all that important since exception stack dumps are quite > > > rare and not performance sensitive. With all the macros this code > > > becomes a little more obtuse, so I'm not sure whether removal of the > > > loop is a net positive. > > > > What about perf? It's NMI context and probably starts from there. Peter? > > I believe perf unwinds starting from the regs from the context which was > interrupted by the NMI. Aah, indeed. So then we only see exception stacks when the NMI lands in an exception, which is, as you say, quite rare.