From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752340AbdI2P5h (ORCPT ); Fri, 29 Sep 2017 11:57:37 -0400 Received: from mx1.redhat.com ([209.132.183.28]:55601 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751836AbdI2P5g (ORCPT ); Fri, 29 Sep 2017 11:57:36 -0400 DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com D027EC04AC52 Authentication-Results: ext-mx07.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx07.extmail.prod.ext.phx2.redhat.com; spf=fail smtp.mailfrom=jpoimboe@redhat.com Date: Fri, 29 Sep 2017 10:57:33 -0500 From: Josh Poimboeuf To: Vlastimil Babka Cc: Thomas Gleixner , Ingo Molnar , "H . Peter Anvin" , x86@kernel.org, Miroslav Benes , linux-kernel@vger.kernel.org Subject: Re: [PATCH v2] x86, stacktrace: avoid recording save_stack_trace wrappers Message-ID: <20170929155733.y4csusut3bmucght@treble> References: <20170907075736.11551-1-vbabka@suse.cz> <20170929092335.2744-1-vbabka@suse.cz> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <20170929092335.2744-1-vbabka@suse.cz> User-Agent: Mutt/1.6.0.1 (2016-04-01) X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.31]); Fri, 29 Sep 2017 15:57:36 +0000 (UTC) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Sep 29, 2017 at 11:23:35AM +0200, Vlastimil Babka wrote: > The save_stack_trace() and save_stack_trace_tsk() wrappers of > __save_stack_trace() add themselves to the call stack, and thus appear in the > recorded stacktraces. This is redundant and wasteful when we have limited space > to record the useful part of the backtrace with e.g. page_owner functionality. > > Fix this by making sure __save_stack_trace() is noinline (which matches the > current gcc decision) and bumping the skip in the wrappers > (save_stack_trace_tsk() only when called for the current task). This is similar > to what was done for arm in 3683f44c42e9 ("ARM: stacktrace: avoid listing > stacktrace functions in stacktrace") and is pending for arm64. > > Also make sure that __save_stack_trace_reliable() doesn't get this problem in > the future by marking it __always_inline (which matches current gcc decision), > per Josh Poimboeuf. > > Signed-off-by: Vlastimil Babka Acked-by: Josh Poimboeuf -- Josh