Received: by 2002:a25:ab43:0:0:0:0:0 with SMTP id u61csp5369116ybi; Tue, 28 May 2019 11:50:55 -0700 (PDT) X-Google-Smtp-Source: APXvYqxhpZD2FscX1TlamVYxrn9VSX7yUGevuqHW7mO2hY78fPhJJMsb7WUelm8sRHfshoMs9JGl X-Received: by 2002:a17:902:f212:: with SMTP id gn18mr75312742plb.106.1559069455570; Tue, 28 May 2019 11:50:55 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1559069455; cv=none; d=google.com; s=arc-20160816; b=g/qbYfm4tZBAqFE7lKXHY96HVBNqS8IFqigACzVOZlypDth+r3gQ+nNfzhfLo3rng4 DA9vKg7xfVteRE0s8thgGKmyTBCB5Z8D0xeAlAhpNxvTHKQGN9rN5O0kofxws5rwNKb2 JQV1hbs4oKVjtUXWsQYjPDWnJ8NTC2hjIyfgyUukS1MgeQu4xP+WsCVLOIXWLXitiuuS P8AKv8286qIl9V1GmOHHwPlJ8D1oMYPzx6c5Zlf8KhHSfpLZg8js0bLxn0ar3YBkxGua R6sxgVccJLLaSg8xqMVWQYGRVwzJZFogTFtBiwdZhKG/egaqpMPsOtVH227QLp0SbZhV YoWA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=wY82HrCXC9QDXU5bRNjvssd+tA05bUg151lPfy3cTs8=; b=VMOd1qJUC5KCj5rpfmcPZIi0ng/SoMzWUY9t5h8wBeTEd954GWjIrSJblmCMo3oaaX wpzwayG8Pui7DVVIpBgleOJ1FFmQ60MBqP8ryfkPJuqEPr//5XduzkyM/WrWA91xWpaA zUfm4HCESLVym2s/q9cTb7ZqixuB1m49j49BZtCq9g49AosloS4ZFRGMRaFyNrwvLHdl M6LJ+Yhu/y7UAKCJst4Va7QOpkkVUjb+qykVr1br9Cmonj8s+w1Mod+sI0Yn1HJFRdB8 Qq1o1NZoX7S2lFx5NH2fMDBYDGR5s8zTsnpUTlqqfyqEMeQ5DhrrGo757ncPBujfg4j6 j3gA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@joelfernandes.org header.s=google header.b=wUceDG+2; 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 y6si11759607pgs.342.2019.05.28.11.50.39; Tue, 28 May 2019 11:50:55 -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; dkim=pass header.i=@joelfernandes.org header.s=google header.b=wUceDG+2; 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 S1726935AbfE1Rqk (ORCPT + 99 others); Tue, 28 May 2019 13:46:40 -0400 Received: from mail-pl1-f196.google.com ([209.85.214.196]:46855 "EHLO mail-pl1-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726452AbfE1Rqj (ORCPT ); Tue, 28 May 2019 13:46:39 -0400 Received: by mail-pl1-f196.google.com with SMTP id bb3so1020573plb.13 for ; Tue, 28 May 2019 10:46:39 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=joelfernandes.org; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=wY82HrCXC9QDXU5bRNjvssd+tA05bUg151lPfy3cTs8=; b=wUceDG+2+NcHsQ1DywnJSqBjcRsvqC3nkJYqAlkaiuODqiUjprIgQeRiOoLxGvt9gm +xEsuLIBihqGYcomYAVvZCxIDVeBRVL47nluCaFUAOqKBeml7mFY/I6/nPr5yWVyGtoH 40r4/w1cjJBJm7XNsAKqJRUxRpASvWZbxNKJs= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=wY82HrCXC9QDXU5bRNjvssd+tA05bUg151lPfy3cTs8=; b=q0RbcNe7yb4k9v+hfLEhgY4/RgDlWU4BqVSi/Hj0nYqAVjcd8ZhAAwGKOe2KpU0/K4 ix9VNiJTZur3PEFQRIRuTfgLHlX8I++DWIH6KAig0FuAFzyH9fieQ2q0geVCVTwrQ8vY nV7GFlZjNkECsP+iYdvZeaba6dp1wObL4/GFIbR6nqLdTwvs6hW2VUHrqVYA4HmKCFv8 rx/tTGlqtH9Ge6xrwVoflvwsyQdXUhHyiP4vQqZ6KtWCekJAKac2IGamvryQAcljuSbV 1rh6+QCg+1nLgnPx+jBGLusIQQGjWcYlZ+myYCj3rCs51lnivgt+8PTqAWYAnpckitFV s9UQ== X-Gm-Message-State: APjAAAWkNsKbGruaxUtbmd9FBsqbT4kBK825tHTcQJ87OBMsOXPyrooq K9OPXzytiuRObMVGZlo3JCO8dQ== X-Received: by 2002:a17:902:148:: with SMTP id 66mr75747265plb.143.1559065598901; Tue, 28 May 2019 10:46:38 -0700 (PDT) Received: from localhost ([2620:15c:6:12:9c46:e0da:efbf:69cc]) by smtp.gmail.com with ESMTPSA id x28sm16584048pfo.78.2019.05.28.10.46.36 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Tue, 28 May 2019 10:46:36 -0700 (PDT) Date: Tue, 28 May 2019 13:46:35 -0400 From: Joel Fernandes To: Steven Rostedt Cc: linux-kernel@vger.kernel.org, Ingo Molnar , Andrew Morton , Thomas Gleixner , Peter Zijlstra , Masami Hiramatsu , Josh Poimboeuf , Frederic Weisbecker , Andy Lutomirski , Mark Rutland , Namhyung Kim , "Frank Ch. Eigler" Subject: Re: [PATCH 01/16 v3] function_graph: Convert ret_stack to a series of longs Message-ID: <20190528174635.GB252809@google.com> References: <20190525031633.811342628@goodmis.org> <20190525031745.235716308@goodmis.org> <20190528095043.GA252809@google.com> <20190528085826.796157de@gandalf.local.home> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20190528085826.796157de@gandalf.local.home> 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 Tue, May 28, 2019 at 08:58:26AM -0400, Steven Rostedt wrote: > On Tue, 28 May 2019 05:50:43 -0400 > Joel Fernandes wrote: > > > On Fri, May 24, 2019 at 11:16:34PM -0400, Steven Rostedt wrote: > > > From: "Steven Rostedt (VMware)" > > > > > > In order to make it possible to have multiple callbacks registered with the > > > function_graph tracer, the retstack needs to be converted from an array of > > > ftrace_ret_stack structures to an array of longs. This will allow to store > > > the list of callbacks on the stack for the return side of the functions. > > > > > > Signed-off-by: Steven Rostedt (VMware) > > > --- > > > include/linux/sched.h | 2 +- > > > kernel/trace/fgraph.c | 124 ++++++++++++++++++++++++------------------ > > > 2 files changed, 71 insertions(+), 55 deletions(-) > > > > > > diff --git a/include/linux/sched.h b/include/linux/sched.h > > > index 11837410690f..1850d8a3c3f0 100644 > > > --- a/include/linux/sched.h > > > +++ b/include/linux/sched.h > > > @@ -1113,7 +1113,7 @@ struct task_struct { > > > int curr_ret_depth; > > > > > > /* Stack of return addresses for return function tracing: */ > > > - struct ftrace_ret_stack *ret_stack; > > > + unsigned long *ret_stack; > > > > Can it be converted to an array of unsigned int so the shadown stack space > > can be better used? This way stack overflow chance is lesser if there are too > > many registered fgraph users and the function call depth is too deep. > > AFAICS from patch 5/13, you need only 32-bits for the ftrace_ret_stack > > offset, type and array index, so the upper 32-bit would not be used. > > > > We can look to improve that later on. This is complex enough and I kept > some features (like 4 byte minimum) out of this series to keep the > complexity down. I believe there are some archs that require 64bit > aligned access for 64 bit words and pointers. And the retstack > structure still has longs on it. If we need to adapt to making sure we > are aligned, I rather keep that complexity out for now. > > That said, I just did a git grep HAVE_64BIT_ALIGNED_ACCESS and only > found the kconfig where it is defined and the ring buffer code that > deals with it. We recently removed a bunch of archs, and it could very > well be that this requirement no longer exists. > > Regardless, I've been testing this code quite heavily, and changing the > stack from moving up to moving down already put me behind. I'd like to > pull this code into linux-next soon. Converting to ints can be done for > the release after we get this in. Ok sure, I agree the conversion to ints can be done at a later time. thanks! - Joel