Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp10876353imu; Thu, 6 Dec 2018 08:08:13 -0800 (PST) X-Google-Smtp-Source: AFSGD/XOdCDpyAoXyi9C6GjAavAZG3vpbVJdmmNV/z1xbkqa6dW+zqYXtO7eOn3rJ1bwRU4vU2vF X-Received: by 2002:a17:902:6bc4:: with SMTP id m4mr27438245plt.93.1544112492899; Thu, 06 Dec 2018 08:08:12 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1544112492; cv=none; d=google.com; s=arc-20160816; b=dpE1QyNi3y4YUKRHPj4MIDdD/sL8/TVntGg4g22eq7wCx7sJPSuEBVWxG1t9f0o9X+ yP8dHxJhfz7wWYZpePOEANicChtAai+9aKkDDfbamBjohwQctEjO+n0TzraSURd+NoqR 3lSBGT7aoVyHhMfjJtic+oNF9r2wVi3KVi84V8x+yaqwN9je29tMctL4PPiGu6uruwAM yHhPiBy5FuETXXSrNP3CMX6EaIDyakXd7d4rupKX+2x5JNYoCLCHQebiw7mjzSxGccbg RmJugfsrEoSEzZeP6Exx85osA23EU5F/M88J4TjBujL9DBgE/VJ3SeseEumIr5uIeuSG spXA== 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; bh=c7YO1+PaOHyfyy4CJ2Dv8qBe3+uUlvkHmMWO7lWfEH0=; b=wOUtAFWjByhOLDFUQWdCsPHuXRTBUnjRkYUBGCfcqWZXxpmluLBb4WnUPQ/F7GKVE0 QfO6LT3mg/6qrzw3YgCT9q+SGibqsFxBtfNzomzx7xWTheRTp/ca635V8ouAfdG/wb9g +bcOTko8PJ+OCawzBSoMAJMwJNlS9HwjMFu/eb9m+EqNNcWtbU1EhHSGc7/Tx/L6hsTW 2/Q1BJAnbu+O2KOi5OFtDKKIsf+mxizFjaZ7kdzYbV9qF/ZOhgqkc0Iobx11JCXodT3m Er9Nu8hLu0GaJSp5Ld7filpYCiAxcda0hxWurtodj3acS9MvBQeCV4pLCQu/uEuw/pQC d7YQ== 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 s5si475216pgl.481.2018.12.06.08.07.32; Thu, 06 Dec 2018 08:08:12 -0800 (PST) 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 S1725972AbeLFQG0 (ORCPT + 99 others); Thu, 6 Dec 2018 11:06:26 -0500 Received: from usa-sjc-mx-foss1.foss.arm.com ([217.140.101.70]:54406 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725862AbeLFQGZ (ORCPT ); Thu, 6 Dec 2018 11:06:25 -0500 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.72.51.249]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 11E7180D; Thu, 6 Dec 2018 08:06:25 -0800 (PST) Received: from edgewater-inn.cambridge.arm.com (usa-sjc-imap-foss1.foss.arm.com [10.72.51.249]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPA id D644E3F59C; Thu, 6 Dec 2018 08:06:24 -0800 (PST) Received: by edgewater-inn.cambridge.arm.com (Postfix, from userid 1000) id F052C1AE0BD1; Thu, 6 Dec 2018 16:06:45 +0000 (GMT) Date: Thu, 6 Dec 2018 16:06:45 +0000 From: Will Deacon To: Steven Rostedt Cc: linux-kernel@vger.kernel.org, catalin.marinas@arm.com, keescook@chromium.org, arnd@arndb.de, linux-arm-kernel@lists.infradead.org, Anders Roxell , Ingo Molnar Subject: Re: [PATCH 2/2] arm64: ftrace: Set FTRACE_SCHEDULABLE before ftrace_modify_all_code() Message-ID: <20181206160645.GA4728@arm.com> References: <20181205174852.435233070@goodmis.org> <20181205183304.000714627@goodmis.org> <20181206132007.GB27744@arm.com> <20181206105914.7a29efa9@vmware.local.home> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20181206105914.7a29efa9@vmware.local.home> User-Agent: Mutt/1.5.23 (2014-03-12) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Dec 06, 2018 at 10:59:14AM -0500, Steven Rostedt wrote: > On Thu, 6 Dec 2018 13:20:07 +0000 > Will Deacon wrote: > > > On Wed, Dec 05, 2018 at 12:48:54PM -0500, Steven Rostedt wrote: > > > From: "Steven Rostedt (VMware)" > > > > > > It has been reported that ftrace_replace_code() which is called by > > > ftrace_modify_all_code() can cause a soft lockup warning for an > > > allmodconfig kernel. This is because all the debug options enabled > > > causes the loop in ftrace_replace_code() (which loops over all the > > > functions being enabled where there can be 10s of thousands), is too > > > slow, and never schedules out. > > > > > > To solve this, setting FTRACE_SCHEDULABLE to the command passed into > > > ftrace_replace_code() will make it call cond_resched() in the loop, > > > which prevents the soft lockup warning from triggering. > > > > > > Link: http://lkml.kernel.org/r/20181204192903.8193-1-anders.roxell@linaro.org > > > > > > Reported-by: Anders Roxell > > > Signed-off-by: Steven Rostedt (VMware) > > > --- > > > arch/arm64/kernel/ftrace.c | 1 + > > > 1 file changed, 1 insertion(+) > > > > > > diff --git a/arch/arm64/kernel/ftrace.c b/arch/arm64/kernel/ftrace.c > > > index 57e962290df3..9a8de0a79f97 100644 > > > --- a/arch/arm64/kernel/ftrace.c > > > +++ b/arch/arm64/kernel/ftrace.c > > > @@ -193,6 +193,7 @@ int ftrace_make_nop(struct module *mod, struct dyn_ftrace *rec, > > > > > > void arch_ftrace_update_code(int command) > > > { > > > + command |= FTRACE_SCHEDULABLE; > > > ftrace_modify_all_code(command); > > > } > > > > Bikeshed: I'd probably go for FTRACE_MAY_SLEEP, but I'm not going to die > > on that hill so... > > I like bike sheds. Hmm, it's not too late to change this. Perhaps I > will. > > > > > Acked-by: Will Deacon > > Thanks! > > If I decide to change the name to MAY_SLEEP, I assume I can still keep > your Acked-by. Of course! Will