From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.3 required=3.0 tests=DKIM_INVALID,DKIM_SIGNED, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_PASS,USER_AGENT_MUTT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 57A8FC282E0 for ; Fri, 19 Apr 2019 22:54:42 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 22AFA217F9 for ; Fri, 19 Apr 2019 22:54:42 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=infradead.org header.i=@infradead.org header.b="RJpXP6G5" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727723AbfDSWyk (ORCPT ); Fri, 19 Apr 2019 18:54:40 -0400 Received: from bombadil.infradead.org ([198.137.202.133]:49702 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726834AbfDSWy0 (ORCPT ); Fri, 19 Apr 2019 18:54:26 -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=Z3FgX2qYeAVr6a7aOjZTKzD1LI5HjVL2uBhAKfg9pDs=; b=RJpXP6G57WJQo20w1oN6XV1Sv W0L+9FKiKEGCXF0UITD24ixi+tPLIpDsoo3ae5bCC4wswL29O/O1INxloaH4aS+LS5yudtvbT81Fe Wyjy7ZPOBCxw1Isgsz4PXKHIt/FoNeftgsdcHKhkwrLmW0UrqT9w+USQ4dwLxmPbn84yeQGclO3a6 xNsCQIrNih4rri7LJVSPoidSd3rDLti1c9VgyWRiS/K6aGXChzk762fRVgxajeZs/pUD/y03P1xNR 3LO1qv4gn1QkLcarsdl9Pi02ID3DDYmPnYB9iH/StdK1D5dChx2YdtqtZ/iCpQ/j41edlnb+n3hiR 7ZbFFPYzQ==; Received: from [92.65.108.250] (helo=worktop.programming.kicks-ass.net) by bombadil.infradead.org with esmtpsa (Exim 4.90_1 #2 (Red Hat Linux)) id 1hHPUT-0001vd-67; Fri, 19 Apr 2019 09:07:25 +0000 Received: by worktop.programming.kicks-ass.net (Postfix, from userid 1000) id 0D676984ED8; Fri, 19 Apr 2019 11:07:18 +0200 (CEST) Date: Fri, 19 Apr 2019 11:07:17 +0200 From: Peter Zijlstra To: Thomas Gleixner Cc: LKML , Josh Poimboeuf , x86@kernel.org, Andy Lutomirski , Steven Rostedt , Alexander Potapenko , linux-arch@vger.kernel.org, Alexey Dobriyan , Andrew Morton , Pekka Enberg , linux-mm@kvack.org, David Rientjes , Christoph Lameter , Catalin Marinas , Dmitry Vyukov , Andrey Ryabinin , kasan-dev@googlegroups.com, Mike Rapoport , Akinobu Mita , iommu@lists.linux-foundation.org, Robin Murphy , Christoph Hellwig , Marek Szyprowski , Johannes Thumshirn , David Sterba , Chris Mason , Josef Bacik , linux-btrfs@vger.kernel.org, dm-devel@redhat.com, Mike Snitzer , Alasdair Kergon , intel-gfx@lists.freedesktop.org, Joonas Lahtinen , Maarten Lankhorst , dri-devel@lists.freedesktop.org, David Airlie , Jani Nikula , Daniel Vetter , Rodrigo Vivi Subject: Re: [patch V2 28/29] stacktrace: Provide common infrastructure Message-ID: <20190419090717.GN7905@worktop.programming.kicks-ass.net> References: <20190418084119.056416939@linutronix.de> <20190418084255.652003111@linutronix.de> <20190419071843.GM4038@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, Apr 19, 2019 at 10:32:30AM +0200, Thomas Gleixner wrote: > On Fri, 19 Apr 2019, Peter Zijlstra wrote: > > On Thu, Apr 18, 2019 at 10:41:47AM +0200, Thomas Gleixner wrote: > > > > > +typedef bool (*stack_trace_consume_fn)(void *cookie, unsigned long addr, > > > + bool reliable); > > > > > +void arch_stack_walk(stack_trace_consume_fn consume_entry, void *cookie, > > > + struct task_struct *task, struct pt_regs *regs); > > > +int arch_stack_walk_reliable(stack_trace_consume_fn consume_entry, void *cookie, > > > + struct task_struct *task); > > > > This bugs me a little; ideally the _reliable() thing would not exists. > > > > Thomas said that the existing __save_stack_trace_reliable() is different > > enough for the unification to be non-trivial, but maybe Josh can help > > out? > > > > >From what I can see the biggest significant differences are: > > > > - it looks at the regs sets on the stack and for FP bails early > > - bails for khreads and idle (after it does all the hard work!?!) > > > > The first (FP checking for exceptions) should probably be reflected in > > consume_fn(.reliable) anyway -- although that would mean a lot of extra > > '?' entries where there are none today. > > > > And the second (KTHREAD/IDLE) is something that the generic code can > > easily do before calling into the arch unwinder. > > And looking at the powerpc version of it, that has even more interesting > extra checks in that function. Right, but not fundamentally different from determining @reliable I think. Anyway, it would be good if someone knowledgable could have a look at this.