Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp483994yba; Mon, 1 Apr 2019 10:12:46 -0700 (PDT) X-Google-Smtp-Source: APXvYqz3PdL7GZyLPf9bI6q9H/+XuoSeHStPZs2CRjxYL8j1mB4zuvESDRm9c4mwIhm57NZm5TyD X-Received: by 2002:a63:1203:: with SMTP id h3mr29026327pgl.164.1554138766544; Mon, 01 Apr 2019 10:12:46 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1554138766; cv=none; d=google.com; s=arc-20160816; b=gqMM6mO3VCj0hCvxjIBq3BNBC7pxkcVan/2oUnAqxf/q7KwH7his9VJ8BnJ0vJwdBR VmNUMa6TSjDw3dGTEP3e2g6RCMVFrpSvQEiBBIvVnyXKilr8X2uEGAytmqKeFO7D2EWX kgP6Gwr/+FpLv5HhpP1bnYgNeUScER8/cqfZ02dUbJ1xwSFifybLIFCM7ajx/7907Y/7 vpSfUSCyqTe1UxcTGh+r06JAEsXZwUwEEIITFc1GsbxeuGvTnZZIVRSh0XkbO+aT3Tjr ucNumhEBZRxDxP8z6QfcQu38aZv08cb1DsyzaQNJ8DRFRfZOfv5KwGcoZNvjkrbUpdO9 SOqg== 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 :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=BLtyCFtYZYs/L9I9sBY7HNb3U2pWkvbDWpUMALvY1ts=; b=kNGfOxt064sOwPhXOYj7C2ldmBqzixAobl8ngHNqeupqptMQGfuWTsCW4GGngGV77W AzA2Jucr89L8evs2obzWb/DCAO0YufcykgZ4nU9vbyX+mZ/5/0bC56ec+3jnSsWHB1TB HnZBjGWoz8rf/gehMz+xwb2G5HOP7FYDg6Sa7bX7Eh2Qz4L5m8HK6z6y+0P3I2H/qBbK 72sSGVH0+ZcsheHJ+wJT0Vom2wUFy2U/vjbFkvECp4z+WtXWOMVpWh+gVGhtt329Amkz TXXKnAep0Rc0Zv2qPgRxaFaY4FT7oWS58LtgpByrvnNS/1j6WJ8rcnJ4dsf8b9DGLM00 Oelw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=fIHgYeSk; 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 y5si9095764pfm.191.2019.04.01.10.12.31; Mon, 01 Apr 2019 10:12:46 -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; dkim=pass header.i=@kernel.org header.s=default header.b=fIHgYeSk; 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 S1730191AbfDARL0 (ORCPT + 99 others); Mon, 1 Apr 2019 13:11:26 -0400 Received: from mail.kernel.org ([198.145.29.99]:60056 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729158AbfDARLZ (ORCPT ); Mon, 1 Apr 2019 13:11:25 -0400 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (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 2558921925; Mon, 1 Apr 2019 17:11:23 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1554138684; bh=LdiyFkb6NVjAtOkm4fbmXiEsjqv5LynCugiO63gTWpE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=fIHgYeSk1rcEGTqQ2VHvjVHn3BBX1zdSEfI3sgDLxrOIJXFfsF7IvTe8sqIGReQWs ohtLLW+FrCefgCD1Z01ixSDfa7JjN3Sr8UO9YMGA7AZmTmrdJSp+MbSFSb2ZBsgdeu lehgnfGqkhX3FgxczBBwIfX2ADeTzTsbljha3Nqk= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Maxime Coquelin , Thomas Gleixner , Peter Zijlstra , Oleg Nesterov , Michael Ellerman , Nicholas Piggin , Don Zickus , Ricardo Neri Subject: [PATCH 5.0 139/146] watchdog: Respect watchdog cpumask on CPU hotplug Date: Mon, 1 Apr 2019 19:02:31 +0200 Message-Id: <20190401170059.837200915@linuxfoundation.org> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20190401170048.449559024@linuxfoundation.org> References: <20190401170048.449559024@linuxfoundation.org> User-Agent: quilt/0.65 X-stable: review X-Patchwork-Hint: ignore MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 5.0-stable review patch. If anyone has any objections, please let me know. ------------------ From: Thomas Gleixner commit 7dd47617114921fdd8c095509e5e7b4373cc44a1 upstream. The rework of the watchdog core to use cpu_stop_work broke the watchdog cpumask on CPU hotplug. The watchdog_enable/disable() functions are now called unconditionally from the hotplug callback, i.e. even on CPUs which are not in the watchdog cpumask. As a consequence the watchdog can become unstoppable. Only invoke them when the plugged CPU is in the watchdog cpumask. Fixes: 9cf57731b63e ("watchdog/softlockup: Replace "watchdog/%u" threads with cpu_stop_work") Reported-by: Maxime Coquelin Signed-off-by: Thomas Gleixner Tested-by: Maxime Coquelin Cc: Peter Zijlstra Cc: Oleg Nesterov Cc: Michael Ellerman Cc: Nicholas Piggin Cc: Don Zickus Cc: Ricardo Neri Cc: stable@vger.kernel.org Link: https://lkml.kernel.org/r/alpine.DEB.2.21.1903262245490.1789@nanos.tec.linutronix.de Signed-off-by: Greg Kroah-Hartman --- kernel/watchdog.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) --- a/kernel/watchdog.c +++ b/kernel/watchdog.c @@ -547,13 +547,15 @@ static void softlockup_start_all(void) int lockup_detector_online_cpu(unsigned int cpu) { - watchdog_enable(cpu); + if (cpumask_test_cpu(cpu, &watchdog_allowed_mask)) + watchdog_enable(cpu); return 0; } int lockup_detector_offline_cpu(unsigned int cpu) { - watchdog_disable(cpu); + if (cpumask_test_cpu(cpu, &watchdog_allowed_mask)) + watchdog_disable(cpu); return 0; }