Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp9807869imu; Wed, 5 Dec 2018 10:34:14 -0800 (PST) X-Google-Smtp-Source: AFSGD/W+DSNS7S/sZY48P3HOaOWi4OBq6M9bbmLbcZQT4r9fu8DHzOaGccEAJAckb3zXyKD2kQB+ X-Received: by 2002:a17:902:7c85:: with SMTP id y5mr25027963pll.63.1544034854793; Wed, 05 Dec 2018 10:34:14 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1544034854; cv=none; d=google.com; s=arc-20160816; b=hRiJ4PqpAqfphUCIYX9taxfR9H98PZknvByrYYhPsEABR/O74JtVimC0MM9n6BoJs7 yZ7Ke3S6mMpjVaoJFUYtNgvbewFYXGIollk6hHUa7euOPn8cRB0w8HMpKzZ//GsA203S nQTj/p83lnt/CIzfdqdE3Rt7/wdABw9uXi6y5kbxGZN68p3BRXBVdzF6kZtLm9or4ou5 e77ce/x9wHK6XHjHvBTDhYnt1uN0JSqQDHUTShJF+5URga0A1YMc9PIezar7iZDikcFq vCsPZ4R04fLxD4Uj28m5CbjSX6jh2sEqswYS7VAAAnLeG0izGwaOk7Q0RAk1hckQjr0c 5u6A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:references:subject:cc:to :from:date:user-agent:message-id; bh=35a/jid/mR1+slYr/CKdKWhTmHy6T0IS07jzHJmKggo=; b=rEgkoPqd5FMwRhKBSo6rHO1k8mVtx35lFOjEO8yDPcKhQvmIzhJ2ZhjsAGT+YBW84N +zdYN9XMRgbiqlKBnGwkEXJqwz5oQnwu+kKvdE7f0gfV7WRTrarBHDe7R85vV/hGTSIG UDVMb6kErP/A+P+DAOPQ8IS+T6ifK/tvy7Sccr0nkrNeX9QLa9VQYh9CFHiubdL+RvUS GTjah3/Z36c3TYpVAoN+95OMRKtzOwmYfW8T6RXaaQ8VYrXubFwqrk6aBpnDfHG2p2Ie HVANzpW9gXwSsLYTDCahhis3NEbFc/kZ4lkNg/m7XFFV46OvhiR8Bj+AyLIQoh/SyG+J rqeQ== 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 r18si17730912pgb.491.2018.12.05.10.33.59; Wed, 05 Dec 2018 10:34:14 -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 S1728312AbeLESdG (ORCPT + 99 others); Wed, 5 Dec 2018 13:33:06 -0500 Received: from mail.kernel.org ([198.145.29.99]:52848 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727297AbeLESdG (ORCPT ); Wed, 5 Dec 2018 13:33:06 -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 097012133F; Wed, 5 Dec 2018 18:33:06 +0000 (UTC) Received: from rostedt by gandalf.local.home with local (Exim 4.91) (envelope-from ) id 1gUbyq-0007jt-2u; Wed, 05 Dec 2018 13:33:04 -0500 Message-Id: <20181205183304.000714627@goodmis.org> User-Agent: quilt/0.65 Date: Wed, 05 Dec 2018 12:48:54 -0500 From: Steven Rostedt To: linux-kernel@vger.kernel.org Cc: catalin.marinas@arm.com, will.deacon@arm.com, keescook@chromium.org, arnd@arndb.de, linux-arm-kernel@lists.infradead.org, Anders Roxell , Ingo Molnar Subject: [PATCH 2/2] arm64: ftrace: Set FTRACE_SCHEDULABLE before ftrace_modify_all_code() References: <20181205174852.435233070@goodmis.org> MIME-Version: 1.0 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 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); } -- 2.19.1