Received: by 2002:a05:7412:da14:b0:e2:908c:2ebd with SMTP id fe20csp1285752rdb; Sun, 8 Oct 2023 00:02:01 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHdcWxwpOkkDSM3IJcSzkKv2MYbe259ZKUjCCAIoS9/gZRsFQ0raVUZ981C4+GSL46wWNTt X-Received: by 2002:a05:6358:9d82:b0:164:a045:e459 with SMTP id d2-20020a0563589d8200b00164a045e459mr399491rwo.16.1696748521188; Sun, 08 Oct 2023 00:02:01 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1696748521; cv=none; d=google.com; s=arc-20160816; b=WYAmyU1bnTj6JiMIe5N9BkRrHtJ7VAzI9rnmSeZt7eQt/TL/95M3X7pQhyXPL4/qY5 cqgXPg6fvl9uAIlQPgZK28Fpl319x3UP3g7TM1fFZ+T/pE2t8rBEsLTsONXD2cBd+GNg mri3NCBOq5SIdoOtHOM6cFFazNtD+CkboiB3H5bBKezJP9mVbFdcwmTUy5LIEaVULZ8y QC2hNnoksCXl2K7CiFGy8+L8kAS0WJQtXlcx7TCeqPlwXOZ8ZO9sZyRhBLy9fp2BeuwM ZJr6DWZpHMGeRXbMYWjMsHYrxYLMsrNnkysj/8KKgUc4s7x55QgwRaHhGJ+eBbvvkbcy v5lQ== 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=mH8rgsD0Hcv//mdO9CGjCjg749l4skH04u5NpNfXSJo=; fh=zy4+kFY0vZ06kxpm1fljjmt9NfV/kC0ejG6TaO2bEjA=; b=hIgLlOKx+Inw3+NK9U1SbMvzComGJHtyEJu67NE41ItZvoPvxt9a5hjHVCjZt6l59V KDrW0Mr7lRVXNwZkSB9UWYbxCePgLubZsXgu8v9TjWbjoT1Q/Yv8Bnn+8Ys2pPF4bbGx tKhmbPEb4bs7jfuM4sctL5SMVWSLG8SOQzw9Yo784w3q+Bc7TWNItj9J/svTegfCzyKL 3LCb1bRsR7CDQif+B2BZcYE+9Leap828yWYGIn7BXCXWugIbVUBKua58qz8CXJ0cxVvS p1B+NJKmOx2Tia2qibHdfCol7PgIqALwNVzc8CSHqX5zAjVEsUsvp5++mKQfy98gW+Oi EStQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20230601 header.b=BShKJaRt; 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=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from snail.vger.email (snail.vger.email. [2620:137:e000::3:7]) by mx.google.com with ESMTPS id e5-20020a17090a630500b00278f6a8027csi7189803pjj.154.2023.10.08.00.02.00 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 08 Oct 2023 00:02:01 -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=@google.com header.s=20230601 header.b=BShKJaRt; 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=REJECT sp=REJECT dis=NONE) header.from=google.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by snail.vger.email (Postfix) with ESMTP id 1CA22809E71F; Sun, 8 Oct 2023 00:01:26 -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 S229697AbjJHHAu (ORCPT + 99 others); Sun, 8 Oct 2023 03:00:50 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33026 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229441AbjJHHAq (ORCPT ); Sun, 8 Oct 2023 03:00:46 -0400 Received: from mail-ed1-x536.google.com (mail-ed1-x536.google.com [IPv6:2a00:1450:4864:20::536]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9C2B9D8 for ; Sun, 8 Oct 2023 00:00:44 -0700 (PDT) Received: by mail-ed1-x536.google.com with SMTP id 4fb4d7f45d1cf-534694a9f26so5427a12.1 for ; Sun, 08 Oct 2023 00:00:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1696748442; x=1697353242; 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=mH8rgsD0Hcv//mdO9CGjCjg749l4skH04u5NpNfXSJo=; b=BShKJaRtusNijZZ57Kaaydm5cxCfHocp+nOGciKvqb++6Z9nyuOD/uC/kwsqizh687 mFCJJDc0urQQh8PUEZpRDB/57VWp8QQL0APQ1smHc1IlmJKuQB/El5qROWmyM0VacBco 0A9gWDEdTwWZUHz6i8escGbPUk+91X8GZVCK4ScPcGUG7Z5Hvknlv82uujz3OWIz09xc zuxWkk0Rgyg0O67zeZyl1tZBwYl653Ub4NuaRjZptmkgBr/R3t3EIsSz82C3x0SZm5j7 I2qJPEGGMPOdJtEZnHrvaxoj7eYt8xYe/WVxl0ptpTU3+tNzNcTzagg0FQubKas09fM9 WWNA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1696748442; x=1697353242; 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=mH8rgsD0Hcv//mdO9CGjCjg749l4skH04u5NpNfXSJo=; b=CMd3t6E1PgMAGDFYSAX/U4jiL0wkbNYIzECEGgYmp5dmFhoXxIqC1P7tsuG1YkyPO5 tLQDMiUSeLetTJXeePh8EZ8oM7q4EjFlxmkLjOnEcBpZomKioZv6r7YXuwz4t7B1zx8e FZAXz6o8bxrbs1I+nSBQy72SmSdVFRG6vml/6jpYZcvKjW9lAXXyN9pVCRKwQolB4nUi 4EKcM22BxoZGupbpB13cA/3hits1x7e4cnrA2AIXkxpOgzYF1x2Z/mJtlWPMV5DxR98w Ktbj7h6EJBJoXY5OyznZei1TYx7Ov0o0FjaEO4VptwkG5CUBW89G/z7Nr0WRS3WcxiOy y/Fg== X-Gm-Message-State: AOJu0Yx34BBbgW09SmC27jCjC69JXXASmoKbCgsgQdFpJN4/RXtUXctU OX+AooFeWVdPqkCF0fI05ksh1d3BdaYVGzCgzSriww== X-Received: by 2002:a50:9fa4:0:b0:538:5f9e:f0fc with SMTP id c33-20020a509fa4000000b005385f9ef0fcmr307070edf.0.1696748442128; Sun, 08 Oct 2023 00:00:42 -0700 (PDT) MIME-Version: 1.0 References: <20231003145150.2498-1-ansuelsmth@gmail.com> <20231003145150.2498-3-ansuelsmth@gmail.com> <20231005093253.2e25533a@kernel.org> <65205789.5d0a0220.7e49b.ccb0@mx.google.com> In-Reply-To: <65205789.5d0a0220.7e49b.ccb0@mx.google.com> From: Eric Dumazet Date: Sun, 8 Oct 2023 09:00:29 +0200 Message-ID: Subject: Re: [net-next PATCH v2 3/4] netdev: replace napi_reschedule with napi_schedule To: Christian Marangi 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 , =?UTF-8?Q?Uwe_Kleine=2DK=C3=B6nig?= , 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 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-17.6 required=5.0 tests=BAYES_00,DKIMWL_WL_MED, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF, ENV_AND_HDR_SPF_MATCH,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS, USER_IN_DEF_DKIM_WL,USER_IN_DEF_SPF_WL,WEIRD_QUOTING autolearn=unavailable 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]); Sun, 08 Oct 2023 00:01:26 -0700 (PDT) On Fri, Oct 6, 2023 at 8:52=E2=80=AFPM Christian Marangi wrote: > > On Thu, Oct 05, 2023 at 06:41:03PM +0200, Eric Dumazet wrote: > > On Thu, Oct 5, 2023 at 6:32=E2=80=AFPM 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 =3D 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""? > I gave a "Reviewed-by: Eric Dumazet ", meaning your patch was ok for me. My remark was orthogonal, I am not asking you to act on it ;)