Netdev List
 help / color / mirror / Atom feed
From: Ben Hutchings <bhutchings@solarflare.com>
To: jhs@mojatatu.com
Cc: David Miller <davem@davemloft.net>,
	Eric Dumazet <eric.dumazet@gmail.com>,
	Herbert Xu <herbert@gondor.apana.org.au>,
	netdev@vger.kernel.org
Subject: Re: [PATCH] net_sched: fix dequeuer fairness
Date: Sun, 26 Jun 2011 15:53:53 +0100	[thread overview]
Message-ID: <1309100033.3093.1499.camel@localhost> (raw)
In-Reply-To: <1309097862.5134.26.camel@mojatatu>

On Sun, 2011-06-26 at 10:17 -0400, jamal wrote:
[...]
> diff --git a/net/sched/sch_generic.c b/net/sched/sch_generic.c
> index b4c6809..578269e 100644
> --- a/net/sched/sch_generic.c
> +++ b/net/sched/sch_generic.c
> @@ -190,14 +190,18 @@ static inline int qdisc_restart(struct Qdisc *q)
>  void __qdisc_run(struct Qdisc *q)
>  {
>         unsigned long start_time = jiffies;
> +       int quota = 0;
> +       int work = weight_p;

These variable names seem to be the wrong way round, i.e. the weight is
our 'quota' and the number of packets dequeued is the 'work' we've done.

Ben.

>         while (qdisc_restart(q)) {
> +               quota++;
>                 /*
> -                * Postpone processing if
> -                * 1. another process needs the CPU;
> -                * 2. we've been doing it for too long.
> +                * Ordered by possible occurrence: Postpone processing if
> +                * 1. we've exceeded packet quota
> +                * 2. another process needs the CPU;
> +                * 3. we've been doing it for too long.
>                  */
> -               if (need_resched() || jiffies != start_time) {
> +               if (quota >= work || need_resched() || jiffies != start_time) {
>                         __netif_schedule(q);
>                         break;
>                 }
> 

-- 
Ben Hutchings, Senior Software Engineer, Solarflare
Not speaking for my employer; that's the marketing department's job.
They asked us to note that Solarflare product names are trademarked.


  reply	other threads:[~2011-06-26 14:53 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-06-26 14:07 [PATCH] net_sched: fix dequeuer fairness jamal
2011-06-26 14:17 ` jamal
2011-06-26 14:53   ` Ben Hutchings [this message]
2011-06-26 15:27     ` jamal
2011-06-26 15:09 ` Eric Dumazet
2011-06-26 15:32   ` jamal
2011-06-26 15:53     ` Eric Dumazet
2011-06-26 16:13       ` jamal
2011-06-26 16:03     ` jamal
2011-06-26 16:26       ` Eric Dumazet
2011-06-26 16:29         ` jamal
2011-06-26 21:18           ` Ben Hutchings
2011-06-26 16:38         ` jamal
2011-06-26 18:13           ` jamal
2011-06-27  7:15             ` 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=1309100033.3093.1499.camel@localhost \
    --to=bhutchings@solarflare.com \
    --cc=davem@davemloft.net \
    --cc=eric.dumazet@gmail.com \
    --cc=herbert@gondor.apana.org.au \
    --cc=jhs@mojatatu.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