From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id C7960E81E1F for ; Fri, 6 Oct 2023 18:53:05 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References: Subject:Cc:To:From:Date:Message-ID:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=K6o6wwGovhSkivJn4rFDGYA2IEGlvcblBTiLcBwmOe4=; b=phBsEFju/6Ag5G dPQ0SHbfNG5h+N/9UrU7nZj97eH5dC9uNC2rW/I20S9LcisWCqrk7rg0Y1Ff3YoFMuv4zxIgRu6CP /UvcCtbLbCXnYN2Q8MvIVnkebVzq6uhOHqhOXT809ZoWTaZQBc/H8jyNnVlKsi15hmezePHUcvv5H ub/t68zoSUifvk15VMVfG8pCpcX9Cp/upJa3Eezfvv971pcG9plTuPIhMVCTipeDD9bJbWzfTi01H wXUOG+CesQK/LUa5siqCc/2nVrrWzdGUcP3xiKPHVw85chHzi48dfBwK1yYaQCWlrcCzFJ5rLgMAt E7IQSBb1P4zAdyRRDPxA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1qopwe-006LTF-2g; Fri, 06 Oct 2023 18:53:04 +0000 Received: from mail-wr1-x42a.google.com ([2a00:1450:4864:20::42a]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1qopwa-006LS0-28; Fri, 06 Oct 2023 18:53:01 +0000 Received: by mail-wr1-x42a.google.com with SMTP id ffacd0b85a97d-31c5cac3ae2so2150602f8f.3; 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=lists.infradead.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=ilp3xauz4z4JA/oWAzLfR144jusoFEAPERNpm0X+x7c3Q4dVHL00J1PWmm1oocl/pW Or6RemzFQzp2TO88eUH1HOomqRJXS8LApWDxOP6yit1NbqWsstorjGn2bq5ysYb9Eago zLW7+AfcvwmzhZa3qt1A33BngLlJUo6OpUTlw8Z5hcUBC2b5p9ohYLAKSrrY/eOw8sDu rTznDtGQ0M1VOZK+VCaIGgOgHMpOYxNQEGGxh4Acfq9i0mIaajZhqvvbnum2gdJhNKuT m78ylt8Jj38hEyFzL5FyersODkFC9xX9X926gzSLENbRmM+Akk1SAKiawDvyb6QBKzm8 m6lw== 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=ItGkSp6uQ5aXe6X0j5pUR0I39pFvWUwRCmeyMG4IHCAb8Kya54wKrgi/b75jqq+orx oKeF0Krjk9MLIGOqGpyJbq92qsmUULFfqD9mGIqaeaDsFyDhyhsZ5OaXw99GSKaOb1Hd fSPAIK/lcbgNu2GJ3Sx/zDq/L51oYhTU1ELsHyvxuy1Uc/fjuEJfmN6ct1JoKjvfrBR+ XaOHhjvmxTxUVrHv22wCxHC3M4ETGEuGb9PLEGlfY/f6P4vKXk50VPBCHaHGlDDt5lE9 rxW8f+ZpG3nq5JgSKls/3MBcbgHWw+F0HzxldUM8DiHMudnZaT/3Z74lQytOdq/ranCv 39Zw== X-Gm-Message-State: AOJu0YxVQrQtAZZOPhP22Sua1415mdLx9AQHZ6GHhpfQHlXkN3FxKm8c 9B1kab4ArrD/DxBZy01/tls= X-Google-Smtp-Source: AGHT+IG8xdl5PYYzmkg371/9IVLxOcEUg0/AO4c3FMmCpHBI1rBYraaud13cZvVNCZmgDH81LCr6PA== 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-Disposition: inline In-Reply-To: X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20231006_115300_704296_3BAC43E5 X-CRM114-Status: GOOD ( 17.37 ) X-BeenThere: ath10k@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: base64 Sender: "ath10k" Errors-To: ath10k-bounces+ath10k=archiver.kernel.org@lists.infradead.org T24gVGh1LCBPY3QgMDUsIDIwMjMgYXQgMDY6NDE6MDNQTSArMDIwMCwgRXJpYyBEdW1hemV0IHdy b3RlOgo+IE9uIFRodSwgT2N0IDUsIDIwMjMgYXQgNjozMuKAr1BNIEpha3ViIEtpY2luc2tpIDxr dWJhQGtlcm5lbC5vcmc+IHdyb3RlOgo+ID4KPiA+IE9uIFRodSwgNSBPY3QgMjAyMyAxODoxMTo1 NiArMDIwMCBFcmljIER1bWF6ZXQgd3JvdGU6Cj4gPiA+IE9LLCBidXQgSSBzdXNwZWN0IHNvbWUg dXNlcnMgb2YgbmFwaV9yZXNjaGVkdWxlKCkgbWlnaHQgbm90IGJlIHJhY2UtZnJlZS4uLgo+ID4K PiA+IFdoYXQncyB0aGUgcmFjZSB5b3UncmUgdGhpbmtpbmcgb2Y/Cj4gCj4gVGhpcyBzb3J0IG9m IHRoaW5nLi4uIHRoZSByYWNlIGlzIGluIGZsX3N0YXJ2aW5nKCkgdGhvdWdoLi4uCj4gCj4gZGlm ZiAtLWdpdCBhL2RyaXZlcnMvbmV0L2V0aGVybmV0L2NoZWxzaW8vY3hnYjQvc2dlLmMKPiBiL2Ry aXZlcnMvbmV0L2V0aGVybmV0L2NoZWxzaW8vY3hnYjQvc2dlLmMKPiBpbmRleCA5OGRkNzg1NTFk ODkuLmI1ZmYyZTFhOTk3NSAxMDA2NDQKPiAtLS0gYS9kcml2ZXJzL25ldC9ldGhlcm5ldC9jaGVs c2lvL2N4Z2I0L3NnZS5jCj4gKysrIGIvZHJpdmVycy9uZXQvZXRoZXJuZXQvY2hlbHNpby9jeGdi NC9zZ2UuYwo+IEBAIC00MjYxLDcgKzQyNjEsNyBAQCBzdGF0aWMgdm9pZCBzZ2VfcnhfdGltZXJf Y2Ioc3RydWN0IHRpbWVyX2xpc3QgKnQpCj4gCj4gICAgICAgICAgICAgICAgICAgICAgICAgaWYg KGZsX3N0YXJ2aW5nKGFkYXAsIGZsKSkgewo+ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgcnhxID0gY29udGFpbmVyX29mKGZsLCBzdHJ1Y3Qgc2dlX2V0aF9yeHEsIGZsKTsKPiAtICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChuYXBpX3Jlc2NoZWR1bGUoJnJ4cS0+cnNw cS5uYXBpKSkKPiArICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChuYXBpX3NjaGVk dWxlKCZyeHEtPnJzcHEubmFwaSkpCj4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgIGZsLT5zdGFydmluZysrOwo+ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ZWxzZQo+ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzZXRfYml0KGlk LCBzLT5zdGFydmluZ19mbCk7CgpFaGhoIHByb2JsZW0gaXMgdGhhdCB0aGlzIGlzIGEgc2ltcGxl IHJlbmFtZSBzbyBpZiBhbnkgcmFjZSBpcyBwcmVzZW50LAppdCdzIGFscmVhZHkgdGhlcmUgYW5k IG5vdCBjYXVzZWQgYnkgdGhpcyByZW5hbWUgOigKCkRvbid0IGtub3cgbWF5YmUgdGhpcyBpcyBv dXQgb2Ygc2NvcGUgYW5kIHNob3VsZCBiZSBpbnZlc3RpZ2F0ZWQgd2l0aCBhCmJ1ZyByZXBvcnQ/ CgpNYXliZSB0aGlzIHNob3VsZCBiZSBjaGFuZ2VkIHRvIHByZXAvX19zY2hlZHVsZSB0byBwcmV2 ZW50IGFueSBraW5kIG9mCnJhY2U/IEJ1dCBkb2luZyBzbyBkb2Vzbid0IHByZXZlbnQgYW55IGtp bmQgb2YgIiJzdGFydmluZyIiPwoKLS0gCglBbnN1ZWwKCl9fX19fX19fX19fX19fX19fX19fX19f X19fX19fX19fX19fX19fX19fX19fX19fCmF0aDEwayBtYWlsaW5nIGxpc3QKYXRoMTBrQGxpc3Rz LmluZnJhZGVhZC5vcmcKaHR0cDovL2xpc3RzLmluZnJhZGVhZC5vcmcvbWFpbG1hbi9saXN0aW5m by9hdGgxMGsK From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 1E172E9371F for ; Fri, 6 Oct 2023 18:54:48 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233371AbjJFSyn (ORCPT ); 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-Google-Smtp-Source: AGHT+IG8xdl5PYYzmkg371/9IVLxOcEUg0/AO4c3FMmCpHBI1rBYraaud13cZvVNCZmgDH81LCr6PA== 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: Precedence: bulk List-ID: X-Mailing-List: linux-can@vger.kernel.org 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 From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.ozlabs.org (lists.ozlabs.org [112.213.38.117]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id D1283E95A67 for ; Sat, 7 Oct 2023 23:38:34 +0000 (UTC) Authentication-Results: lists.ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20230601 header.b=iWV9RYpD; dkim-atps=neutral Received: from boromir.ozlabs.org (localhost [IPv6:::1]) by lists.ozlabs.org (Postfix) with ESMTP id 4S31vY0tkkz3cdV for ; Sun, 8 Oct 2023 10:38:33 +1100 (AEDT) Authentication-Results: lists.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20230601 header.b=iWV9RYpD; dkim-atps=neutral Authentication-Results: lists.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=gmail.com (client-ip=2a00:1450:4864:20::435; helo=mail-wr1-x435.google.com; envelope-from=ansuelsmth@gmail.com; receiver=lists.ozlabs.org) Received: from mail-wr1-x435.google.com (mail-wr1-x435.google.com [IPv6:2a00:1450:4864:20::435]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 4S2HcZ45Rgz3clc for ; Sat, 7 Oct 2023 05:53:02 +1100 (AEDT) Received: by mail-wr1-x435.google.com with SMTP id ffacd0b85a97d-32167a4adaaso2156547f8f.1 for ; Fri, 06 Oct 2023 11:53:02 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1696618378; x=1697223178; darn=lists.ozlabs.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=iWV9RYpDVaGNkKUrwFg8N+LQWjQlWuwk7zh8gPGCDJgVWsY8vkkJaacdY7sEfGDqDw JEbQvVl6E4/2yeyklHfcvt0GuhKiDiyFrg/dzOFFYdPhZjM2NWGOmDfK8TaHtgsSNf2r Tv2cWRCUvl4MBvBwruiclLKKWE+sRvkyV7jzZYeKdImH5FpKJK/LVTFmbh4TkFS+bZJY kSuOKO83WhXQUiWQ636so6MO352UZBUnCpKXpueX+GKF8um5dbT6tNSdXjLmwYCg6z5d UVKJNTUN4xkNQTnfGtyT7j89ARm6VaplSmA4PdFKl9Q/82nTmh29VjAiRSUVnqdJvGg4 qH2Q== 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=m99PAqvnPGUtWzb0Yb8M6nk2fQ7aNAqZ048+P7GG6hWX2MJWvcrqy8sHr0cID7EeWm PzDRcCKaiQqskDL44WwGxxEuJd6VF6/sAgwI6QdraoIyNhRaTxRRWzUijIek1HVaQi+/ h5VG/RrT2kuvVjmRiZo2gvm8Tsi/QElYN4UaJRl7S++Af4O0IJOg8NyWh8g0gfbahIUA XkEDXdpnti/M6WaHpLiiC9AMMNmivPsTdRDRH5gu1a05OcfHvyZtbVKf1CCVRxLMKd7t kSz86+AbAMUi9tEZsxjfbJbSEoZVZuFcZeB320sggwjAk5iu/ARBOyu0cuwzqIKZEFnD 2Iow== X-Gm-Message-State: AOJu0YwQpxhaRVyh8rRZaQFs6IVApEK7fgvGhu4rOl5TZuItjmBbrxkq bz6kpNRiaNhZGxByr4iQGnE= X-Google-Smtp-Source: AGHT+IG8xdl5PYYzmkg371/9IVLxOcEUg0/AO4c3FMmCpHBI1rBYraaud13cZvVNCZmgDH81LCr6PA== 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 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-Mailman-Approved-At: Sun, 08 Oct 2023 10:36:54 +1100 X-BeenThere: linuxppc-dev@lists.ozlabs.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Linux on PowerPC Developers Mail List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Andrew Lunn , Sergey Ryazanov , Ziwei Xiao , Chris Snook , Rick Lindsley , Alexandre Torgue , Krzysztof Halasa , Yuri Karpov , netdev@vger.kernel.org, ath10k@lists.infradead.org, Dany Madden , Gregory Greenman , Zhengchao Shao , Chiranjeevi Rapolu , Dawei Li , Intel Corporation , Rob Herring , Jeroen de Borst , Leon Romanovsky , linux-rdma@vger.kernel.org, Lee Jones , Haren Myneni , linux-stm32@st-md-mailman.stormreply.com, Rushil Gupta , Jason Gunthorpe , Thomas Falcon , Jose Abreu , Uwe =?iso-8859-1?Q?Kleine-K=F6nig?= , linux-wireless@vger.kernel.org, Jakub Kicinski , Paolo Abeni , Wei Fang , Wolfgang Grandegger , Nick Child , Simon Horman , Liu Haijun , Kalle Valo , linuxppc-dev@lists.ozlabs.org, Nicholas Piggin , linux-can@vger.kernel.org, Yuanjun Gong , Shailend Chand , Marc Kleine-Budde , Benjamin Berg , M Chetan Kumar , Thomas Gleixner , Coco Li , linux-arm-kernel@lists.infradead.org, Chandrashekar Devegowda , Ricardo Martinez , Loic Poulain , Zheng Zengkai , Maximilian Lu z , Anjaneyulu , "Rafael J. Wysocki" , Douglas Miller , linux-kernel@vger.kernel.org, Tariq Toukan , Krzysztof Kozlowski , Junfeng Guo , Maxime Coquelin , Raju Rangoju , Praveen Kaligineedi , Johannes Berg , Jeff Johnson , "David S. Miller" Errors-To: linuxppc-dev-bounces+linuxppc-dev=archiver.kernel.org@lists.ozlabs.org Sender: "Linuxppc-dev" 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