Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp1201657imu; Wed, 28 Nov 2018 06:12:31 -0800 (PST) X-Google-Smtp-Source: AFSGD/VtMespefDixul32jEbmRJQtOE4yCvCiLivCqqFonfH9h9URmi5Tvu7z5rZHnrR4nZXMHM3 X-Received: by 2002:a17:902:765:: with SMTP id 92mr2476972pli.242.1543414351024; Wed, 28 Nov 2018 06:12:31 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1543414350; cv=none; d=google.com; s=arc-20160816; b=E5I3DpPdzodahICYegAqj4C2j+88ZsFBrXgVdOW8AIuAS8PayFDeNcZNXKN/WwPMO2 d5L1DxANrAIe9iT93/eKSkqWLTWBzVtFjQtxsSxIxove3rdcur7VOTxlvgpkGPIMndWk YtD6f5Z2Mr4sk3crqccEGhco0MVj3He+bH69n2m6Qe7QZE5bodKLVRUHsuz9Ftzz2fVV uK3Ju7/FulIrmC9mIm/VXxf5FezKZYyvU2//B2xryb72+YY8bD/HGoVX/uhljVgk598l CUVdrcsFS+KRRnv+2Gky5rJmnQT2kz2wj+UhLBPajrCYng2be+GsxJHGjFkeFR2HJ5ic LqhA== 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=M+YFfMLkGyNtuD77TOfZpOhk5KjEfgwUjnByA7CWRZ8=; b=w1TD1o6vAobcAF4UuVEPPg9xKNHG/eeU0R8hf8YTGYnpmj5OwswpG57gMIAXJnBKa4 k0WHLhxJi7XN4VdNkhSjKhTzhKkbxEjT2nVeVIMBUzKwqTcxsjbon5sTo0ZFTtfwwEMK OI+wf7CYsB7qbkbJ9RVblgqmRctmEq+gdOFcNCu2FpzhGqeR5FS9xyd3gqRnTBhpnwBi MXPE/ECwje9mSJ5NsIDq3LxgIjaxYZC0qIPUvpcJAkZKccJPe8h2e59q4ZSV9hJx2cTs TVxLM7GXJT1EzjjHbBNEod2JeAYFTChQzy6v6p/1Ny7cZjQxPtlDFmFM6RvGoRt4aW3I CinQ== 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 193si7230999pgc.220.2018.11.28.06.12.13; Wed, 28 Nov 2018 06:12:30 -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 S1728102AbeK2BKx (ORCPT + 99 others); Wed, 28 Nov 2018 20:10:53 -0500 Received: from mail.kernel.org ([198.145.29.99]:37382 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727726AbeK2BKx (ORCPT ); Wed, 28 Nov 2018 20:10:53 -0500 Received: from gandalf.local.home (cpe-66-24-56-78.stny.res.rr.com [66.24.56.78]) (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 70498206B6; Wed, 28 Nov 2018 14:09:05 +0000 (UTC) Date: Wed, 28 Nov 2018 09:09:03 -0500 From: Steven Rostedt To: Anders Roxell Cc: mingo@redhat.com, akpm@linux-foundation.org, dvyukov@google.com, linux-kernel@vger.kernel.org, Arnd Bergmann Subject: Re: [PATCH 2/2] kernel/trace: fix watchdog soft lockup Message-ID: <20181128090903.7a27ae58@gandalf.local.home> In-Reply-To: <20181128081334.18408-1-anders.roxell@linaro.org> References: <20181128081334.18408-1-anders.roxell@linaro.org> X-Mailer: Claws Mail 3.16.0 (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 Wed, 28 Nov 2018 09:13:34 +0100 Anders Roxell wrote: > When building a allmodconfig kernel for arm64 and boot that in qemu, > CONFIG_FTRACE_STARTUP_TEST gets enabled and that takes time so the > watchdog expires and prints out a message like this: > 'watchdog: BUG: soft lockup - CPU#0 stuck for 22s! [swapper/0:1]' > Each time the function ftrace_replace_code gets called it stays in that > functions loop for 41424 times. > Rework so that function cond_resched() gets called in the > ftrace_replace_code loop. > > Co-developed-by: Arnd Bergmann > Signed-off-by: Arnd Bergmann > Signed-off-by: Anders Roxell > --- > kernel/trace/ftrace.c | 4 ++++ > 1 file changed, 4 insertions(+) > > diff --git a/kernel/trace/ftrace.c b/kernel/trace/ftrace.c > index 5b4f73e4fd56..3f456921dedf 100644 > --- a/kernel/trace/ftrace.c > +++ b/kernel/trace/ftrace.c > @@ -2426,6 +2426,10 @@ void __weak ftrace_replace_code(int enable) > > do_for_each_ftrace_rec(pg, rec) { > > + /* This loop can take minutes when sanitizers are enabled, so > + * lets make sure we allow RCU processing. > + */ > + cond_resched(); > if (rec->flags & FTRACE_FL_DISABLED) > continue; > NACK. On some architectures this code is run from stop machine. We can't call cond_resched() because it may be called with interrupts disabled. This is a weak function. If arm64 has special needs, just copy it in the arm64 code. -- Steve