Received: by 2002:ac0:b7d5:0:0:0:0:0 with SMTP id v21csp48262ime; Thu, 28 Jul 2022 16:34:43 -0700 (PDT) X-Google-Smtp-Source: AGRyM1vYUD/431n8GEIXreVvQ5K0vBKPKaA7yLj745KgHbtOpHDDnIBvWsjbvmqARiL9PaatL5R7 X-Received: by 2002:a17:907:7f05:b0:72f:550c:69f3 with SMTP id qf5-20020a1709077f0500b0072f550c69f3mr862605ejc.744.1659051282930; Thu, 28 Jul 2022 16:34:42 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1659051282; cv=none; d=google.com; s=arc-20160816; b=ldtfX+bFbRBoBqfwT9SF0F4+kvJYLow7DXywJ5BR/WOy5M2h6gCx0kD7CajwRCy36W ckdURl0PZwZwjDsPcQCJjTRW44Itwo9gfL/o3tsgwA/dLcHcOsdmn5AA5/PFUNnVhLF/ svILDWGmen3Rrsaw1gHGl7a3Z8pV7UleItIQqZJZba+3dCnuLcgyJncIu8w9k65Pjpd1 VOc6tNpRGbimg6h3T+624mNVkAFf6VtNKd8pO2HYlQpxw8duhycJ2HnOYOrkBWMr/+7t l1PZJ0A3EHxMg6JaSoLtgGx6GWPvxCUQnqfZZLb5xExH6R3pGm/n8GL3bK/trlk+76CG p4Ig== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:cc:to:content-language:subject:user-agent:mime-version :date:message-id; bh=MYR3x7PFcwqx7MsEvD/Tu/3fIY3RcdvJfTLJJ+WYBXM=; b=dXuHtU90DCmIfAITnzWu6Jm6aKQDX6Z0y9b/B8YK1YeMwKK6BqAXLRfMZ5KnLKJNeU yfvyWgr0Tj9pVSGhHPhxIeg/aYc5iETMOB+lEwmPVXK9eNY1eb8FOCLgz0ddIIKzO9IE PY2EHXPviwl1H59PNs4gVThkt3xwUIau63DhSJlQMndPKlrHMDAefJoVPDHTBNLYMUvV Gel78m0LGadogGzuAksH/zR3Z1cK54yLtYKXBPuCbKw7qRuTrsBLiQ/z+sX4TJgFvcPd i1rlFiGFAgGubaSBNuaSdUGHWYCHzqPzfknZzA09FVYTC1+G1K1Y1vp6VSnF4wSxrExB +L0w== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id hp31-20020a1709073e1f00b0072f09e7093fsi1919010ejc.141.2022.07.28.16.34.16; Thu, 28 Jul 2022 16:34:42 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233516AbiG1XSs (ORCPT + 99 others); Thu, 28 Jul 2022 19:18:48 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43850 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229940AbiG1XSr (ORCPT ); Thu, 28 Jul 2022 19:18:47 -0400 Received: from www262.sakura.ne.jp (www262.sakura.ne.jp [202.181.97.72]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B81217393A for ; Thu, 28 Jul 2022 16:18:46 -0700 (PDT) Received: from fsav113.sakura.ne.jp (fsav113.sakura.ne.jp [27.133.134.240]) by www262.sakura.ne.jp (8.15.2/8.15.2) with ESMTP id 26SNIY6G031260; Fri, 29 Jul 2022 08:18:34 +0900 (JST) (envelope-from penguin-kernel@I-love.SAKURA.ne.jp) Received: from www262.sakura.ne.jp (202.181.97.72) by fsav113.sakura.ne.jp (F-Secure/fsigk_smtp/550/fsav113.sakura.ne.jp); Fri, 29 Jul 2022 08:18:34 +0900 (JST) X-Virus-Status: clean(F-Secure/fsigk_smtp/550/fsav113.sakura.ne.jp) Received: from [192.168.1.9] (M106072142033.v4.enabler.ne.jp [106.72.142.33]) (authenticated bits=0) by www262.sakura.ne.jp (8.15.2/8.15.2) with ESMTPSA id 26SNIY7Q031253 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=NO); Fri, 29 Jul 2022 08:18:34 +0900 (JST) (envelope-from penguin-kernel@I-love.SAKURA.ne.jp) Message-ID: <0ad532b2-df5f-331a-ae7f-21460fc62fe2@I-love.SAKURA.ne.jp> Date: Fri, 29 Jul 2022 08:18:32 +0900 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Windows NT 6.3; Win64; x64; rv:91.0) Gecko/20100101 Thunderbird/91.11.0 Subject: Re: [PATCH] workqueue: don't skip lockdep wq dependency in cancel_work_sync() Content-Language: en-US To: Tejun Heo Cc: Lai Jiangshan , Johannes Berg , Hillf Danton , LKML References: <21b9c1ac-64b7-7f4b-1e62-bf2f021fffcd@I-love.SAKURA.ne.jp> From: Tetsuo Handa In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,NICE_REPLY_A, SPF_HELO_NONE,SPF_NONE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 2022/07/29 1:40, Tejun Heo wrote: > Tetsuo, you gotta explain why this is okay w.r.t. the spurious warnings that > the above commit addressed. You can't just state that there are cases which > are missed and then revert it. There are four commits related to this change. commit 87915adc3f0acdf03c776df42e308e5a155c19af Author: Johannes Berg Date: Wed Aug 22 11:49:04 2018 +0200 workqueue: re-add lockdep dependencies for flushing commit d6e89786bed977f37f55ffca11e563f6d2b1e3b5 Author: Johannes Berg Date: Wed Aug 22 11:49:03 2018 +0200 workqueue: skip lockdep wq dependency in cancel_work_sync() commit fd1a5b04dfb899f84ddeb8acdaea6b98283df1e5 Author: Byungchul Park Date: Wed Oct 25 17:56:04 2017 +0900 workqueue: Remove now redundant lock acquisitions wrt. workqueue flushes commit 0976dfc1d0cd80a4e9dfaf87bd8744612bde475a Author: Stephen Boyd Date: Fri Apr 20 17:28:50 2012 -0700 workqueue: Catch more locking problems with flush_work() . Commit 87915adc3f0acdf0 ("workqueue: re-add lockdep dependencies for flushing") saying These were removed after cross-release partially caught these problems, but now cross-release was reverted anyway. IMHO the removal was erroneous anyway though, since lockdep should be able to catch potential problems, not just actual ones, and cross-release would only have caught the problem when actually invoking wait_for_completion(). is the answer, commit 0976dfc1d0cd80a4 ("workqueue: Catch more locking problems with flush_work()") saying Add a lockdep hint by acquiring and releasing the work item lockdep_map in flush_work() so that we always catch this potential deadlock scenario. is what this patch restores.