From patchwork Wed Nov 28 08:13:34 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Anders Roxell X-Patchwork-Id: 152235 Delivered-To: patch@linaro.org Received: by 2002:a2e:299d:0:0:0:0:0 with SMTP id p29-v6csp799720ljp; Wed, 28 Nov 2018 00:13:49 -0800 (PST) X-Google-Smtp-Source: AFSGD/VKmkKIGQo+M8HaJvFNhaHKAu3ZyJeMBWZM4bNPlF00ud6UG5hqvSP+owc3h9K5YQbxVqzm X-Received: by 2002:a17:902:28e6:: with SMTP id f93mr30186044plb.239.1543392829769; Wed, 28 Nov 2018 00:13:49 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1543392829; cv=none; d=google.com; s=arc-20160816; b=clpcx0nQGgKwpa3KjnAFOh2JzQdYZKAoGZjqUV3PaF8VwbNW3nl03YE0AoISOj1NeI It5jOt/TTd/LT3WSqgCXuwkWdIgZyJUYi3crbVzPOWSgtwrl9A4tt8/fXAu+f/7kQGqc VB55PKZKGxC1eLSh8HBvOqOV1H72wSbWJRbkqMubAgIJ5oAPZeAM0HuSZ2VbY3StdFdh 9C8F0veS/wdKKmB9LHO2/Kl6Ve+/qhqry+9Bp7TiC7Ez/zECe3NYyob9DlzPzSRHi3DZ SwUdAWUIZ+SfGQ+/PoiBNX5km+3uGDgN2t8qZz4aRsob8Fr4qUY9zdo4dhHy15GFfSHm HtGQ== 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 :message-id:date:subject:cc:to:from:dkim-signature; bh=sT28w4VqOiNSTrHJbFMJkn4OXQZ517REFZ8xfo8WT/o=; b=jmkLuu1JWEKFOrvm3y6Y0NYb9S4UYn+3w8bvmY3o51jwNqTkENqF22Gm9ZHlymymI7 LKxfh8MSHa4reg1qsjpvCuDNoAF0CKc6JqubhLxB6/Dck7tLLLp+C6faEz0AjzAbiVYs SJ4AtkbSdiYSw2uh9ivK0ZAbku2Juc3fxa+Qn9sxt/JFc6SDJ7gwfCIkMuI4oArjGAGV g313yqTkCJ2SapzET92IA6NSsz7P7Py4Ro83EEebR8IeWURMZSRbmsXDrvzekRJXRxV0 75CgFUXEUXACgrR0vYRKgfyDppKziXwIcAm07jfy7L2JJaHUPmhY72Iomm+sg1JXQ2aM v2QQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=TN8CsGdF; 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 j14si6290042pgi.354.2018.11.28.00.13.49; Wed, 28 Nov 2018 00:13:49 -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=TN8CsGdF; 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 S1727851AbeK1TOd (ORCPT + 32 others); Wed, 28 Nov 2018 14:14:33 -0500 Received: from mail-lj1-f196.google.com ([209.85.208.196]:38456 "EHLO mail-lj1-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727486AbeK1TOd (ORCPT ); Wed, 28 Nov 2018 14:14:33 -0500 Received: by mail-lj1-f196.google.com with SMTP id c19-v6so22588500lja.5 for ; Wed, 28 Nov 2018 00:13:46 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=sT28w4VqOiNSTrHJbFMJkn4OXQZ517REFZ8xfo8WT/o=; b=TN8CsGdFbbenE7mu/JYYtv4IVkpnM9+vR+llRyr3LjP8CTf3KXpi8JRramebxF2HdR FIT1M4NMjw/Pmu5aUd+e7s9Fjuwn33qwKa+i8QdEigaEvT0ZNh7e/8PEEFwis9nPOnN5 Lqxf5craHUcP9T5vJ2OxS/lfdyWcxZ9tt8BEE= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=sT28w4VqOiNSTrHJbFMJkn4OXQZ517REFZ8xfo8WT/o=; b=oriPBy6T2ZzHzHs58l6wRcBsoRH6/lG7IDMVlxTVFiUpMR/VX/nCQ5Jq6RMq50dEz8 1r354pw5N3xDl3DUpH/2f0GqDSNj2ISNI1onF1GHpIrLEtA1eI7arT6sAAeAXWi5iB09 tHPdZqmpLvv6rWyW4ySBWoyRnPwn064wFv9ZXH3K+UdeItpDB6ZIM5ZDQFE2LTZ9tDsK HJeiR8tKYQYD4bFXhYdth7jBiR/MZncPZD+55FX0jzoyp6CYjCrAcQRbc7xAugfDYfQy JksKMGP9UTQ0N4I8CHOghnMGkD4sJTsoX4EqFULT0DIy1KhOlXqlgg6iSRjPOYtLcGiB DmFQ== X-Gm-Message-State: AA+aEWZuqELfW5ZVMrn8BmBI6xHW9d4CKdjEVa6y1jgjkBRXEDP+RJUu RbiU4bx+HILd57Xizkhc28AZfA== X-Received: by 2002:a2e:568b:: with SMTP id k11-v6mr22525904lje.105.1543392826029; Wed, 28 Nov 2018 00:13:46 -0800 (PST) Received: from localhost (c-732171d5.07-21-73746f28.bbcust.telenor.se. [213.113.33.115]) by smtp.gmail.com with ESMTPSA id f8sm1215827lfe.72.2018.11.28.00.13.45 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Wed, 28 Nov 2018 00:13:45 -0800 (PST) From: Anders Roxell To: rostedt@goodmis.org, mingo@redhat.com Cc: akpm@linux-foundation.org, dvyukov@google.com, linux-kernel@vger.kernel.org, Anders Roxell , Arnd Bergmann Subject: [PATCH 2/2] kernel/trace: fix watchdog soft lockup Date: Wed, 28 Nov 2018 09:13:34 +0100 Message-Id: <20181128081334.18408-1-anders.roxell@linaro.org> X-Mailer: git-send-email 2.19.2 MIME-Version: 1.0 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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(+) -- 2.19.2 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;