Received: by 2002:a05:6359:c8b:b0:c7:702f:21d4 with SMTP id go11csp3465291rwb; Mon, 19 Sep 2022 23:12:12 -0700 (PDT) X-Google-Smtp-Source: AMsMyM6gYLGvpAzJ95g2a5akB8q4lZn72IP/FFq8O0jZ7qaGXiH96WXT+R8/0lIUSPy/1YvaoLN0 X-Received: by 2002:a17:90b:3752:b0:200:b29b:f592 with SMTP id ne18-20020a17090b375200b00200b29bf592mr2139075pjb.81.1663654332477; Mon, 19 Sep 2022 23:12:12 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1663654332; cv=none; d=google.com; s=arc-20160816; b=dFJQOOxGu0yYbg5hzTlAe4T63XFVxgw3yDLBujvew+PSmmAAxMkB4d/xVIeiJ795Jx pBGkf5XiZ4vicYBLCLxSdOurnzRVa3gvB3NxWD7u/i/YMxC6/ixxv4Br8o/CqqUprbRK KIX2wDzEOp1Sahh9wovYJ9g7mid/ppjivkvPFUd8XhF2XMCvUoEdI5t0lxcaECDN2Sej 1EqeGoksmcpJyALHFwcn1WiPas5fYOdw8m3tDfUZwfBgON5WOA1dXjGDlH9OOeCYHEza pzAHAZAD38gV3eAHgCVuPyDiA7PZlHv4kO2gY9m+1YYlo+0hUHFP8sZGZbDtgXhAc1UE OlJA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date; bh=MpHuiPQoowoGVjMX1aIJZghBoxgznZXXBusLKTQdTXg=; b=zTiXirOLYAyYOSajwbryAEnvdyTOw9xK379NwXRWNP/s5pjIcr/QmuUTVIH0ewAAnp XXepqTmhneB4Jdc1Xs1i4n+Fp8OB8H5MJwi9EYNqAKul2F/XAsf4Rb2DoLQrgFjFOR9l 99N1bbbzT8hxtFZegaLUKY2oCwyD6HiW1UA402rTvotZhEOKbuAeX/dHXFRog7pFmrnM OMCVB5UfXHrBPky2v7F2gsCzBbARc5m2KO699ZMGOqhPlrmxl8EZ5AfvGTe/Ny3RYcIk txZ8LFzoeYgVw9tKS7gagefOidv8P4c+qApQyhLJCAmOV38DP6ZBucBXve2di8I1JP8C SmIw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-crypto-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-crypto-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 u8-20020a17090a2b8800b001fb3c38290dsi12501000pjd.177.2022.09.19.23.11.51; Mon, 19 Sep 2022 23:12:12 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-crypto-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-crypto-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-crypto-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230347AbiITGCv (ORCPT + 99 others); Tue, 20 Sep 2022 02:02:51 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33152 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230320AbiITGCt (ORCPT ); Tue, 20 Sep 2022 02:02:49 -0400 X-Greylist: delayed 443 seconds by postgrey-1.37 at lindbergh.monkeyblade.net; Mon, 19 Sep 2022 23:02:44 PDT Received: from a.mx.secunet.com (a.mx.secunet.com [62.96.220.36]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6DA175C9CF; Mon, 19 Sep 2022 23:02:44 -0700 (PDT) Received: from localhost (localhost [127.0.0.1]) by a.mx.secunet.com (Postfix) with ESMTP id E4C2D205E3; Tue, 20 Sep 2022 07:54:44 +0200 (CEST) X-Virus-Scanned: by secunet Received: from a.mx.secunet.com ([127.0.0.1]) by localhost (a.mx.secunet.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id swpeMJd9catj; Tue, 20 Sep 2022 07:54:44 +0200 (CEST) Received: from mailout2.secunet.com (mailout2.secunet.com [62.96.220.49]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by a.mx.secunet.com (Postfix) with ESMTPS id 6396520561; Tue, 20 Sep 2022 07:54:44 +0200 (CEST) Received: from cas-essen-01.secunet.de (unknown [10.53.40.201]) by mailout2.secunet.com (Postfix) with ESMTP id 52A6C80004A; Tue, 20 Sep 2022 07:54:44 +0200 (CEST) Received: from mbx-essen-01.secunet.de (10.53.40.197) by cas-essen-01.secunet.de (10.53.40.201) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.31; Tue, 20 Sep 2022 07:54:44 +0200 Received: from gauss2.secunet.de (10.182.7.193) by mbx-essen-01.secunet.de (10.53.40.197) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.31; Tue, 20 Sep 2022 07:54:43 +0200 Received: by gauss2.secunet.de (Postfix, from userid 1000) id 75FF531829FB; Tue, 20 Sep 2022 07:54:43 +0200 (CEST) Date: Tue, 20 Sep 2022 07:54:43 +0200 From: Steffen Klassert To: Daniel Jordan CC: , , , , Subject: Re: [PATCH] padata: fix lockdep warning in padata serialization Message-ID: <20220920055443.GI2950045@gauss3.secunet.de> References: <20220919151248.smfo7nq6yoqzy2vo@oracle.com> <20220920003908.391835-1-eadavis@sina.com> <20220920014711.bvreurf4ex44w6oj@oracle.com> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Disposition: inline In-Reply-To: <20220920014711.bvreurf4ex44w6oj@oracle.com> X-ClientProxiedBy: cas-essen-01.secunet.de (10.53.40.201) To mbx-essen-01.secunet.de (10.53.40.197) X-EXCLAIMER-MD-CONFIG: 2c86f778-e09b-4440-8b15-867914633a10 X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,SPF_HELO_NONE, SPF_PASS 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-crypto@vger.kernel.org On Mon, Sep 19, 2022 at 09:47:11PM -0400, Daniel Jordan wrote: > On Tue, Sep 20, 2022 at 08:39:08AM +0800, eadavis@sina.com wrote: > > From: Edward Adam Davis > > > > On Mon, 19 Sep 2022 11:12:48 -0400, Daniel Jordan wrote: > > > Hi Edward, > > > > > > On Mon, Sep 19, 2022 at 09:05:55AM +0800, eadavis@sina.com wrote: > > > > From: Edward Adam Davis > > > > > > > > Parallelized object serialization uses spin_unlock for unlocking a spin lock > > > > that was previously locked with spin_lock. > > > > > > There's nothing unusual about that, though? > > > > > > > This caused the following lockdep warning about an inconsistent lock > > > > state: > > > > > > > > inconsistent {HARDIRQ-ON-W} -> {IN-HARDIRQ-W} usage. > > > > > > Neither HARDIRQ-ON-W nor IN-HARDIRQ-W appear in the syzbot report, did > > > you mean SOFTIRQ-ON-W and IN-SOFTIRQ-W? > > Yes, I want say: inconsistent {SOFTIRQ-ON-W} -> {IN-SOFTIRQ-W} usage. > > > > > > > We must use spin_lock_irqsave, because it is possible to trigger tipc > > > > from an irq handler. > > > > > > A softirq handler, not a hardirq handler. I'd suggest using > > > spin_lock_bh() instead of _irqsave in your patch. > > I think _irqsave better than _bh, it can save the irq context, but _bh not, > > and in tipc call trace contain SOFTIRQ-ON-W and IN-SOFTIRQ-W. > > _irqsave saving the context is about handling nested hardirq disables. > It's not needed here since we don't need to care about disabling > hardirq. > > _bh is for disabling softirq, a different context from hardirq. We want > _bh here since the deadlock happens when a CPU takes the lock in both > task and softirq context. padata uses _bh lock variants because it can > be called in softirq context but not hardirq. Let's be consistent and > do it in this case too. padata_do_serial is called with BHs off, so using spin_lock_bh should not fix anything here. I guess the problem is that we call padata_find_next after we enabled the BHs in padata_reorder.