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 Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 6C407CDB47E for ; Wed, 18 Oct 2023 12:13:59 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231610AbjJRMN6 (ORCPT ); Wed, 18 Oct 2023 08:13:58 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41586 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235105AbjJRMN4 (ORCPT ); Wed, 18 Oct 2023 08:13:56 -0400 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B1F10118 for ; Wed, 18 Oct 2023 05:13:54 -0700 (PDT) Received: by smtp.kernel.org (Postfix) with ESMTPSA id E7127C433C7; Wed, 18 Oct 2023 12:13:53 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1697631234; bh=9kgiB69q1oSigTcfJagfre6fl61MxiaXRrSluE83B8w=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=NAsS93gogehTCaSCV9273Zay7esIppToOsR0pXtmmx+r1h2dIQxTPAQvdVXvZHxDy a0k9bkHbbbT96LMcquv2NuRf7W2mL2vjUIEDm98CCYDtOfYrHib+/UIVRC1yFeIlSS c53CfLkNlOpfumQAZrrB7vhvZ8W3Lh50zrNzt2/QhMIhFG8ZDpMX3H5qrQnn+mn+WO eTAFG7eyUb10Kyw9doHxCHQOyWI5//4FLM7G/c8nYjJWipeR/1l5JPccNyEEk0Mifz miv6jzY/eb8qJU+ep72PP8+za+EKZbyx+oHbcIl9UxE2uNOMC2I1vpTummQMdpZeEw JwV89pfLfGpyA== Date: Wed, 18 Oct 2023 14:13:50 +0200 From: Frederic Weisbecker To: Tejun Heo Cc: Lai Jiangshan , LKML , "Paul E . McKenney" Subject: Re: [PATCH] workqueue: Provide one lock class key per work_on_cpu() callsite Message-ID: References: <20230924150702.9588-1-frederic@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Le Tue, Oct 17, 2023 at 11:53:12PM -1000, Tejun Heo a écrit : > On Sun, Sep 24, 2023 at 05:07:02PM +0200, Frederic Weisbecker wrote: > > All callers of work_on_cpu() share the same lock class key for all the > > functions queued. As a result the workqueue related locking scenario for > > a function A may be spuriously accounted as an inversion against the > > locking scenario of function B such as in the following model: > > > > long A(void *arg) > > { > > mutex_lock(&mutex); > > mutex_unlock(&mutex); > > } > > > > long B(void *arg) > > { > > } > > > > void launchA(void) > > { > > work_on_cpu(0, A, NULL); > > } > > > > void launchB(void) > > { > > mutex_lock(&mutex); > > work_on_cpu(1, B, NULL); > > mutex_unlock(&mutex); > > } > > > > launchA and launchB running concurrently have no chance to deadlock. > > However the above can be reported by lockdep as a possible locking > > inversion because the works containing A() and B() are treated as > > belonging to the same locking class. > > Sorry about the delay. I missed this one. Applied to wq/for-6.7. No problem, thanks a lot! > > Thanks. > > -- > tejun