Received: by 2002:a05:7412:518d:b0:e2:908c:2ebd with SMTP id fn13csp317405rdb; Thu, 5 Oct 2023 06:59:34 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGFUdZOBaylte84FTJ1UwNKZoRE7FqR/ZG69sQN98VjgHDSQlauEXO3fWtXL117QcDS5l3v X-Received: by 2002:a05:6a00:1a92:b0:693:394f:5d99 with SMTP id e18-20020a056a001a9200b00693394f5d99mr6090199pfv.8.1696514374260; Thu, 05 Oct 2023 06:59:34 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1696514374; cv=none; d=google.com; s=arc-20160816; b=cjdW12IZc5xgE2QJsTNvEaGYlAOTbLOUeOyBda7kb8aZ9gBaTCLz9UhnPs4G1sitHl 50P5vdgcOV/O2luwvwY6+GaxCN9rDKOiqSELlLLRm948RNpLkFByNtAc/iLBxcUQCp63 4OwIlnLzA8q5D5csJxCp1FGGBh+INoGKG9pd0PkL4tJzun2LZxhFMxxk9BXMUlsLTksq hN5ThF0LYr5zcZQf416IJyVSZRN/c8q30kYNuqwRvGi9YQzjYdqu3EWpb3mIUfX3Z3jo PqRRKgN7kuhpaWbwJfxQEfUf4JjTjruI8s6T/8wAYgIYK2JDcujKxrzF2tNfzQfPVw0M RS1A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:cc:to:subject :message-id:date:from:in-reply-to:references:mime-version :dkim-signature; bh=QMR2iarH1SHp4FutOR7HUhuuQeLUkDys2IX/rbsWADw=; fh=wGFMBypV+DzaAGN6H4GBn62O34MvPGnnOtkvmxpbTF0=; b=0C2Qp2TH56zsuP+AnjtbJaDjE7zIFrZBy7IF8gdfBLbaCG3e8M3/wldDedRexLjDXO zdjmsDMcaOeBy+OoYsuCYQAHSxMz67Um/j40GEV8mctZQ1GxCPYOSaXbaqPbmJB9e2YG 4woLQ7iOMtq7e4llx62qMle1EXCEgjrhANHHK8MP8oaD4W62gcCVrF1p9LS3RpPQfU9q ci+Q9sajUU9hVw8FYADnqjx8OKpsbxRVWmin3O5PKwUX75sjRt9blDef62e07qIbamXX SLAFiyM8/NeTF3i5qnnqCTmJRg/0AOXEWfoEQqr9liLlZfalLRF2zdHcmWU63nha6fz6 WmWA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@mojatatu-com.20230601.gappssmtp.com header.s=20230601 header.b=v7b6tw5o; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.34 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from howler.vger.email (howler.vger.email. [23.128.96.34]) by mx.google.com with ESMTPS id 139-20020a630091000000b0056ae6bfe161si1501661pga.142.2023.10.05.06.59.33 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 05 Oct 2023 06:59:34 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.34 as permitted sender) client-ip=23.128.96.34; Authentication-Results: mx.google.com; dkim=pass header.i=@mojatatu-com.20230601.gappssmtp.com header.s=20230601 header.b=v7b6tw5o; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.34 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by howler.vger.email (Postfix) with ESMTP id 368C580E0B59; Thu, 5 Oct 2023 06:59:33 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at howler.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232734AbjJEN7R (ORCPT + 99 others); Thu, 5 Oct 2023 09:59:17 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54762 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232011AbjJEN5K (ORCPT ); Thu, 5 Oct 2023 09:57:10 -0400 Received: from mail-yb1-xb30.google.com (mail-yb1-xb30.google.com [IPv6:2607:f8b0:4864:20::b30]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2C8A02570E for ; Thu, 5 Oct 2023 04:47:07 -0700 (PDT) Received: by mail-yb1-xb30.google.com with SMTP id 3f1490d57ef6-d865c441a54so937301276.1 for ; Thu, 05 Oct 2023 04:47:07 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=mojatatu-com.20230601.gappssmtp.com; s=20230601; t=1696506426; x=1697111226; darn=vger.kernel.org; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=QMR2iarH1SHp4FutOR7HUhuuQeLUkDys2IX/rbsWADw=; b=v7b6tw5o/OBbyFdhVYARKjxRW6pNB0ZfOztxOOJCGnF18e7wtvffHOlHj7HchJelX4 UucMq2O55lzbpvmRL/X5Yk2WRyu20zhUv2MdqGxOrBZ/JduthWIRXeBxsDLxCHOebt6W g6si/Yy0tMJLPhOD0PkVF2kKzqTAP8U9AJGsXzJpVleStUPput4FmO9qMNjItwt2nV8F IP53vNQEUoTeUXbh8ZXNtgtoOWv8U6Fth+4IjkkGkwHVqdgQX5xh0/VkXd+ssU103qfV ysJIp5VI+ZLA7jkOmpfVInFmRpTlHpM4AC7uwkhkLwQvAtuLUFe3X9hRQjmCl8d0eebj RtlQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1696506426; x=1697111226; h=content-transfer-encoding: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=QMR2iarH1SHp4FutOR7HUhuuQeLUkDys2IX/rbsWADw=; b=YjLxjAFFWCUXhcjn5oZJBbIpi/0jnNemvKCEMyYZNkjNH+ce0FH6qcKoi1bDn7ODt+ v5hU+h1jMo1KkSwjGyXCCFVd6mKJKbnwIJfZshhSaSiJw58jCu/mO9jfzM3ojuAQuXfw j+DZ4uJWTv3RIsRKSsPGj5a5UDumD5JJjddRXNpmREp7fil9lTjvTLup/9iNoPbAo9iW fXQuZ05QziBEMHwDn21+MvyWiAdvMQYcxErBp6SY1CV1ZqTVofHVe3JcnH14D7xxiPBx Or9JM9WpP/AYApbKpxJkIAOffZAeiNbPjdaPY7pqBFDvaP0cfVesK2GJ1q85qljJErwS us/g== X-Gm-Message-State: AOJu0Yx+BhTvK2fKa3gOANcRmz7gdBttw5ySr7J4VMapJlGpcYw++opD yCmnXsbxeWqvmczdL4cQwofhrA6BXTQxD/rNMw/Olg== X-Received: by 2002:a25:7412:0:b0:d80:1011:d2b with SMTP id p18-20020a257412000000b00d8010110d2bmr4836599ybc.2.1696506426231; Thu, 05 Oct 2023 04:47:06 -0700 (PDT) MIME-Version: 1.0 References: <20230926182625.72475-1-dg573847474@gmail.com> <20231004170120.1c80b3b4@kernel.org> In-Reply-To: From: Jamal Hadi Salim Date: Thu, 5 Oct 2023 07:46:55 -0400 Message-ID: Subject: Re: [PATCH] net/sched: use spin_lock_bh() on &gact->tcf_lock To: Chengfeng Ye Cc: Jakub Kicinski , 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, Horatiu Vultur Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,RCVD_IN_DNSWL_NONE,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 X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (howler.vger.email [0.0.0.0]); Thu, 05 Oct 2023 06:59:33 -0700 (PDT) On Thu, Oct 5, 2023 at 5:01=E2=80=AFAM Chengfeng Ye = wrote: > > Hi Jakub, > > Thanks for the reply, > > I inspected the code a bit more, it seems that the TC action is called fr= om > 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. net/bridge/br_mrp.c seems to need some love +Cc Horatiu Vultur Maybe that code needs to run in a tasklet? In any case your patch is incorrect. cheers, jamal