From mboxrd@z Thu Jan 1 00:00:00 1970 From: Peter Zijlstra Subject: Re: [patch V2 28/29] stacktrace: Provide common infrastructure Date: Fri, 19 Apr 2019 09:18:43 +0200 Message-ID: <20190419071843.GM4038@hirez.programming.kicks-ass.net> References: <20190418084119.056416939@linutronix.de> <20190418084255.652003111@linutronix.de> Mime-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: base64 Return-path: Content-Disposition: inline In-Reply-To: <20190418084255.652003111@linutronix.de> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: intel-gfx-bounces@lists.freedesktop.org Sender: "Intel-gfx" To: Thomas Gleixner Cc: Mike Snitzer , David Airlie , Catalin Marinas , dri-devel@lists.freedesktop.org, linux-mm@kvack.org, dm-devel@redhat.com, Alexander Potapenko , Christoph Lameter , Christoph Hellwig , Alasdair Kergon , Marek Szyprowski , linux-arch@vger.kernel.org, x86@kernel.org, kasan-dev@googlegroups.com, David Rientjes , Andrey Ryabinin , Alexey Dobriyan , intel-gfx@lists.freedesktop.org, Johannes Thumshirn , Akinobu Mita , Steven Rostedt , Josef Bacik , Mike Rapoport , Andy Lutomirski , Josh Poimboeuf , David Sterba List-Id: iommu@lists.linux-foundation.org T24gVGh1LCBBcHIgMTgsIDIwMTkgYXQgMTA6NDE6NDdBTSArMDIwMCwgVGhvbWFzIEdsZWl4bmVy IHdyb3RlOgoKPiArdHlwZWRlZiBib29sICgqc3RhY2tfdHJhY2VfY29uc3VtZV9mbikodm9pZCAq Y29va2llLCB1bnNpZ25lZCBsb25nIGFkZHIsCj4gKyAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgYm9vbCByZWxpYWJsZSk7Cgo+ICt2b2lkIGFyY2hfc3RhY2tfd2FsayhzdGFj a190cmFjZV9jb25zdW1lX2ZuIGNvbnN1bWVfZW50cnksIHZvaWQgKmNvb2tpZSwKPiArCQkgICAg IHN0cnVjdCB0YXNrX3N0cnVjdCAqdGFzaywg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bmcgdGhhdCB0aGUgZ2VuZXJpYyBjb2RlIGNhbgplYXNpbHkgZG8gYmVm b3JlIGNhbGxpbmcgaW50byB0aGUgYXJjaCB1bndpbmRlci4KCkhtbT8KCl9fX19fX19fX19fX19f X19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fCkludGVsLWdmeCBtYWlsaW5nIGxpc3QK SW50ZWwtZ2Z4QGxpc3RzLmZyZWVkZXNrdG9wLm9yZwpodHRwczovL2xpc3RzLmZyZWVkZXNrdG9w Lm9yZy9tYWlsbWFuL2xpc3RpbmZvL2ludGVsLWdmeA== 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,URIBL_BLOCKED, 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 9705CC282DA for ; Fri, 19 Apr 2019 07:19:17 +0000 (UTC) Received: from mail.linuxfoundation.org (mail.linuxfoundation.org [140.211.169.12]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 6905D2183F for ; Fri, 19 Apr 2019 07:19:17 +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="efhWri0O" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 6905D2183F Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=infradead.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=iommu-bounces@lists.linux-foundation.org Received: from mail.linux-foundation.org (localhost [127.0.0.1]) by mail.linuxfoundation.org (Postfix) with ESMTP id 1F0A921F0; Fri, 19 Apr 2019 07:19:17 +0000 (UTC) Received: from smtp1.linuxfoundation.org (smtp1.linux-foundation.org [172.17.192.35]) by mail.linuxfoundation.org (Postfix) with ESMTPS id 0FDC521B3 for ; Fri, 19 Apr 2019 07:19:04 +0000 (UTC) X-Greylist: greylisting inactive for cl@linux.com in SQLgrey-1.7.6 X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) by smtp1.linuxfoundation.org (Postfix) with ESMTPS id BB83C466; Fri, 19 Apr 2019 07:19:03 +0000 (UTC) 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=M4U9lCHjwX+RI+C+4Qn3GQkY7/2O42PH32K/E1UYiUo=; b=efhWri0OqGFVL87uVOhTf0P8c VSvSxYJhAd6hWo8CmLsODUpgHy2FOdjPhzivpgzeDYDDeiD5oIiDpm5/7IbHgKjlq91wLpWzl1aD2 91I3Ez2HBIUFPqmjTLYnv1ZBwWH/Qw3AsrWa3Rbc4zrTGp/lwd5liclNi1MQEvkxFpGtCo0tFht6C ylKfaemtfAjzZtz7n+nThE01KGuJI1R+8abPHEYloVasqEARRFqBwNStJEX8+DkrmdReR692/NWRH 8Fb/ZC+LcMEtU9ngoXTQZys0EFT/JnwkdRRcHWVA/k49KlOl+ugsAq67JLMjnv0e+1/DskCXYRzRn lv2tg85gQ==; 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 1hHNnJ-0005As-Hx; Fri, 19 Apr 2019 07:18:45 +0000 Received: by hirez.programming.kicks-ass.net (Postfix, from userid 1000) id C26E229B52F44; Fri, 19 Apr 2019 09:18:43 +0200 (CEST) Date: Fri, 19 Apr 2019 09:18:43 +0200 From: Peter Zijlstra To: Thomas Gleixner Subject: Re: [patch V2 28/29] stacktrace: Provide common infrastructure Message-ID: <20190419071843.GM4038@hirez.programming.kicks-ass.net> References: <20190418084119.056416939@linutronix.de> <20190418084255.652003111@linutronix.de> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20190418084255.652003111@linutronix.de> User-Agent: Mutt/1.10.1 (2018-07-13) Cc: Mike Snitzer , David Airlie , Catalin Marinas , Joonas Lahtinen , dri-devel@lists.freedesktop.org, linux-mm@kvack.org, dm-devel@redhat.com, Alexander Potapenko , Christoph Lameter , Christoph Hellwig , Alasdair Kergon , linux-arch@vger.kernel.org, x86@kernel.org, kasan-dev@googlegroups.com, David Rientjes , Andrey Ryabinin , Alexey Dobriyan , intel-gfx@lists.freedesktop.org, Johannes Thumshirn , Maarten Lankhorst , Akinobu Mita , Steven Rostedt , Josef Bacik , Rodrigo Vivi , Mike Rapoport , Jani Nikula , Andy Lutomirski , Josh Poimboeuf , David Sterba , Dmitry Vyukov , Chris Mason , LKML , Pekka Enberg , iommu@lists.linux-foundation.org, Daniel Vetter , Andrew Morton , Robin Murphy , linux-btrfs@vger.kernel.org X-BeenThere: iommu@lists.linux-foundation.org X-Mailman-Version: 2.1.12 Precedence: list List-Id: Development issues for Linux IOMMU support List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 7bit Sender: iommu-bounces@lists.linux-foundation.org Errors-To: iommu-bounces@lists.linux-foundation.org Message-ID: <20190419071843.E8NAsPAn8LMpdjd4zdWLq-arHE9FzC2GtN1oKZRoTMA@z> 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. Hmm? _______________________________________________ iommu mailing list iommu@lists.linux-foundation.org https://lists.linuxfoundation.org/mailman/listinfo/iommu