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=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,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 1D297C3F68F for ; Tue, 17 Dec 2019 07:50:09 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id DBDAA206D3 for ; Tue, 17 Dec 2019 07:50:08 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1576569009; bh=SyMa3sn/LvWHfEJGzJYsrqVgJR2b7ftExMP8XxbUE7A=; h=Date:From:To:Cc:Subject:References:In-Reply-To:List-ID:From; b=lLRJM0rhFzNjX90Mq+8yXMYlKpkHtJFA7JVjFuAgFF/TUnfVVPssIAI26ynURCs7u QJpLXX/yXHVeg0GV2zMg1yZTwCDwSJ9y7CtOM5H50cC3IWuW//6t54Hn7QuywNpg3A C7mBcwlSmDRcl5K6AHEY/0lQYIw2i9kBjOmWvvO8= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726559AbfLQHuI (ORCPT ); Tue, 17 Dec 2019 02:50:08 -0500 Received: from mail.kernel.org ([198.145.29.99]:49960 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725730AbfLQHuH (ORCPT ); Tue, 17 Dec 2019 02:50:07 -0500 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 9F0A1206D3; Tue, 17 Dec 2019 07:50:06 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1576569007; bh=SyMa3sn/LvWHfEJGzJYsrqVgJR2b7ftExMP8XxbUE7A=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=I8a5kFfTPFVzBvdNTCB83JBxTel8eMTiNGI9s/ScDNcWfz4jaBiOrfeHkzuiu3EYh D30p7LBHRLknWpV4kJiBG2An9fHtGBbOqsq3dhx9ZanSx4YssDe/3KZNeUT0hSIQ1z IBZztOh/9YN5Nk2qWzqVAgS+VOnUnnb9/jfpvtM4= Date: Tue, 17 Dec 2019 08:50:05 +0100 From: Greg Kroah-Hartman To: Nobuhiro Iwamatsu 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() Message-ID: <20191217075005.GB2474507@kroah.com> References: <20191216174747.111154704@linuxfoundation.org> <20191216174802.938835002@linuxfoundation.org> <20191217043810.xamko46u2g4sdkwp@toshiba.co.jp> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20191217043810.xamko46u2g4sdkwp@toshiba.co.jp> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Dec 17, 2019 at 01:38:10PM +0900, Nobuhiro Iwamatsu wrote: > 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. Thank you for this, now queued up everywhere. greg k-h