Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp10865532imu; Thu, 6 Dec 2018 08:00:17 -0800 (PST) X-Google-Smtp-Source: AFSGD/Wh0cfYgvivfDFM+LfHoFNjiQtJKH6tnE6ECo6sU9qFPtBeaiD0kwGpPASfR8ORlePJrFTF X-Received: by 2002:a63:7cf:: with SMTP id 198mr25042587pgh.129.1544112017925; Thu, 06 Dec 2018 08:00:17 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1544112017; cv=none; d=google.com; s=arc-20160816; b=Nz46x3UX+oBf4mAtlv+tJc4iX95HTHKKFdJn4ILYQgig2Dete5DNK7kgF8DKoHV7W/ Dmhl3oXngXaCgHZ11ZqzlrO0nMAQNBq++BIMNPnNY8eEnvZh2eEMKJ1cpoXIkcbgDPB9 OfJdVY3LTrDKBedHiiXTif5h8VQAZi+Jjemj0MYWqIz62sFJedgeP3BwsAKYOdRg5MQR +EwyEBRokqk8XVU/czz/u9RhUQwMcAMFJVThMBAs0EjNLUUEXlxMo9TFBsUnhhhKHNyv mV+U+lr5vasbxumfswijseQbqPHCvY29TOMborl7pWl6h1ZDGH/iutn30BjPNbJ3eZ2W A8kg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:subject:cc:to:from:date; bh=cCai3Pbi9IKj6L4rHeNzQpoKsjYMfhtDcup3CCvfy2M=; b=QBtxhylbU6aErr3pnebzRgjhmElQYy8fOeEe10CAUbO34cFaYtnYmJex5cNW5jdyBf 5PCQfk0C2loL2wiAmVzP4T0n6jSkUiFDzFBBbnrQ0Dw3l4AQ3z4zwtfYgDOBEB8P2/2W aQM+BflYblLV/RSu7q3wxN2jZuI6yoMVhcqLTYe2jl8V+P4PXCZaHd3JCN08gFhDPwW4 8k5g1ZAXtTeezWuTPFTiWkFYs10cKuCpqwQEzsuHpXPy1p45Aka/MtM6OUTikacKVZNR MuD51zByGD1JegpyItFxC6zF55yCw8O8yTTRoexzMBDfIXmo3D22KPl5KS0QjHdOMPmR xFOg== 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.07.59.58; Thu, 06 Dec 2018 08:00:17 -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 S1725994AbeLFP7S (ORCPT + 99 others); Thu, 6 Dec 2018 10:59:18 -0500 Received: from mail.kernel.org ([198.145.29.99]:49474 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725921AbeLFP7S (ORCPT ); Thu, 6 Dec 2018 10:59:18 -0500 Received: from vmware.local.home (unknown [208.91.3.26]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 4C905214C1; Thu, 6 Dec 2018 15:59:17 +0000 (UTC) Date: Thu, 6 Dec 2018 10:59:14 -0500 From: Steven Rostedt To: Will Deacon 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: <20181206105914.7a29efa9@vmware.local.home> In-Reply-To: <20181206132007.GB27744@arm.com> References: <20181205174852.435233070@goodmis.org> <20181205183304.000714627@goodmis.org> <20181206132007.GB27744@arm.com> X-Mailer: Claws Mail 3.15.1 (GTK+ 2.24.32; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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. -- Steve