Received: by 2002:a05:7412:da14:b0:e2:908c:2ebd with SMTP id fe20csp578804rdb; Fri, 6 Oct 2023 11:54:51 -0700 (PDT) X-Google-Smtp-Source: AGHT+IF2Lvj4UHjSQNqkVlygm8Z0KJA22mOkESI4rKjQNVtXIaLvCSXQeOEOGmc3xEpBRC4AmwYM X-Received: by 2002:a17:902:c78a:b0:1c4:51f3:a184 with SMTP id w10-20020a170902c78a00b001c451f3a184mr7658478pla.10.1696618491179; Fri, 06 Oct 2023 11:54:51 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1696618491; cv=none; d=google.com; s=arc-20160816; b=0bIKnWpDYWoepN1Pxdt+jcqKdeg23Q/aWC2dOaD7/uZ/ir+jcqsY941dZgHuYYffUK sQXg8wVIeWl/boMQHl6b12kc1h6+RbZPH5AVd+KIHfjoDOR5qJRNGR7KhkKzz4BqwLqc eOAi+rHZDVDF3rigWCLxq+MHywEpxh4EU5KZtz7vIcxeRj+cQ9Fw3lNh3+E9w5sd62Ik bJqP6iWC31S4MAQRTPkrh0mJ85ZoK14YWgma/D3nazExPLFlTF7PPAJ7rdMpcrSSb91t tB88e7bsBbkqrp0/aU//41fXjFsyRfEM/gyX+ni091bYSPEl3sIlZApAPsbGHO0fso2S VHng== 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-transfer-encoding :content-disposition:mime-version:references:subject:cc:to:from:date :message-id:dkim-signature; bh=X70lVOFCcfRrz5BPTne6oD5pXVKA4lkjxXDB0TaolDY=; fh=Y6XoRG3fYlN4pRW+st+xCgr+xxIiTFUvXxh7hCgcFjk=; b=QMceXQJSft0U8Ixl/7Ckb6QH6IO/J0bvZgPgB1LD78DSo0BbwpnBjMyMhPtZ/kdRGP Lxopkf+TkmAL6T1I8bdRJnbtg61ED2ZsxWfLU6tJ4MkzCf6FYYBXdx8DQX4rl4zIFHgz UO8ZQqPZ8XHtwg+fwG0UerPBjthbCw37Wt/CJx9lY3bhfoefb8z21SQLcZ+fi6USxBv1 jvW8pmUpNkSgcNamsY2dg1CZlpD2ZMfEywRl8g+egO56L4N7OCK5XnfeSFZadzGxHT8U a54XHq6lOqW5mV23T+EofGRzyB9d7M36KzwiLyJ9+vJntxeqMM795ySJ6WGwAEwkUD6I ggjQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=EtTHJ7bh; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 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. [2620:137:e000::3:7]) by mx.google.com with ESMTPS id h13-20020a170902f2cd00b001b9ea0f0e8esi3880877plc.650.2023.10.06.11.54.50 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 06 Oct 2023 11:54:51 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 as permitted sender) client-ip=2620:137:e000::3:7; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=EtTHJ7bh; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 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 2DF418028846; Fri, 6 Oct 2023 11:54: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 S233167AbjJFSyn (ORCPT + 99 others); Fri, 6 Oct 2023 14:54:43 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43548 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233320AbjJFSyl (ORCPT ); Fri, 6 Oct 2023 14:54:41 -0400 Received: from mail-wr1-x42e.google.com (mail-wr1-x42e.google.com [IPv6:2a00:1450:4864:20::42e]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D0B83125; Fri, 6 Oct 2023 11:52:59 -0700 (PDT) Received: by mail-wr1-x42e.google.com with SMTP id ffacd0b85a97d-317c3ac7339so2172481f8f.0; Fri, 06 Oct 2023 11:52:59 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1696618378; x=1697223178; darn=vger.kernel.org; h=in-reply-to:content-transfer-encoding:content-disposition :mime-version:references:subject:cc:to:from:date:message-id:from:to :cc:subject:date:message-id:reply-to; bh=X70lVOFCcfRrz5BPTne6oD5pXVKA4lkjxXDB0TaolDY=; b=EtTHJ7bh7i2ZFGjdOIyW6uq1bhu+psU/u9RnXVZwwMHbTV7UZxGoYE8vnv2riL7bwc fuPuZq7pDtRvAPNWxCFN/s7S/FSz5JveMSRDhFrBi1eo68QWfxGuBR4wYWF5MsZ86mXG 1ZBFudI4YduVH7oqLrqh8sG/RwHZ0v5SHjtmSWutZRYDuL9TML4yqrs4UZubGv5JpiIg iHK2aQIPrCmyWnJXvpGDQ5tVCSP1LrKCpWD1+zWkbb+EVrbRUrHVZ+44Ant/76nupM+c cvlHDd4xhTueioZoCiPNNLpe7GK87rUfEZX2kJyDkSiF2nuhelG2aaPaYZxm8VuGfuqU M1Mw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1696618378; x=1697223178; h=in-reply-to:content-transfer-encoding:content-disposition :mime-version:references:subject:cc:to:from:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=X70lVOFCcfRrz5BPTne6oD5pXVKA4lkjxXDB0TaolDY=; b=RT7l6vK8xZbyEPMiGYQ4CCwU+1PLonOaL1JWKtXj67Hrkpqvwn5/s2ovq00r06NR+n vwDBb54kRX4D0KznWNhKjsTsyEycEQfm2b5RRsNJLICNpjsqHoswmV3bRujTqgAo7w8S arAhnp4+k7IXgkWbOakhgvIMDzK526lwvhoAoZlUxJ9BFs3igtwToeXUqpP/xq2kWjQv MP+8LUTBlAEU0xdLZbifdS8loORnL5NdmPclD5KJK5oxu5GnOJIt3hyMPXUd/VWiAB8U +zggeE7g4YDVuAWAP20TtWGUyPlmkmYtZsQvcqKJ0gvhLx/JgQt4Kk6BZZeUi0nrS2BG ZAyg== X-Gm-Message-State: AOJu0Yw/SGRJstUMfsVzPyOyM7wBmj7vdRs7MI44wkVxcF4FoVZTzEjM e1HvLAvZyyR0vpQHAZLCxKk= X-Received: by 2002:a5d:4d8e:0:b0:324:7bdd:678e with SMTP id b14-20020a5d4d8e000000b003247bdd678emr7728648wru.60.1696618377892; Fri, 06 Oct 2023 11:52:57 -0700 (PDT) Received: from Ansuel-xps. (93-34-89-13.ip49.fastwebnet.it. [93.34.89.13]) by smtp.gmail.com with ESMTPSA id h9-20020a5d5489000000b003179d5aee67sm2231805wrv.94.2023.10.06.11.52.54 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 06 Oct 2023 11:52:57 -0700 (PDT) Message-ID: <65205789.5d0a0220.7e49b.ccb0@mx.google.com> X-Google-Original-Message-ID: Date: Fri, 6 Oct 2023 20:52:57 +0200 From: Christian Marangi To: Eric Dumazet Cc: Jakub Kicinski , Jason Gunthorpe , Leon Romanovsky , Wolfgang Grandegger , Marc Kleine-Budde , "David S. Miller" , Paolo Abeni , Chris Snook , Raju Rangoju , Jeroen de Borst , Praveen Kaligineedi , Shailend Chand , Douglas Miller , Michael Ellerman , Nicholas Piggin , Christophe Leroy , Nick Child , Haren Myneni , Rick Lindsley , Dany Madden , Thomas Falcon , Tariq Toukan , Alexandre Torgue , Jose Abreu , Maxime Coquelin , Krzysztof Halasa , Kalle Valo , Jeff Johnson , Gregory Greenman , Chandrashekar Devegowda , Intel Corporation , Chiranjeevi Rapolu , Liu Haijun , M Chetan Kumar , Ricardo Martinez , Loic Poulain , Sergey Ryazanov , Johannes Berg , Yuanjun Gong , Simon Horman , Rob Herring , Ziwei Xiao , Rushil Gupta , Coco Li , Thomas Gleixner , Junfeng Guo , Uwe =?iso-8859-1?Q?Kleine-K=F6nig?= , Wei Fang , Krzysztof Kozlowski , Yuri Karpov , Zhengchao Shao , Andrew Lunn , Zheng Zengkai , Lee Jones , Maximilian Luz , "Rafael J. Wysocki" , Dawei Li , Anjaneyulu , Benjamin Berg , linux-rdma@vger.kernel.org, linux-kernel@vger.kernel.org, linux-can@vger.kernel.org, netdev@vger.kernel.org, linuxppc-dev@lists.ozlabs.org, linux-stm32@st-md-mailman.stormreply.com, linux-arm-kernel@lists.infradead.org, ath10k@lists.infradead.org, linux-wireless@vger.kernel.org Subject: Re: [net-next PATCH v2 3/4] netdev: replace napi_reschedule with napi_schedule References: <20231003145150.2498-1-ansuelsmth@gmail.com> <20231003145150.2498-3-ansuelsmth@gmail.com> <20231005093253.2e25533a@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM, RCVD_IN_DNSWL_BLOCKED,SPF_HELO_NONE,SPF_PASS,WEIRD_QUOTING 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]); Fri, 06 Oct 2023 11:54:50 -0700 (PDT) On Thu, Oct 05, 2023 at 06:41:03PM +0200, Eric Dumazet wrote: > On Thu, Oct 5, 2023 at 6:32 PM Jakub Kicinski wrote: > > > > On Thu, 5 Oct 2023 18:11:56 +0200 Eric Dumazet wrote: > > > OK, but I suspect some users of napi_reschedule() might not be race-free... > > > > What's the race you're thinking of? > > This sort of thing... the race is in fl_starving() though... > > diff --git a/drivers/net/ethernet/chelsio/cxgb4/sge.c > b/drivers/net/ethernet/chelsio/cxgb4/sge.c > index 98dd78551d89..b5ff2e1a9975 100644 > --- a/drivers/net/ethernet/chelsio/cxgb4/sge.c > +++ b/drivers/net/ethernet/chelsio/cxgb4/sge.c > @@ -4261,7 +4261,7 @@ static void sge_rx_timer_cb(struct timer_list *t) > > if (fl_starving(adap, fl)) { > rxq = container_of(fl, struct sge_eth_rxq, fl); > - if (napi_reschedule(&rxq->rspq.napi)) > + if (napi_schedule(&rxq->rspq.napi)) > fl->starving++; > else > set_bit(id, s->starving_fl); Ehhh problem is that this is a simple rename so if any race is present, it's already there and not caused by this rename :( Don't know maybe this is out of scope and should be investigated with a bug report? Maybe this should be changed to prep/__schedule to prevent any kind of race? But doing so doesn't prevent any kind of ""starving""? -- Ansuel