From: Stephen Hemminger <shemminger@linux-foundation.org>
To: David Miller <davem@davemloft.net>
Cc: netdev@vger.kernel.org
Subject: Re: new NAPI quota synchronization issue
Date: Wed, 19 Sep 2007 15:01:29 -0700 [thread overview]
Message-ID: <20070919150129.7b0967f7@freepuppy.rosehill.hemminger.net> (raw)
In-Reply-To: <20070919.103508.59469052.davem@davemloft.net>
On Wed, 19 Sep 2007 10:35:08 -0700 (PDT)
David Miller <davem@davemloft.net> wrote:
> From: David Miller <davem@davemloft.net>
> Date: Wed, 19 Sep 2007 09:58:25 -0700 (PDT)
>
> > Probably a good way to deal with this is to simply make the quota
> > handling stateless.
> >
> > The only reason we handle partial quota usage is to handle the
> > global netdev_budget. But we can simply "round up" and let
> > netdev_budget get oversubscribed by one napi->quota's worth
> > if necessary.
> >
> > At that point, n->quota only holds two states when used, full
> > and empty. And at that point there is no reason to maintain
> > it's value at all. Only the weight is necessary.
> >
> > I'll try to post a patch which implements this later today.
>
> Ok, here is the patch and I've checked it into net-2.6.24 as well.
>
> There really shouldn't be any fundamental synchronization issues
> in the new NAPI stuff any longer. I'm pretty sure any problems
> remaining can only be caused by drivers bugs but we'll see :-)
>
> I went over the list handling several times and it looks bulletproof.
> Only the thread of control that sets the NAPI_STATE_SCHED bit
> atomically will do list modifications, until the thread of control
> that decides unconditionally to clear the bit, which will do a
> list_del() immediately before clearing that bit.
>
>
There might be a future problem if some driver decided to change weight
often on the fly? Perhaps you need to sample it once in start of napi_schedule.
next prev parent reply other threads:[~2007-09-19 22:01 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-09-19 16:58 new NAPI quota synchronization issue David Miller
2007-09-19 17:35 ` David Miller
2007-09-19 22:01 ` Stephen Hemminger [this message]
2007-09-19 22:10 ` 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=20070919150129.7b0967f7@freepuppy.rosehill.hemminger.net \
--to=shemminger@linux-foundation.org \
--cc=davem@davemloft.net \
--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