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 5E361E936ED for ; Thu, 5 Oct 2023 00:01:28 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S244169AbjJEAB3 (ORCPT ); Wed, 4 Oct 2023 20:01:29 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44444 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S241171AbjJEABZ (ORCPT ); Wed, 4 Oct 2023 20:01:25 -0400 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 401839E for ; Wed, 4 Oct 2023 17:01:22 -0700 (PDT) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 69215C433C7; Thu, 5 Oct 2023 00:01:21 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1696464081; bh=pT9bmZ/bh9lBQv3geI9gE4cnZuBHmmOmTxUsClrb6Fc=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=JRd87dnOFadg5OvUjak2dHXVko0c6jmwa6+NDYsPZVf4pdl4xVij21I48MK4Ub96A ewuuo/fsKr+1izHtrClBss4FJM58CPItamH8YToY1tF3WhWDi9jg+XU2+fxn2UFzD7 Fa2TWVeDy0UmYIfUXwdA9Coltz8+jLxgb10U8yoJBdQJIojur7FLv2fRCqcsUiuXWw Axr3Udy/gPKlyvgXanCdlWnsc83jvhEqeKW1+rDdED1BuHAxrOEo1NW8IfQqt4zqSL tD22Ab1ciklntJQ+V5mi8MOy344z9iAXedkpgKRyUPQyrMqQWQpNs0ukT9k+wbtHVU G2g7K0ht1ILYA== Date: Wed, 4 Oct 2023 17:01:20 -0700 From: Jakub Kicinski To: Chengfeng Ye Cc: jhs@mojatatu.com, xiyou.wangcong@gmail.com, jiri@resnulli.us, davem@davemloft.net, edumazet@google.com, pabeni@redhat.com, netdev@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] net/sched: use spin_lock_bh() on &gact->tcf_lock Message-ID: <20231004170120.1c80b3b4@kernel.org> In-Reply-To: <20230926182625.72475-1-dg573847474@gmail.com> References: <20230926182625.72475-1-dg573847474@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, 26 Sep 2023 18:26:25 +0000 Chengfeng Ye wrote: > I find tcf_gate_act() acquires &gact->tcf_lock without disable > bh explicitly, as gact->tcf_lock is acquired inside timer under > softirq context, if tcf_gate_act() is not called with bh disable > by default or under softirq context(which I am not sure as I cannot > find corresponding documentation), then it could be the following > deadlocks. > > tcf_gate_act() > --> spin_loc(&gact->tcf_lock) > > --> gate_timer_func() > --> spin_lock(&gact->tcf_lock) This is a TC action, I don't think it can run without BH being already disabled, can it? -- pw-bot: cr