public inbox for linuxppc-dev@ozlabs.org 
 help / color / mirror / Atom feed
From: Christian Marangi <ansuelsmth@gmail•com>
To: Eric Dumazet <edumazet@google•com>
Cc: "Andrew Lunn" <andrew@lunn•ch>,
	"Sergey Ryazanov" <ryazanov.s.a@gmail•com>,
	"Ziwei Xiao" <ziweixiao@google•com>,
	"Chris Snook" <chris.snook@gmail•com>,
	"Rick Lindsley" <ricklind@linux•ibm.com>,
	"Alexandre Torgue" <alexandre.torgue@foss•st.com>,
	"Krzysztof Halasa" <khalasa@piap•pl>,
	"Yuri Karpov" <YKarpov@ispras•ru>,
	netdev@vger•kernel.org, ath10k@lists•infradead.org,
	"Dany Madden" <danymadden@us•ibm.com>,
	"Gregory Greenman" <gregory.greenman@intel•com>,
	"Zhengchao Shao" <shaozhengchao@huawei•com>,
	"Chiranjeevi Rapolu" <chiranjeevi.rapolu@linux•intel.com>,
	"Dawei Li" <set_pte_at@outlook•com>,
	"Intel Corporation" <linuxwwan@intel•com>,
	"Rob Herring" <robh@kernel•org>,
	"Jeroen de Borst" <jeroendb@google•com>,
	"Leon Romanovsky" <leon@kernel•org>,
	linux-rdma@vger•kernel.org, "Lee Jones" <lee@kernel•org>,
	"Haren Myneni" <haren@linux•ibm.com>,
	linux-stm32@st-md-mailman•stormreply.com,
	"Rushil Gupta" <rushilg@google•com>,
	"Jason Gunthorpe" <jgg@ziepe•ca>,
	"Thomas Falcon" <tlfalcon@linux•ibm.com>,
	"Jose Abreu" <joabreu@synopsys•com>,
	"Uwe Kleine-König" <u.kleine-koenig@pengutronix•de>,
	linux-wireless@vger•kernel.org,
	"Jakub Kicinski" <kuba@kernel•org>,
	"Paolo Abeni" <pabeni@redhat•com>, "Wei Fang" <wei.fang@nxp•com>,
	"Wolfgang Grandegger" <wg@grandegger•com>,
	"Nick Child" <nnac123@linux•ibm.com>,
	"Simon Horman" <horms@kernel•org>,
	"Liu Haijun" <haijun.liu@mediatek•com>,
	"Kalle Valo" <kvalo@kernel•org>,
	linuxppc-dev@lists•ozlabs.org,
	"Nicholas Piggin" <npiggin@gmail•com>,
	linux-can@vger•kernel.org,
	"Yuanjun Gong" <ruc_gongyuanjun@163•com>,
	"Shailend Chand" <shailend@google•com>,
	"Marc Kleine-Budde" <mkl@pengutronix•de>,
	"Benjamin Berg" <benjamin.berg@intel•com>,
	"M Chetan Kumar" <m.chetan.kumar@linux•intel.com>,
	"Thomas Gleixner" <tglx@linutronix•de>,
	"Coco Li" <lixiaoyan@google•com>,
	linux-arm-kernel@lists•infradead.org,
	"Chandrashekar Devegowda" <chandrashekar.devegowda@intel•com>,
	"Ricardo Martinez" <ricardo.martinez@linux•intel.com>,
	"Loic Poulain" <loic.poulain@linaro•org>,
	"Zheng Zengkai" <zhengzengkai@huawei•com>,
	"Maximilian Lu z" <luzmaximilian@gmail•com>,
	Anjaneyulu <pagadala.yesu.anjaneyulu@intel•com>,
	"Rafael J. Wysocki" <rafael.j.wysocki@intel•com>,
	"Douglas Miller" <dougmill@linux•ibm.com>,
	linux-kernel@vger•kernel.org, "Tariq Toukan" <tariqt@nvidia•com>,
	"Krzysztof Kozlowski" <krzysztof.kozlowski@linaro•org>,
	"Junfeng Guo" <junfeng.guo@intel•com>,
	"Maxime Coquelin" <mcoquelin.stm32@gmail•com>,
	"Raju Rangoju" <rajur@chelsio•com>,
	"Praveen Kaligineedi" <pkaligineedi@google•com>,
	"Johannes Berg" <johannes@sipsolutions•net>,
	"Jeff Johnson" <quic_jjohnson@quicinc•com>,
	"David S. Miller" <davem@davemloft•net>
Subject: Re: [net-next PATCH v2 3/4] netdev: replace napi_reschedule with napi_schedule
Date: Fri, 6 Oct 2023 20:52:57 +0200	[thread overview]
Message-ID: <65205789.5d0a0220.7e49b.ccb0@mx.google.com> (raw)
In-Reply-To: <CANn89iJQ50AdXP2C1YB2pGjE02WCJ-QCsZqE1yGXtcGsfLA0Jw@mail.gmail.com>

