Received: by 10.213.65.68 with SMTP id h4csp1715379imn; Mon, 19 Mar 2018 11:15:38 -0700 (PDT) X-Google-Smtp-Source: AG47ELu0VzhNX9D+ET9jAV98p5rLV9a0JHGxACybvqrzPiArigNZSHCMJuojzcakt/QOg7hmEvWg X-Received: by 10.98.14.215 with SMTP id 84mr6775011pfo.168.1521483338641; Mon, 19 Mar 2018 11:15:38 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1521483338; cv=none; d=google.com; s=arc-20160816; b=rhI5+enJXMBk6JlxS0E5Zu7HOZ7AA6yaFY1wu5COcla/JEZylraDtsFT70yhtruzGX aMBtNs9GXKi0IPjlnqcxtABsfSd8U7/N4GVVLPJK3vGCCY/1F/j8x96NBK/ZbMuB46oU ERQGlPFLpxmshOqDXKGAV6ONn0rsJv6MKl35ZnsQEIBetfI41NASmOB4fCDGysYJKmtl rMsmX7LyLnXwwK9lEc0oH3O6hKt8E1Y5NbQpRBX6Po6hbPHmWzR7G2ohlqrEFM9otaxq +BENs5hGT9XuWgcJlWzAfs/YmtOq8qa3UZn/10yuwdPogrPFo2ws7KgbMnQQ3HziArbl ed6A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:user-agent:references :in-reply-to:message-id:date:subject:cc:to:from :arc-authentication-results; bh=N+at5ppSPd3FQ83ZSPXaraLQ/2/NKEfmCu7Ri2WuBpk=; b=dFE1hlimrT5Rqxf/ozcpVAnmQ64hsG0TCIyFE9k6nmKbyABMnVAINsqOh14G0qK21h zaBDA3p9JU29aRVr2EDC4zACnH841V24Iu098IdM1za/7sCbK+DWQaUNud6lxLNPRBbi fOAyQA4vm1U0ltpz+9/wM/4B/nsFLffPfZB7DK6A9GHFmCLcJT6Iw+xHaBjqOlQVrluc kWdQfflFOwLq/P7mep1f+OivevUUqnAzU1gmf1wAuZMS0C3xQSiJ6iR8f2Vfwyx/RpqJ cUR/OmvTEr9Fy6O5T70BE2Jog87MnaNExnHVe6sWHTOpNKZAwISws+xUdVPozXAQlyqb R4RQ== 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 o68si337279pfk.132.2018.03.19.11.15.24; Mon, 19 Mar 2018 11:15:38 -0700 (PDT) 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 S1030540AbeCSSNR (ORCPT + 99 others); Mon, 19 Mar 2018 14:13:17 -0400 Received: from mail.linuxfoundation.org ([140.211.169.12]:42970 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1030483AbeCSSNA (ORCPT ); Mon, 19 Mar 2018 14:13:00 -0400 Received: from localhost (LFbn-1-12247-202.w90-92.abo.wanadoo.fr [90.92.61.202]) by mail.linuxfoundation.org (Postfix) with ESMTPSA id 85B6B11D6; Mon, 19 Mar 2018 18:12:59 +0000 (UTC) From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Tom Hromatka , Rob Gardner , John Stultz , Sasha Levin Subject: [PATCH 4.4 028/134] sysrq: Reset the watchdog timers while displaying high-resolution timers Date: Mon, 19 Mar 2018 19:05:11 +0100 Message-Id: <20180319171853.307322482@linuxfoundation.org> X-Mailer: git-send-email 2.16.2 In-Reply-To: <20180319171849.024066323@linuxfoundation.org> References: <20180319171849.024066323@linuxfoundation.org> User-Agent: quilt/0.65 X-stable: review 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 4.4-stable review patch. If anyone has any objections, please let me know. ------------------ From: Tom Hromatka [ Upstream commit 0107042768658fea9f5f5a9c00b1c90f5dab6a06 ] On systems with a large number of CPUs, running sysrq- can cause watchdog timeouts. There are two slow sections of code in the sysrq- path in timer_list.c. 1. print_active_timers() - This function is called by print_cpu() and contains a slow goto loop. On a machine with hundreds of CPUs, this loop took approximately 100ms for the first CPU in a NUMA node. (Subsequent CPUs in the same node ran much quicker.) The total time to print all of the CPUs is ultimately long enough to trigger the soft lockup watchdog. 2. print_tickdevice() - This function outputs a large amount of textual information. This function also took approximately 100ms per CPU. Since sysrq- is not a performance critical path, there should be no harm in touching the nmi watchdog in both slow sections above. Touching it in just one location was insufficient on systems with hundreds of CPUs as occasional timeouts were still observed during testing. This issue was observed on an Oracle T7 machine with 128 CPUs, but I anticipate it may affect other systems with similarly large numbers of CPUs. Signed-off-by: Tom Hromatka Reviewed-by: Rob Gardner Signed-off-by: John Stultz Signed-off-by: Sasha Levin Signed-off-by: Greg Kroah-Hartman --- kernel/time/timer_list.c | 6 ++++++ 1 file changed, 6 insertions(+) --- a/kernel/time/timer_list.c +++ b/kernel/time/timer_list.c @@ -16,6 +16,7 @@ #include #include #include +#include #include @@ -96,6 +97,9 @@ print_active_timers(struct seq_file *m, next_one: i = 0; + + touch_nmi_watchdog(); + raw_spin_lock_irqsave(&base->cpu_base->lock, flags); curr = timerqueue_getnext(&base->active); @@ -207,6 +211,8 @@ print_tickdevice(struct seq_file *m, str { struct clock_event_device *dev = td->evtdev; + touch_nmi_watchdog(); + SEQ_printf(m, "Tick Device: mode: %d\n", td->mode); if (cpu < 0) SEQ_printf(m, "Broadcast device\n");