Received: by 2002:a05:7412:518d:b0:e2:908c:2ebd with SMTP id fn13csp424942rdb; Thu, 5 Oct 2023 09:42:42 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFAZqEjr8I/b05cxvbBoZ4iSvjpCpR933ckVv+DbTmfv4xBvIpqARh3qOhBLt8fiDImwcjM X-Received: by 2002:a9d:6194:0:b0:6b5:ee8f:73af with SMTP id g20-20020a9d6194000000b006b5ee8f73afmr6164484otk.5.1696524162631; Thu, 05 Oct 2023 09:42:42 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1696524162; cv=none; d=google.com; s=arc-20160816; b=wP8vpVwwSheRJ/mS6wkidSAtFgLSTLfBrvMeaWc9XK4menI4nswRPmg30WltNJWP+/ mn2jCXZCPsbXxvum01ihK2xqMhQPlEagcFqP51sKPAqHscNRkvopEpzsB1UwBOwJGjOh S3J9U9xiBPboGLI0zQpYhEEK73huPS2xbdQNSNmr15xQpGagMQss9jPBUHIDRKLSafNX miTXRp7ARs37JjrFg/XTLFaR8tIwFeXMJBeL3xej3Cac4dMpNwqEWMV8HEa7FhqX/e5+ DBBA/jO9HMigAD04mnns0DTWLMDrPvLmwFFzbIa/40cs551Tx2fI9XbgG6H0Zhd418R7 sq9Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=nyCjyMRZJPpmlXHrivKxtsx8HD0NSj+fcEZELdzdDEQ=; fh=QGzojiktd4exZYQFoKQbJ0bGUj+v3TwxZKrXlzIKjGs=; b=eYSkHVeUq1zL2C9DQSYXCtyE1dxqdBrphNXWSYBJydAQTv6lfuF5yTn/Q/vUq5XxBZ 7gg8AvqNEisNdpiB7PIWGwmF8JxSjDcZWuNJVYhdbLrrn2vdZvTqaFpMACSA5aGANyrV szyuLrC4XHRTwI/2s/A38Fb8YqqExlmv1EzdVSABlN3BYqbEOQW6fcmOQ53Y5zk8swcp XJmBrxUvfojfaBO6Qzp5j5N3m5LdLnz1S56fcZ13Dxl8KqeCR4CFlZgRffg/12b+sTp4 AfJCjcrBX0cCznHHnhAFbUWZ/i/e6u4soH3gUX/6GiRYlwQEezKxATBnbrkEkBXVtv39 s7xQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=Rl9qiaC6; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from snail.vger.email (snail.vger.email. [23.128.96.37]) by mx.google.com with ESMTPS id q4-20020a63d604000000b00563f627f2easi1763501pgg.122.2023.10.05.09.42.41 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 05 Oct 2023 09:42:42 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 as permitted sender) client-ip=23.128.96.37; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=Rl9qiaC6; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by snail.vger.email (Postfix) with ESMTP id 92C0A80C244F; Thu, 5 Oct 2023 09:41:50 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at snail.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234440AbjJEQla (ORCPT + 99 others); Thu, 5 Oct 2023 12:41:30 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33344 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232279AbjJEQj4 (ORCPT ); Thu, 5 Oct 2023 12:39:56 -0400 Received: from mail-wr1-x42f.google.com (mail-wr1-x42f.google.com [IPv6:2a00:1450:4864:20::42f]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4FDBE9EC3; Thu, 5 Oct 2023 02:01:21 -0700 (PDT) Received: by mail-wr1-x42f.google.com with SMTP id ffacd0b85a97d-325e9cd483eso731265f8f.2; Thu, 05 Oct 2023 02:01:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1696496480; x=1697101280; darn=vger.kernel.org; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=nyCjyMRZJPpmlXHrivKxtsx8HD0NSj+fcEZELdzdDEQ=; b=Rl9qiaC6E4CPjVzA2ffAgqUOlM7epwfWWskPrOAtio1Bgz9Ivh+hpIMkTOaqW6MG6g tC5BvfdSlJq8My5xgrklxIGUASaG2C4EkkuggdwPPQhDl9jz8VGKJcljBEQQRaBBHcXs HKkXgphDYCLa02Z+WBGEL2hYgO/Un1JLQYPc3/xsdscqmnUVkzM2N9e/4k7jpbZOr1+9 h7tDTg+kiuJDlxWFzWWzEYhJIP4ZLA8X9A77RmuJGfkK+yMp19dy2v24ouIOdklavYvS AAp3SIlX3UaPILsFzXd5PBZghRktUSpeHUNDuNbHIDB5rYSbrjqVycQ8ASPRQbSIHNac AGSQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1696496480; x=1697101280; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=nyCjyMRZJPpmlXHrivKxtsx8HD0NSj+fcEZELdzdDEQ=; b=r0aHURFeQ4YALc5AJ1LKezB3Nlhoc3oW6Sq2PUVm87wDfKB9kE8dnGwbf8Y4ADO19X Gkv3vxgpSMk8S4PnFurBgesMDKVEPYQ4YU2rL0EEyQd/iK3voJXnbOOeaR8WKvFo4fkV Ca2+mXeRK48pavz5tCLh7gCWqUCY6SbRjQsrW/r9zSZ/BYjcgBTZ2jbLIEyGn0ExjMR4 pXf/nbsLVGaadhktaRBr82r6YlPRi84G/2tGekyJ8XkA0cWjfbrMLObG11q0ze8O1RAr YyCj6burZHlHstjNS4szvJmWXVtvfJhppdYz+an+JPh0IBSuOjAP5j2jj9CFjJX7Y2fb v+EQ== X-Gm-Message-State: AOJu0YyU4BsKhS30/ewHEfAxeAILYS/1ugDyTSLKUhzP5mTSkQU7ngL1 ZraEM+10f7+XRNb7Y4C++S2yNkUhlhBIWjzs4Jw= X-Received: by 2002:adf:edc3:0:b0:321:56af:5ef9 with SMTP id v3-20020adfedc3000000b0032156af5ef9mr3840408wro.70.1696496479494; Thu, 05 Oct 2023 02:01:19 -0700 (PDT) MIME-Version: 1.0 References: <20230926182625.72475-1-dg573847474@gmail.com> <20231004170120.1c80b3b4@kernel.org> In-Reply-To: <20231004170120.1c80b3b4@kernel.org> From: Chengfeng Ye Date: Thu, 5 Oct 2023 17:01:07 +0800 Message-ID: Subject: Re: [PATCH] net/sched: use spin_lock_bh() on &gact->tcf_lock To: Jakub Kicinski 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 Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-1.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_ENVFROM_END_DIGIT, FREEMAIL_FROM,RCVD_IN_DNSWL_BLOCKED,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-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (snail.vger.email [0.0.0.0]); Thu, 05 Oct 2023 09:41:50 -0700 (PDT) Hi Jakub, Thanks for the reply, I inspected the code a bit more, it seems that the TC action is called from tcf_proto_ops.classify() callback, which is called from Qdisc_ops enqueue callback. Then Qdisc enqueue callback is from -> __dev_queue_xmit() -> __dev_xmit_skb() -> dev_qdisc_enqueue() inside the net core. It seems that this __dev_queue_xmit() callback is typically called from BH context (e.g., NET_TX_SOFTIRQ) with BH already disabled, but sometimes also can from a work queue under process context, one case is the br_mrp_test_work_expired() inside net/bridge/br_mrp.c. Does it indicate that this TC action could also be called with BH enable? I am not a developer so really not sure about it, as the networking code is a bit long and complicated. Thanks again, Chengfeng