On Thu, Oct 05, 2023 at 06:41:03PM +0200, Eric Dumazet wrote:
> On Thu, Oct 5, 2023 at 6:32 PM Jakub Kicinski <kuba@kernel•org> 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

  reply	other threads:[~2023-10-07 23:38 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-10-03 14:51 [net-next PATCH v2 1/4] netdev: replace simple napi_schedule_prep/__napi_schedule to napi_schedule Christian Marangi
2023-10-03 14:51 ` [net-next PATCH v2 2/4] netdev: make napi_schedule return bool on NAPI successful schedule Christian Marangi
2023-10-03 14:51 ` [net-next PATCH v2 3/4] netdev: replace napi_reschedule with napi_schedule Christian Marangi
2023-10-05 16:11   ` Eric Dumazet
2023-10-05 16:32     ` Jakub Kicinski
2023-10-05 16:41       ` Eric Dumazet
2023-10-06 18:52         ` Christian Marangi [this message]
2023-10-08  7:00           ` Eric Dumazet
2023-10-03 14:51 ` [net-next PATCH v2 4/4] netdev: use napi_schedule bool instead of napi_schedule_prep/__napi_schedule Christian Marangi
2023-10-05 16:16   ` Eric Dumazet
2023-10-06 18:49     ` Christian Marangi
2023-10-08  7:08       ` Eric Dumazet
2023-10-08 18:27         ` Christian Marangi
2023-10-09  8:27           ` Eric Dumazet
2023-10-05 16:09 ` [net-next PATCH v2 1/4] netdev: replace simple napi_schedule_prep/__napi_schedule to napi_schedule Eric Dumazet

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=65205789.5d0a0220.7e49b.ccb0@mx.google.com \
    --to=ansuelsmth@gmail$(echo .)com \
    --cc=YKarpov@ispras$(echo .)ru \
    --cc=alexandre.torgue@foss$(echo .)st.com \
    --cc=andrew@lunn$(echo .)ch \
    --cc=ath10k@lists$(echo .)infradead.org \
    --cc=benjamin.berg@intel$(echo .)com \
    --cc=chandrashekar.devegowda@intel$(echo .)com \
    --cc=chiranjeevi.rapolu@linux$(echo .)intel.com \
    --cc=chris.snook@gmail$(echo .)com \
    --cc=danymadden@us$(echo .)ibm.com \
    --cc=davem@davemloft$(echo .)net \
    --cc=dougmill@linux$(echo .)ibm.com \
    --cc=edumazet@google$(echo .)com \
    --cc=gregory.greenman@intel$(echo .)com \
    --cc=haijun.liu@mediatek$(echo .)com \
    --cc=haren@linux$(echo .)ibm.com \
    --cc=horms@kernel$(echo .)org \
    --cc=jeroendb@google$(echo .)com \
    --cc=jgg@ziepe$(echo .)ca \
    --cc=joabreu@synopsys$(echo .)com \
    --cc=johannes@sipsolutions$(echo .)net \
    --cc=junfeng.guo@intel$(echo .)com \
    --cc=khalasa@piap$(echo .)pl \
    --cc=krzysztof.kozlowski@linaro$(echo .)org \
    --cc=kuba@kernel$(echo .)org \
    --cc=kvalo@kernel$(echo .)org \
    --cc=lee@kernel$(echo .)org \
    --cc=leon@kernel$(echo .)org \
    --cc=linux-arm-kernel@lists$(echo .)infradead.org \
    --cc=linux-can@vger$(echo .)kernel.org \
    --cc=linux-kernel@vger$(echo .)kernel.org \
    --cc=linux-rdma@vger$(echo .)kernel.org \
    --cc=linux-stm32@st-md-mailman$(echo .)stormreply.com \
    --cc=linux-wireless@vger$(echo .)kernel.org \
    --cc=linuxppc-dev@lists$(echo .)ozlabs.org \
    --cc=linuxwwan@intel$(echo .)com \
    --cc=lixiaoyan@google$(echo .)com \
    --cc=loic.poulain@linaro$(echo .)org \
    --cc=luzmaximilian@gmail$(echo .)com \
    --cc=m.chetan.kumar@linux$(echo .)intel.com \
    --cc=mcoquelin.stm32@gmail$(echo .)com \
    --cc=mkl@pengutronix$(echo .)de \
    --cc=netdev@vger$(echo .)kernel.org \
    --cc=nnac123@linux$(echo .)ibm.com \
    --cc=npiggin@gmail$(echo .)com \
    --cc=pabeni@redhat$(echo .)com \
    --cc=pagadala.yesu.anjaneyulu@intel$(echo .)com \
    --cc=pkaligineedi@google$(echo .)com \
    --cc=quic_jjohnson@quicinc$(echo .)com \
    --cc=rafael.j.wysocki@intel$(echo .)com \
    --cc=rajur@chelsio$(echo .)com \
    --cc=ricardo.martinez@linux$(echo .)intel.com \
    --cc=ricklind@linux$(echo .)ibm.com \
    --cc=robh@kernel$(echo .)org \
    --cc=ruc_gongyuanjun@163$(echo .)com \
    --cc=rushilg@google$(echo .)com \
    --cc=ryazanov.s.a@gmail$(echo .)com \
    --cc=set_pte_at@outlook$(echo .)com \
    --cc=shailend@google$(echo .)com \
    --cc=shaozhengchao@huawei$(echo .)com \
    --cc=tariqt@nvidia$(echo .)com \
    --cc=tglx@linutronix$(echo .)de \
    --cc=tlfalcon@linux$(echo .)ibm.com \
    --cc=u.kleine-koenig@pengutronix$(echo .)de \
    --cc=wei.fang@nxp$(echo .)com \
    --cc=wg@grandegger$(echo .)com \
    --cc=zhengzengkai@huawei$(echo .)com \
    --cc=ziweixiao@google$(echo .)com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox