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 Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 0DDEBC433EF for ; Tue, 1 Mar 2022 19:49:21 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S237489AbiCATt7 (ORCPT ); Tue, 1 Mar 2022 14:49:59 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55698 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237429AbiCATtt (ORCPT ); Tue, 1 Mar 2022 14:49:49 -0500 Received: from desiato.infradead.org (desiato.infradead.org [IPv6:2001:8b0:10b:1:d65d:64ff:fe57:4e05]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E01E25A084; Tue, 1 Mar 2022 11:48:09 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=desiato.20200630; 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; bh=JTjpHIBNzbqDknQ+Nbv4Mia7f/qQBAKZ0P9X14dcOCY=; b=TS3MjJTjjyWVrc0Vzjy/hLdTS0 jyfpowb4SXry/qUrvbLRPPOPxa3DvgdnjL/DG5wgQZpGLBNgRxarZ+/gnJzYC3B09gBFqJbG6W4iK 2AjGYnTviAgEE8FBbfAL1UrzgpP9j6ZZPHcYnRtou9brufHwSOgjQ+4y0Vd0NsCk0y7/kPXkRlFyl EsApvHdgTaZLxKlmCKUZXHk//Rsh5HCbVfrX+Y3VBkxE/9X6aY2IH0tGVvNUkt/+i2jk5JScWYLP1 hRxB8w/PxNXJnYdIYis/UafmXUBALsnFwuaxj7BW9X0yYZ2SPmrltfu4/uv//vvITzfexi9OBqZIo QR9Q+ErQ==; Received: from j217100.upc-j.chello.nl ([24.132.217.100] helo=worktop.programming.kicks-ass.net) by desiato.infradead.org with esmtpsa (Exim 4.94.2 #2 (Red Hat Linux)) id 1nP8Sv-00EMCU-Sv; Tue, 01 Mar 2022 19:47:22 +0000 Received: by worktop.programming.kicks-ass.net (Postfix, from userid 1000) id 9FBDE986271; Tue, 1 Mar 2022 20:47:20 +0100 (CET) Date: Tue, 1 Mar 2022 20:47:20 +0100 From: Peter Zijlstra To: Steven Rostedt Cc: Namhyung Kim , Ingo Molnar , Will Deacon , Waiman Long , Boqun Feng , LKML , Thomas Gleixner , Mathieu Desnoyers , Byungchul Park , "Paul E. McKenney" , Arnd Bergmann , linux-arch@vger.kernel.org, bpf@vger.kernel.org, Radoslaw Burny Subject: Re: [PATCH 3/4] locking/mutex: Pass proper call-site ip Message-ID: <20220301194720.GJ11184@worktop.programming.kicks-ass.net> References: <20220301010412.431299-1-namhyung@kernel.org> <20220301010412.431299-4-namhyung@kernel.org> <20220301095354.0c2b7008@gandalf.local.home> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20220301095354.0c2b7008@gandalf.local.home> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Mar 01, 2022 at 09:53:54AM -0500, Steven Rostedt wrote: > On Tue, 1 Mar 2022 10:05:12 +0100 > Peter Zijlstra wrote: > > > On Mon, Feb 28, 2022 at 05:04:11PM -0800, Namhyung Kim wrote: > > > The __mutex_lock_slowpath() and friends are declared as noinline and > > > _RET_IP_ returns its caller as mutex_lock which is not meaningful. > > > Pass the ip from mutex_lock() to have actual caller info in the trace. > > > > Blergh, can't you do a very limited unwind when you do the tracing > > instead? 3 or 4 levels should be plenty fast and sufficient. > > Is there a fast and sufficient way that works across architectures? The normal stacktrace API? Or the fancy new arch_stack_walk() which is already available on most architectures you actually care about and risc-v :-) Remember, this is the contention path, we're going to stall anyway, doing a few levels of unwind shouldn't really hurt at that point. Anyway; when I wrote that this morning, I was thinking: unsigned long ips[4]; stack_trace_save(ips, 4, 0); > Could objtool help here? There's a contradition there... objtool is still x86_64 only :-/ IIRC there's been work on s390, arm64 and power objtool, but so far none of them actually made it in.