From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Google-Smtp-Source: AH8x226WT+sbjnb+rYzu+FfjIQRWKTEk4HlViTO39FEGS8Ts6fg6fyt/WcluRiDDHb7vKlk5Cx9q ARC-Seal: i=1; a=rsa-sha256; t=1516610939; cv=none; d=google.com; s=arc-20160816; b=XQxp+k988upZdEf0/FvOuY0tRcRcwEjH8rWEqYnZDiTwNbaliNEbddCxAYf4XYY6j5 fwuEABz1sxZsiM7Rz0YEgLXOqhH7/GfZ//vhLguzoYIOdh3G2oxO4rH+MZ9S8h6X9Bos T4II+8dRpPnd3M6D1VZCF3um/QtqIJMP5fvnEQb2FnfVxH/6ViqypB57ACbxZ1TjrgWx tworfVMKGhmUuwx23uzDv/3sTuRiPsazzXj7+EpVPPV+WBs0RBTu+xvQZQEmG9Sse7pG 89K80zuj+Zx9tl/dgvBk8nXunZzNLMCPO9v7I/EIWJvYULU4Dp2UqDr7RCimlEJBK+DH W8/w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=mime-version:user-agent:references:in-reply-to:message-id:date :subject:cc:to:from:arc-authentication-results; bh=duPSZ5kEBolKUDrWHqzPdBevFeR0EJMMNWuxlKfiOKc=; b=snyfmLM9XRmveIhl5FIikDgo/PUqsvL79Je863FpQYUkAAqq5DGWlSfzfkVxdYX4w1 YgZtrRQTf6Ls6sBmcBR7zzSIxbIkRZiUnR+zQ85+iCLvOETq24cS/68Isz3XMD756hte F1Ca8aBItuwV7LjMv49BaaxoovcUk0yEokqRNnrD6fC1OdHP1c+SusK1Z3yeFtbUQdaj 3vpelSstMi3lG7nb+y9afgYAfoWj29OUZpOfGzY+LvdVc8/C4zneNR0xLF/F7UypKK1H gPJcdpwCwkCD1PUrQSyHNgcjT3CfEL6GcGROgEBwkPr5ADvbJTPPNHoqWXhXSwLzGBgW +EQA== ARC-Authentication-Results: i=1; mx.google.com; spf=softfail (google.com: domain of transitioning gregkh@linuxfoundation.org does not designate 90.92.71.90 as permitted sender) smtp.mailfrom=gregkh@linuxfoundation.org Authentication-Results: mx.google.com; spf=softfail (google.com: domain of transitioning gregkh@linuxfoundation.org does not designate 90.92.71.90 as permitted sender) smtp.mailfrom=gregkh@linuxfoundation.org From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Sergey Senozhatsky , Tejun Heo Subject: [PATCH 4.9 36/47] workqueue: avoid hard lockups in show_workqueue_state() Date: Mon, 22 Jan 2018 09:45:47 +0100 Message-Id: <20180122083928.395666885@linuxfoundation.org> X-Mailer: git-send-email 2.16.0 In-Reply-To: <20180122083925.568134913@linuxfoundation.org> References: <20180122083925.568134913@linuxfoundation.org> User-Agent: quilt/0.65 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-LABELS: =?utf-8?b?IlxcU2VudCI=?= X-GMAIL-THRID: =?utf-8?q?1590281832771321451?= X-GMAIL-MSGID: =?utf-8?q?1590281832771321451?= X-Mailing-List: linux-kernel@vger.kernel.org List-ID: 4.9-stable review patch. If anyone has any objections, please let me know. ------------------ From: Sergey Senozhatsky commit 62635ea8c18f0f62df4cc58379e4f1d33afd5801 upstream. show_workqueue_state() can print out a lot of messages while being in atomic context, e.g. sysrq-t -> show_workqueue_state(). If the console device is slow it may end up triggering NMI hard lockup watchdog. Signed-off-by: Sergey Senozhatsky Signed-off-by: Tejun Heo Signed-off-by: Greg Kroah-Hartman --- kernel/workqueue.c | 13 +++++++++++++ 1 file changed, 13 insertions(+) --- a/kernel/workqueue.c +++ b/kernel/workqueue.c @@ -48,6 +48,7 @@ #include #include #include +#include #include "workqueue_internal.h" @@ -4424,6 +4425,12 @@ void show_workqueue_state(void) if (pwq->nr_active || !list_empty(&pwq->delayed_works)) show_pwq(pwq); spin_unlock_irqrestore(&pwq->pool->lock, flags); + /* + * We could be printing a lot from atomic context, e.g. + * sysrq-t -> show_workqueue_state(). Avoid triggering + * hard lockup. + */ + touch_nmi_watchdog(); } } @@ -4451,6 +4458,12 @@ void show_workqueue_state(void) pr_cont("\n"); next_pool: spin_unlock_irqrestore(&pool->lock, flags); + /* + * We could be printing a lot from atomic context, e.g. + * sysrq-t -> show_workqueue_state(). Avoid triggering + * hard lockup. + */ + touch_nmi_watchdog(); } rcu_read_unlock_sched();