From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-3.8 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 50A40C43603 for ; Tue, 17 Dec 2019 04:38:29 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 2C1B22072B for ; Tue, 17 Dec 2019 04:38:29 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727387AbfLQEi2 (ORCPT ); Mon, 16 Dec 2019 23:38:28 -0500 Received: from mo-csw1515.securemx.jp ([210.130.202.154]:37476 "EHLO mo-csw.securemx.jp" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725836AbfLQEi1 (ORCPT ); Mon, 16 Dec 2019 23:38:27 -0500 Received: by mo-csw.securemx.jp (mx-mo-csw1515) id xBH4cFR5010467; Tue, 17 Dec 2019 13:38:15 +0900 X-Iguazu-Qid: 34tMKo1JevEwTib89y X-Iguazu-QSIG: v=2; s=0; t=1576557494; q=34tMKo1JevEwTib89y; m=R/+K17mdD/Vln+E9qkngc/OrgbDAB07oZZSVseeD9SY= Received: from imx2.toshiba.co.jp (imx2.toshiba.co.jp [106.186.93.51]) by relay.securemx.jp (mx-mr1511) id xBH4cERN039096; Tue, 17 Dec 2019 13:38:14 +0900 Received: from enc01.localdomain ([106.186.93.100]) by imx2.toshiba.co.jp with ESMTP id xBH4cDCh007642; Tue, 17 Dec 2019 13:38:14 +0900 (JST) Received: from hop001.toshiba.co.jp ([133.199.164.63]) by enc01.localdomain with ESMTP id xBH4cDUn017234; Tue, 17 Dec 2019 13:38:13 +0900 Date: Tue, 17 Dec 2019 13:38:10 +0900 From: Nobuhiro Iwamatsu To: Greg Kroah-Hartman Cc: linux-kernel@vger.kernel.org, stable@vger.kernel.org, Tejun Heo , Marcin Pawlowski , "Williams, Gerald S" Subject: Re: [PATCH 4.19 053/140] workqueue: Fix spurious sanity check failures in destroy_workqueue() X-TSB-HOP: ON Message-ID: <20191217043810.xamko46u2g4sdkwp@toshiba.co.jp> References: <20191216174747.111154704@linuxfoundation.org> <20191216174802.938835002@linuxfoundation.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20191216174802.938835002@linuxfoundation.org> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Dec 16, 2019 at 06:48:41PM +0100, Greg Kroah-Hartman wrote: > From: Tejun Heo > > commit def98c84b6cdf2eeea19ec5736e90e316df5206b upstream. > > Before actually destrying a workqueue, destroy_workqueue() checks > whether it's actually idle. If it isn't, it prints out a bunch of > warning messages and leaves the workqueue dangling. It unfortunately > has a couple issues. > > * Mayday list queueing increments pwq's refcnts which gets detected as > busy and fails the sanity checks. However, because mayday list > queueing is asynchronous, this condition can happen without any > actual work items left in the workqueue. > > * Sanity check failure leaves the sysfs interface behind too which can > lead to init failure of newer instances of the workqueue. > > This patch fixes the above two by > > * If a workqueue has a rescuer, disable and kill the rescuer before > sanity checks. Disabling and killing is guaranteed to flush the > existing mayday list. > > * Remove sysfs interface before sanity checks. > > Signed-off-by: Tejun Heo > Reported-by: Marcin Pawlowski > Reported-by: "Williams, Gerald S" > Cc: stable@vger.kernel.org > Signed-off-by: Greg Kroah-Hartman > This commit also requires the following commit: commit 8efe1223d73c218ce7e8b2e0e9aadb974b582d7f Author: Tejun Heo Date: Fri Sep 20 13:39:57 2019 -0700 workqueue: Fix missing kfree(rescuer) in destroy_workqueue() Signed-off-by: Tejun Heo Reported-by: Qian Cai Fixes: def98c84b6cd ("workqueue: Fix spurious sanity check failures in destroy_workqueue()") This is also required to 4.4, 4.9, 4.14 and 5.3. Best regards, Nobuhiro