From: Sergei Shtylyov <sergei.shtylyov@cogentembedded.com>
To: Dennis Chen <kernel.org.gnu@gmail.com>,
netdev <netdev@vger.kernel.org>,
Herbert Xu <herbert@gondor.apana.org.au>,
Miller <davem@davemloft.net>,
Eric Dumazet <eric.dumazet@gmail.com>
Subject: Re: [PATCH] net: Prevent multiple NAPI instances co-existing in the list
Date: Thu, 08 Jan 2015 16:04:08 +0300 [thread overview]
Message-ID: <54AE8048.6040105@cogentembedded.com> (raw)
In-Reply-To: <CA+U0gVh+TyEUJ+qmg+FE=UhvvQywfNxcouCyv1sutZ3fav5FAw@mail.gmail.com>
Hello.
On 1/8/2015 11:22 AM, Dennis Chen wrote:
> Some drivers may clear the NAPI_STATE_SCHED bit upon the state of the
> NAPI instance after exhaust the budget in the poll function, which
> will open a window for next device interrupt handler to insert a same
> instance to the list after calling list_add_tail(&n->poll_list,
> repoll) if we don't set this bit.
> Signed-off-by: Dennis Chen <kernel.org.gnu@gmail.com>
> ---
> net/core/dev.c | 8 ++++++++
> 1 file changed, 8 insertions(+)
> diff --git a/net/core/dev.c b/net/core/dev.c
> index 683d493..b3107ac 100644
> --- a/net/core/dev.c
> +++ b/net/core/dev.c
> @@ -4619,6 +4619,14 @@ static int napi_poll(struct napi_struct *n,
> struct list_head *repoll)
> n->dev ? n->dev->name : "backlog");
> goto out_unlock;
> }
> +
> + /* Some drivers may exit the polling mode when exhaust the
s/exhaust/exhausting/.
> + * budget. Set the NAPI_STATE_SCHED bit to prevent multiple NAPI
> + * instances in the list in case of next device interrupt raised.
> + */
> + if (unlikely(!test_and_set_bit(NAPI_STATE_SCHED, &n->state)))
> + pr_warn_once("%s: exit polling mode after exhaust the budget\n",
Likewise. And s/exit/exiting/.
WBR, Sergei
next prev parent reply other threads:[~2015-01-08 13:04 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-01-08 8:22 [PATCH] net: Prevent multiple NAPI instances co-existing in the list Dennis Chen
2015-01-08 11:15 ` Herbert Xu
2015-01-09 2:24 ` Dennis Chen
2015-01-09 2:27 ` Herbert Xu
2015-01-09 2:32 ` Dennis Chen
2015-01-09 2:34 ` Herbert Xu
2015-01-09 2:50 ` Dennis Chen
2015-01-09 3:07 ` Dennis Chen
2015-01-08 13:04 ` Sergei Shtylyov [this message]
2015-01-09 2:28 ` Dennis Chen
2015-01-08 14:51 ` Eric Dumazet
2015-01-09 2:26 ` Dennis Chen
2015-01-09 3:12 ` David Miller
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=54AE8048.6040105@cogentembedded.com \
--to=sergei.shtylyov@cogentembedded.com \
--cc=davem@davemloft.net \
--cc=eric.dumazet@gmail.com \
--cc=herbert@gondor.apana.org.au \
--cc=kernel.org.gnu@gmail.com \
--cc=netdev@vger.kernel.org \
/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).