netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
To: Ratheesh Kannoth <rkannoth@marvell.com>
Cc: "netdev@vger.kernel.org" <netdev@vger.kernel.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	Sunil Kovvuri Goutham <sgoutham@marvell.com>,
	Geethasowjanya Akula <gakula@marvell.com>,
	Subbaraya Sundeep Bhatta <sbhatta@marvell.com>,
	Hariprasad Kelam <hkelam@marvell.com>,
	"davem@davemloft.net" <davem@davemloft.net>,
	"edumazet@google.com" <edumazet@google.com>,
	"kuba@kernel.org" <kuba@kernel.org>,
	"pabeni@redhat.com" <pabeni@redhat.com>,
	"hawk@kernel.org" <hawk@kernel.org>,
	"alexander.duyck@gmail.com" <alexander.duyck@gmail.com>,
	"ilias.apalodimas@linaro.org" <ilias.apalodimas@linaro.org>,
	"linyunsheng@huawei.com" <linyunsheng@huawei.com>
Subject: Re: RE: [EXT] Re: [PATCH net v1] octeontx2-pf: Fix page pool cache index corruption.
Date: Wed, 6 Sep 2023 10:39:43 +0200	[thread overview]
Message-ID: <20230906083943.BsCvyHew@linutronix.de> (raw)
In-Reply-To: <MWHPR1801MB191826BCB156AB7ADA1F6AF3D3EFA@MWHPR1801MB1918.namprd18.prod.outlook.com>

On 2023-09-06 08:24:53 [+0000], Ratheesh Kannoth wrote:
> > From: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
> > Subject: [EXT] Re: [PATCH net v1] octeontx2-pf: Fix page pool cache index
> > corruption.
> > 
> > > +	napi_schedule(wrk->napi);
> > 
> > This will delay NAPI until "some random point in the future" for instance if an
> > interrupt on _this_ CPU fires. You only set the softirq state and never enforce
> > it here. This works as intended if invoked from an IRQ but this here a worker/
> > process context.
> ACK.  Do we need to be so precise here ? Anyway we are short of rx buffers and want to schedule NAPI after some time 
> (in delayed workqueue) to recheck on rx buffers.  Softirq state will be checked even on timer interrupt returns, right ?.  I was thinking 
> Case - what will happen if workqueue never got a chance to run if system is stressed with interrupts. 

As of this patch, the timer will wake the worker and worker will
schedule NAPI. (The timer CPU and the worker CPU can be different.)
If nothing else happens the CPU, which run the worker, will go idle.
With NO_HZ enabled you should see warning that the CPU is going idle
with pending softirqs.
I prefer to be precise what is going on so there are no surprises.

If the CPU is stressed with interrupts then it is probably busy enough
and not running the worker to ask for memory (which it did not have
earlier) is probably the smallest problem.

I'm not against the worker (with the extra steps) but I prefer to have
napi schedule done properly.

> > You can either put local_bh_disable()/enable() around napi_schedule() or
> > use it from a timer callback and skip the worker.
> Switching to  a timer callback makes sense. 

oki.

> -Ratheesh

Sebastian

  reply	other threads:[~2023-09-06  8:39 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-09-06  3:39 [PATCH net v1] octeontx2-pf: Fix page pool cache index corruption Ratheesh Kannoth
2023-09-06  8:08 ` Sebastian Andrzej Siewior
2023-09-06  8:24   ` [EXT] " Ratheesh Kannoth
2023-09-06  8:39     ` Sebastian Andrzej Siewior [this message]
2023-09-06  8:46       ` Ratheesh Kannoth

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=20230906083943.BsCvyHew@linutronix.de \
    --to=bigeasy@linutronix.de \
    --cc=alexander.duyck@gmail.com \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=gakula@marvell.com \
    --cc=hawk@kernel.org \
    --cc=hkelam@marvell.com \
    --cc=ilias.apalodimas@linaro.org \
    --cc=kuba@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linyunsheng@huawei.com \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=rkannoth@marvell.com \
    --cc=sbhatta@marvell.com \
    --cc=sgoutham@marvell.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
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;
as well as URLs for NNTP newsgroup(s).