Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp2107413yba; Wed, 3 Apr 2019 01:11:40 -0700 (PDT) X-Google-Smtp-Source: APXvYqy/RaNKiKKLAxAZ269lFUIglT605ChtlIwSW+JeNAag/D/8MKSc5JKUPYI3ViHgs3t5zmqo X-Received: by 2002:a65:6105:: with SMTP id z5mr41711361pgu.378.1554279100179; Wed, 03 Apr 2019 01:11:40 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1554279100; cv=none; d=google.com; s=arc-20160816; b=K1Ylnz6C7myYg/rRJGHSe+OqZ0A/vO/hWuW8eSpnMdmXYFhta2Z01t9iLAAztIUwG9 IHUObXJlJdT8tDWRTa0lv40i/ROJZzZ+L9hfyvoenQCNPJUGWPxfb3b5/bnc3wVpUMcC rCYbF+UuDIni9RiwO60EJ3XORPfIsVfmVSneBjKSueAYqfRoxmXWwsIjVOedJcG0/fTX 9kXT3KgZ722b+I6+4A7vlAovLAXY8J7Iwb5AURw9eQSY9QLir6iZp1TI6MdwP1m3G90w eDknlVER+Xm+sOgGJD/keh8YWPKUDJaTloXjRSwDkD0tkxDwGQswwzqp0X8ZGl7AoiXq 0niw== 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=XM1xFe7fz3+K6rOp2hK3VMT9eRTcyEv7zj7H6QfnHR0=; b=satzzoL1P0fhLt5Is0mCjxTYD1AI33rOJV6RSBVzzOvqLmpVZzy93Hwmd/L9AszGDB I662TZtkEbiY1tQADSTAk6z0bO9dYUNFyOf27JIC7oT5mtyDoEdCn/RL4htBw5tV8N1z HdV3t6C1cjPFQ2oeDZ+zXk07HwZUCeoJ5BL9eTb1q4xoIqrlHXkZ7WSpdQK2Y11jXTHk RXgFEhWNByQG5JjhRWX11fnxxFi0pRIXKzu2Jj7BSfdk3PTePBrMj/4uDcap7iGHogII /1VliL2UO91k/SyYWXTFDNqgkPHEGBY7vh8WPWcWbXkSzURq4b6DIgU+Jw4Zui2Knw6j WM4g== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@infradead.org header.s=merlin.20170209 header.b=FqqlM1mm; 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 j11si12894098pfh.47.2019.04.03.01.11.24; Wed, 03 Apr 2019 01:11:40 -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=merlin.20170209 header.b=FqqlM1mm; 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 S1728674AbfDCIKq (ORCPT + 99 others); Wed, 3 Apr 2019 04:10:46 -0400 Received: from merlin.infradead.org ([205.233.59.134]:37244 "EHLO merlin.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726004AbfDCIKp (ORCPT ); Wed, 3 Apr 2019 04:10:45 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=merlin.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=XM1xFe7fz3+K6rOp2hK3VMT9eRTcyEv7zj7H6QfnHR0=; b=FqqlM1mma8yj/famZCyc4EcQU 3iEPgSzB2Y6w1rEWbvY5R2czflXZRQWq0SFDXD9xe8ysTMISkpI02L3JsYplYFnmYmIWtQ+3wJQHB sUAhWU8mczaeMETm1Z+DD44laQTveSdg/MyL53GdcrCqWsb21Fmyni6dLrG4sNwdqN37LtAZlEHFD oSCvaV5PBCr4l824eHfJxGtUX5hR+mkW8VPf/EdouCjDmtUWrVkuo4osAyAZ6fQ5FuTYVFR9IJY9Q gONS0ZecT5SqYcc9KDRdJm8hSBjUIVjC2atmTdqqa8GcIxF/0vs8wxWhSekHV/b0dYNI2zuyywmjC FXdTnlgbg==; Received: from j217100.upc-j.chello.nl ([24.132.217.100] helo=hirez.programming.kicks-ass.net) by merlin.infradead.org with esmtpsa (Exim 4.90_1 #2 (Red Hat Linux)) id 1hBayp-0000hW-77; Wed, 03 Apr 2019 08:10:43 +0000 Received: by hirez.programming.kicks-ass.net (Postfix, from userid 1000) id F1110213A0C8E; Wed, 3 Apr 2019 10:10:41 +0200 (CEST) Date: Wed, 3 Apr 2019 10:10:41 +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: <20190403081041.GB14281@hirez.programming.kicks-ass.net> References: <20190331214020.836098943@linutronix.de> <20190331215136.039902969@linutronix.de> <20190402154329.scp7i7uqevubgwrz@treble> <20190402155149.c23ivzzc5hyykokl@treble> <20190403080828.GN12232@hirez.programming.kicks-ass.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20190403080828.GN12232@hirez.programming.kicks-ass.net> 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 Wed, Apr 03, 2019 at 10:08:28AM +0200, Peter Zijlstra wrote: > 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. Aah, ftrace OTOH might still trigger this lots. When you do function tracer with stacktrace enabled it'll do unwinds _everywhere_.