Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp10692152imu; Thu, 6 Dec 2018 05:23:05 -0800 (PST) X-Google-Smtp-Source: AFSGD/XRoC/EWt4JKJn/9xPXDhXFr+7Dbuw0vGwXgJXQsxGb8XuGCg/Zq/gArMqMBnzN68fgXeeS X-Received: by 2002:a63:585c:: with SMTP id i28mr24289618pgm.178.1544102585477; Thu, 06 Dec 2018 05:23:05 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1544102585; cv=none; d=google.com; s=arc-20160816; b=LS92WEWzvUgvok2/GeIJi5u8q4r9BJIaWWk01MjsQFFbkAkr3NIQYRR+6SgXK+riVU 5wOOfyBKxQnunNQ2LKnI5pRmDl3avQHGJleZ0HFwn9yNXdwdkijrTu3QOFtmPsnu1sts mVdsxg3f8A8qQCedEpSL6chMJSgbw0BbSCZqog6+pb+Ixi6kEVvrDaUSgPcwJ/aW+eUh wN+0r8L1jKm+ZTn6xhRfLFWuI3eRuinpoSEFzcp8NcqL2kRhhTQXPvGOO9irHFUlVLWW LIbffASMdYzNsp0RzdHeo4kcHncBqZk9IKINpHV9EcnpD7ToTfdBaK2EX2ryNGUA/CGW 8RVg== 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=/zVaehXs9MKK5nCkhtM5te0HgrT5yq+0iRvAAGFJXwQ=; b=wfMhYoy+iOMImZKJZP/GD5+P5Wl8Tr7Sp0sRG5/CQExhw73fOGTIAE7NpKCFQcra2Q wCl3r57rK2dV69LhBfr2HfeKFjZ04m76qeKXwIYDvLyAqYaMq4SHhl1srIYXa227FgK0 tiwkngMXfQqN+3PotOgTa/Qt35XGNxZN/Sv6LQ2tlqV13qNDIdggbfN/TIld+jq1m+Ve lMlYIklhE8HatndxB8HtIfCnHiloWXsuHBghbddKue02PwUPnVhOm2962o3KPPTXl2cP JBidTlZ+dbLbAnVipkfa9GjiGOZBddTuVB4bsbBtL3fxaVshFqxyfsssx5nsXwG9Cocp NmMA== 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 v3si271129pgh.305.2018.12.06.05.22.48; Thu, 06 Dec 2018 05:23:05 -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 S1729668AbeLFNTr (ORCPT + 99 others); Thu, 6 Dec 2018 08:19:47 -0500 Received: from usa-sjc-mx-foss1.foss.arm.com ([217.140.101.70]:50280 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728346AbeLFNTr (ORCPT ); Thu, 6 Dec 2018 08:19:47 -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 1026EA78; Thu, 6 Dec 2018 05:19:47 -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 D47853F575; Thu, 6 Dec 2018 05:19:46 -0800 (PST) Received: by edgewater-inn.cambridge.arm.com (Postfix, from userid 1000) id E7AB51AE0BAD; Thu, 6 Dec 2018 13:20:07 +0000 (GMT) Date: Thu, 6 Dec 2018 13:20:07 +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: <20181206132007.GB27744@arm.com> References: <20181205174852.435233070@goodmis.org> <20181205183304.000714627@goodmis.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20181205183304.000714627@goodmis.org> 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 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... Acked-by: Will Deacon Thanks, Steve! Will