Received: by 2002:a05:7412:da14:b0:e2:908c:2ebd with SMTP id fe20csp1508395rdb; Sun, 8 Oct 2023 10:56:29 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFXNLmesvoSE9+m83LHgFYuLtLEZD3/yMGTJakJDwWd5mMJGDhSnmqCNUi4d6tLnrFiduEc X-Received: by 2002:a05:6a00:849:b0:68e:2c2a:5172 with SMTP id q9-20020a056a00084900b0068e2c2a5172mr15570635pfk.6.1696787789558; Sun, 08 Oct 2023 10:56:29 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1696787789; cv=none; d=google.com; s=arc-20160816; b=il406+Oovdorj2tNi+LyjsPK5ycGFgitQL8JbgDRivaBcGCS8iAQIDv7FXPD86mCfB 2vsABYAVUte5dMO65rYyK2JI41gd/GHk3wqDHveR2romqBA3RoDQXrYaKFCPEip46Ysm 36OPV7OmfChyEQOAgK9uodnXrpIRZ5emAWRvyQ+gUpNhMyQeKne6ASYUOJRxfVrOcsTZ R8q81hqLdgxhSn0STlJxJKfFbnSIZjNJH2eyhUf2mj1TfWVBP1Q7ZLAx+fKCxJWhctLN r3CGeYr+4/ibGW8L5zTHYHIHIr+73F8Mlou1r8LtcpjkoW6AeinipnJ4EHXftAjEfM28 epDA== 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:dkim-signature; bh=AZ3V3/WIgMOXNTQMLjEbSnI+9wH67IrtaCQKwXc776o=; fh=UxYT6fiqSk4PXmG0P/nb6uE/FZFvSnBoMJ9isBu9ggs=; b=i1GeqdZC3cMavpAWUsJnidgFd/UJU4ofvxwK0eSFQkMZ0ZcoUsYFFpos3MamObxzAn mFUrYYdONGZid6WOCdJ+up8xdyLiZLykeM6awCQLA3GECYMf0rivFMkKEG28QudeYak2 2tu3pU0V/0UZ4pzMe4n6vSYTPRcKuKVjyezmgg4tRkbOaDz0t1rxbmX5vaPqxpnRi5Cs MvTn0trFBRwvqn4UOgGQQ3iLfGfHT+6aRbpoV2fGcBNO8Rzda0A8RuWwD7eYL0V0uRtC daZpxYUajkEk0FTt6pqShLhFOdaGjyWpiQLC6sgk9zEQgUZHDUjIwJMpknvdoU+iZLqy bLig== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b="Yx/Sivyp"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:3 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 lipwig.vger.email (lipwig.vger.email. [2620:137:e000::3:3]) by mx.google.com with ESMTPS id k4-20020a056a00168400b00690fc88e4acsi6208860pfc.228.2023.10.08.10.56.29 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 08 Oct 2023 10:56:29 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:3 as permitted sender) client-ip=2620:137:e000::3:3; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b="Yx/Sivyp"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:3 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 lipwig.vger.email (Postfix) with ESMTP id 270BC8063004; Sun, 8 Oct 2023 10:56:27 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at lipwig.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1344391AbjJHR4O (ORCPT + 99 others); Sun, 8 Oct 2023 13:56:14 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55568 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231167AbjJHR4N (ORCPT ); Sun, 8 Oct 2023 13:56:13 -0400 Received: from mail-pf1-x429.google.com (mail-pf1-x429.google.com [IPv6:2607:f8b0:4864:20::429]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id AFB2BA3; Sun, 8 Oct 2023 10:56:11 -0700 (PDT) Received: by mail-pf1-x429.google.com with SMTP id d2e1a72fcca58-690b7cb71aeso2787463b3a.0; Sun, 08 Oct 2023 10:56:11 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1696787771; x=1697392571; darn=vger.kernel.org; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc:subject:date:message-id:reply-to; bh=AZ3V3/WIgMOXNTQMLjEbSnI+9wH67IrtaCQKwXc776o=; b=Yx/SivypN+SmQ0hLXY2r5oqQxRBE3L2sJ9GgDNvbq/rSiF5pmyp4Ah+JugsCqvza+f WfqTa+KX4+Q5dtNE6TfStwxT2v7IcjeXIAled3hwIwDwxLwtU6z86KPsrbAkOgDkfXpd rTi8Gd8W9tjGCO8vl0eheCylKYoI5nZCLXyPhRti58I/JDOVzJMDnrONFtzof5ZlEIqq OBPHy1Hr2fUMhZf/HWekuNK3tg7HvblBCbPHF8zmtM89eRiWDnq853X9k7cY+/6LRWgj Id0VAjdOSgcSzlAYybHfA4X0OhzsQqUT+57FOBFlIdNhQ8ylp24WsCxcBonuvLNLora3 efGw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1696787771; x=1697392571; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=AZ3V3/WIgMOXNTQMLjEbSnI+9wH67IrtaCQKwXc776o=; b=BF9FFmFzGorN8ZkhpJVi3DEyp1Dmy5pXwJATACYr49LgLvwgLp6uEzdfh44JsDJAuJ s0aNGC5BJ0R/cCXUgwZzNzw2EXDBKo4jAHq6Fe1+s8hhsH3W7CeajDDDEtDZzI5wMbnM cqED0zC4uXVYucFEYgjwTtgf9PvCQWW3X48qraNDCrj4+FfTPNA5FRPRPHUXsPjd9lno 67NYD8e67KcZ5C/uUIT5+VoxvOr2tj/AYU1T/yWQPQfWKDc5+EEIjwdENRf/ifRiAIGu AuFI2/mpYT53nR3hQJ+oVViFRziCZ6afyuju8wZZCNlO6yOQSSUc9oVQhQhLi3UaZ1Sy NQ9w== X-Gm-Message-State: AOJu0Yx5uVgAsVFIUxhwezZh3l2aRTP/BPCf0edxSzc7SNole4sWpIxK ixDqlmfJhwm5BMscmkjYc/Y= X-Received: by 2002:a05:6a00:1d85:b0:68e:2c2a:aa1d with SMTP id z5-20020a056a001d8500b0068e2c2aaa1dmr11798246pfw.11.1696787771033; Sun, 08 Oct 2023 10:56:11 -0700 (PDT) Received: from localhost ([2601:647:5b81:12a0:a3e9:5a65:be6:12db]) by smtp.gmail.com with ESMTPSA id k22-20020aa78216000000b0069337938be8sm4785516pfi.110.2023.10.08.10.56.10 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 08 Oct 2023 10:56:10 -0700 (PDT) Date: Sun, 8 Oct 2023 10:56:09 -0700 From: Cong Wang To: Chengfeng Ye Cc: Jakub Kicinski , jhs@mojatatu.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: References: <20230926182625.72475-1-dg573847474@gmail.com> <20231004170120.1c80b3b4@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Spam-Status: No, score=3.0 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,RCVD_IN_SBL_CSS, SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lipwig.vger.email 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 (lipwig.vger.email [0.0.0.0]); Sun, 08 Oct 2023 10:56:27 -0700 (PDT) X-Spam-Level: ** On Thu, Oct 05, 2023 at 05:01:07PM +0800, Chengfeng Ye wrote: > 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. Doesn't __dev_queue_xmit() itself disable BH with rcu_read_lock_bh()?? Thanks.