Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp10772286imu; Thu, 6 Dec 2018 06:35:23 -0800 (PST) X-Google-Smtp-Source: AFSGD/XYMaPy4pZPlrzUl1XtFgphzOF2AKdPStUBVYv2xy90MOqqyLYw83nOQe7/cgW73r/WgRyN X-Received: by 2002:a63:5f95:: with SMTP id t143mr24520250pgb.395.1544106922986; Thu, 06 Dec 2018 06:35:22 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1544106922; cv=none; d=google.com; s=arc-20160816; b=rh1K+IicHWJLSUDpkC9WuxLllmu2lvao7GoTZ7B/Zsz7bki1CxrJKOHZGzDlEZZFPh jav1EwDJIt8lsNBedtCM5mzwW5VXs07UKqC0s/o3XZg9fi5rMD3Co3UXlGb6aKpx8vcO gbvWrwMykoUlIE/a08SL3mojCIMt/FD7lGjiiEA8lIx4Xpza+O/d3OBTmR17BNFAoIs7 8tmAMyB6X/W0pYqoZA7rTMvO4xwI5jiyf9HrWza9uCuKUNOVqhUnnEqOPjd/9C3qjJc5 tXYWtplVl4qYzmjCFtfja8jvrGgLzKg6AY3zKMaWk19Ba9ORL0DGE8Y4dHQvfvj7zZ9B W25w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=mI3le/AIaBijHw5uZ2k9t8fgzRfmVnmWoFR1dUmPcUk=; b=Sjzd1oirZs+Iwkrgal6vgLa6lN9kRNAeSAfM+a4KZojM/CxCMfj5KPoi5qRK0o13mE Z8i8P6nDB1T44OqeLFpcRA1snH55MLBVKHNLH85qSIZCThyDb81IuLzcxaioOFALpxAX cJ5WOn0neLtjIOBHhJ7tJkQOborL8I1ceUS8wgOaOkQL2VqMBWzRIM65VfqU+Axfy1tZ xsBmJ2Lf4cIGbt6z45r0Hf7vHnHPn8NBqLG47v1L0Z5TPCggVg/CHrvkfkERSAVWTR+A h15SWsiAHV0hWWynXWuijR3H6HObmO0Iw/knqDzsXUXRa/miSHvwuLO0GKi+W4YObm8Q snTQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="dOb/fWf8"; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id c31si360099pgc.465.2018.12.06.06.34.36; Thu, 06 Dec 2018 06:35:22 -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; dkim=pass header.i=@linaro.org header.s=google header.b="dOb/fWf8"; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728764AbeLFOcC (ORCPT + 99 others); Thu, 6 Dec 2018 09:32:02 -0500 Received: from mail-yb1-f194.google.com ([209.85.219.194]:39691 "EHLO mail-yb1-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728052AbeLFOcB (ORCPT ); Thu, 6 Dec 2018 09:32:01 -0500 Received: by mail-yb1-f194.google.com with SMTP id s15so509609ybk.6 for ; Thu, 06 Dec 2018 06:32:01 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=mI3le/AIaBijHw5uZ2k9t8fgzRfmVnmWoFR1dUmPcUk=; b=dOb/fWf8y2Uy9Urs1EeiKNYHSgOo/cOmGNQRiH/6+sSrbRXwjTr/+xiQFBD2tuDf/6 xFnjVL5TJ6rSmaQuNxrrbi721vpKpbb4ubNl/BBPmNaff3DG+YYhqnN8tvvdxBRVhaNQ IQVFmIWX1N7YZTP3ukCzi6ksb/MHPPPri0dM8= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=mI3le/AIaBijHw5uZ2k9t8fgzRfmVnmWoFR1dUmPcUk=; b=B3MZj/s+yFEfkico7oONWifhpt/a//kRHkDMeDoEDiON6OnXTAk8AYlmugTZ8l5iyF w03SUvR2CPpn5SoEb9mrK47nJfcTaXPdU1IFjHzGcnfSqFxKIY7Y/xCjdlYdCpSnb8k4 Ty1uftL9FfrPNg2SCLw9ErBEZ5XFE3ae7c+aZsOkDerr8dxbB2Zf9dS7V19/sC9kMR5c CSOrjZH54OSWTjF4U3bVsw0M6B2fIsPF/BYdxY2UtaBSWNciP9nmoPY9fG2M+AcR3ccU 5rUNvfdoujknoQQO4lHThcsXrpGYac3nPnp9Rf18ZMIWkRjyK+EJnyOKioOC2eomlcHh 6unw== X-Gm-Message-State: AA+aEWYkWdToD8GGYS2mApLJEWrivHjhYaAi7ghkAtcWSdEm4eM9Urk1 HjnufFwEAoYyVszlsz5BNVtQjyTdNfJ75TNTidNSPw== X-Received: by 2002:a81:2e0d:: with SMTP id u13mr28814164ywu.45.1544106720591; Thu, 06 Dec 2018 06:32:00 -0800 (PST) MIME-Version: 1.0 References: <20181205174852.435233070@goodmis.org> <20181205183304.000714627@goodmis.org> <20181206132007.GB27744@arm.com> In-Reply-To: <20181206132007.GB27744@arm.com> From: Anders Roxell Date: Thu, 6 Dec 2018 15:31:49 +0100 Message-ID: Subject: Re: [PATCH 2/2] arm64: ftrace: Set FTRACE_SCHEDULABLE before ftrace_modify_all_code() To: Will Deacon Cc: rostedt@goodmis.org, Linux Kernel Mailing List , Catalin Marinas , Kees Cook , Arnd Bergmann , Linux ARM , mingo@kernel.org Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, 6 Dec 2018 at 14:19, 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... > > Acked-by: Will Deacon Tested-by: Anders Roxell Cheers, Anders > > Thanks, Steve! > > Will