Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp4971484yba; Wed, 10 Apr 2019 08:39:33 -0700 (PDT) X-Google-Smtp-Source: APXvYqz0DkE9N9tVIXdCyYNDIX0f3OgaUuaM/qtURjA1m5dyV4M8oJTbW2kl5tG2xwjASFh69p65 X-Received: by 2002:a63:530e:: with SMTP id h14mr6119903pgb.136.1554910773475; Wed, 10 Apr 2019 08:39:33 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1554910773; cv=none; d=google.com; s=arc-20160816; b=RqbBypLRlCF9iz4yhT5rTepmarQAklAw9HPQjF36mFq5ROIowkaTeUtwBVL7V87O6O 2eVtU3cHYLNgekmTASMzNW7YsJZ1wh30vQSQT2c0hB0A5wB2lx/CjMV14yhRH39jLASA SzSJmVfXtJr4Had3A5vl2HzuwANuWR592HU7Pgovmysj3W0H1TK25XSKF9NiZoalRXkH ScF/knUaxRqEVKkvTTfm1UwqC5Dt65HyAUxD4TN/rJeHJzG5HDwkWnfXYodAJNVxsOu9 uJSRQfZWnfxFB6jhVX6LSpebn8nDObx/IopAIhpkSFQwkYJ8GlZHrqWiRaUnib89DF4U ux+g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:user-agent:references :message-id:in-reply-to:subject:cc:to:from:date; bh=qA9VoUswInTjyHa3gttyctUfDjG7M+FSelePeYTtY8E=; b=R6cnhKKgu1q/thtk+Tdp+CSLp8maaGycRGjX6dUTBsngahm/rfEEiq9F6jb35X/rkH 3isyi/xri7tJUPQ5kDphANyCaOVVKjBLhlsnvxI57YD/fhkPIlxeuCEc2bvYToPUIfB3 pk5/8BOgNN4aOEQ9pPdZH7EbqQG+RK1IfvMjxdTbEI+etUzmJSkAyrja+tIGzKLGqRrN qIv6w1sL9CaFfpsbQDeP3X0+XP+hjyx3WA3fIcb6jMBNESjQPCxtZGZwLf24y4hjXpn8 nQdFmt2etyDtQc/LZaRrG517vKZNJrsZ6zHgH/Sd0/woOA9ELyS4B+zEWabr9XEgVx45 UoKg== ARC-Authentication-Results: i=1; mx.google.com; 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 f128si31687859pgc.473.2019.04.10.08.39.15; Wed, 10 Apr 2019 08:39:33 -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; 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 S1731690AbfDJMGO (ORCPT + 99 others); Wed, 10 Apr 2019 08:06:14 -0400 Received: from Galois.linutronix.de ([146.0.238.70]:59213 "EHLO Galois.linutronix.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728687AbfDJMGN (ORCPT ); Wed, 10 Apr 2019 08:06:13 -0400 Received: from [147.83.201.128] (helo=nanos) by Galois.linutronix.de with esmtpsa (TLS1.2:DHE_RSA_AES_256_CBC_SHA256:256) (Exim 4.80) (envelope-from ) id 1hEBzB-0006mW-0N; Wed, 10 Apr 2019 14:05:49 +0200 Date: Wed, 10 Apr 2019 14:05:17 +0200 (CEST) From: Thomas Gleixner To: Johannes Thumshirn cc: LKML , Josh Poimboeuf , x86@kernel.org, Andy Lutomirski , Steven Rostedt , Alexander Potapenko , David Sterba , Chris Mason , Josef Bacik , linux-btrfs@vger.kernel.org Subject: Re: [RFC patch 29/41] btrfs: ref-verify: Simplify stack trace retrieval In-Reply-To: <20190410113115.GB4610@linux-x5ow.site> Message-ID: References: <20190410102754.387743324@linutronix.de> <20190410103646.221275815@linutronix.de> <20190410113115.GB4610@linux-x5ow.site> User-Agent: Alpine 2.21 (DEB 202 2017-01-01) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII X-Linutronix-Spam-Score: -1.0 X-Linutronix-Spam-Level: - X-Linutronix-Spam-Status: No , -1.0 points, 5.0 required, ALL_TRUSTED=-1,SHORTCIRCUIT=-0.0001 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, 10 Apr 2019, Johannes Thumshirn wrote: > On Wed, Apr 10, 2019 at 12:28:23PM +0200, Thomas Gleixner wrote: > > Replace the indirection through struct stack_trace with an invocation of > > the storage array based interface. > > > > Signed-off-by: Thomas Gleixner > > Cc: David Sterba > > Cc: Chris Mason > > Cc: Josef Bacik > > Cc: linux-btrfs@vger.kernel.org > > --- > > fs/btrfs/ref-verify.c | 15 ++------------- > > 1 file changed, 2 insertions(+), 13 deletions(-) > > > > --- a/fs/btrfs/ref-verify.c > > +++ b/fs/btrfs/ref-verify.c > > @@ -205,28 +205,17 @@ static struct root_entry *lookup_root_en > > #ifdef CONFIG_STACKTRACE > > static void __save_stack_trace(struct ref_action *ra) > > { > > - struct stack_trace stack_trace; > > - > > - stack_trace.max_entries = MAX_TRACE; > > - stack_trace.nr_entries = 0; > > - stack_trace.entries = ra->trace; > > - stack_trace.skip = 2; > > - save_stack_trace(&stack_trace); > > - ra->trace_len = stack_trace.nr_entries; > > + ra->trace_len = stack_trace_save(ra->trace, MAX_TRACE, 2); > > > Stupid question: why are you passing a '2' for 'skipnr' and in > stack_trace_save() from your series you set stack_trace::skip as skipnr + 1. > > Wouldn't this result in a stack_trace::skip = 3? Or is it the number of > functions to be skipped and you don't want to have stack_trace_save() saved as > well? Correct. The extra call will shift the skipped one up, so I compensate for that. Thanks, tglx