netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: David Miller <davem@davemloft.net>
To: krkumar2@in.ibm.com
Cc: netdev@vger.kernel.org
Subject: Re: [PATCH] sched: Optimize return value of qdisc_restart
Date: Tue, 08 May 2007 23:36:30 -0700 (PDT)	[thread overview]
Message-ID: <20070508.233630.35664266.davem@davemloft.net> (raw)
In-Reply-To: <OF0E0FA5FB.06A0B8D0-ON652572D6.001854BA-652572D6.001943CC@in.ibm.com>

From: Krishna Kumar2 <krkumar2@in.ibm.com>
Date: Wed, 9 May 2007 10:05:57 +0530

> This change will not change existing behavior in case there are
> packets in the queue, it will return -1 each time as does the
> original code. But when there are no packets, the original
> qdisc_restart returns -1 and the caller will unnecessarily call
> qdisc_restart which branches to the bottom and returns 0
> (qlen). This call can be avoided if we had returned 0 in the
> previous iteration.  Branching to the bottom cannot be done since it
> breaks the "packets present" case, as it will return a positive
> number and the caller will assume that the queue is throttled.

Ok, thanks for the explanation.

But this only makes sense for the second hunk you changed.

The first hunk is a bug case, an improper looping device
decapsulation condition, and we do want to always return
-1 in that case in order to break out of the loop.

Your change will make the kernel essentially hang instead
when this bug check is triggered.

  reply	other threads:[~2007-05-09  6:36 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-05-08  7:31 [PATCH] sched: Optimize return value of qdisc_restart Krishna Kumar
2007-05-09  2:05 ` David Miller
2007-05-09  4:35   ` Krishna Kumar2
2007-05-09  6:36     ` David Miller [this message]
2007-05-09  7:23       ` Krishna Kumar2
2007-05-09  8:12         ` David Miller
2007-05-09 12:56           ` jamal
2007-05-09 14:47             ` Krishna Kumar2
2007-05-09 15:52               ` jamal
2007-05-10  5:12                 ` Krishna Kumar2
2007-05-10 11:50                   ` Herbert Xu
2007-05-10 11:55                     ` David Miller
2007-05-10 12:10                       ` Herbert Xu
2007-05-10 21:11                         ` David Miller
2007-05-10 12:21                       ` jamal
2007-05-10 12:50                         ` jamal
2007-05-10 12:59                         ` Herbert Xu
2007-05-10 13:18                           ` jamal
2007-05-10 13:52                             ` Herbert Xu
2007-05-10 14:12                               ` jamal
2007-05-10 14:26                                 ` Krishna Kumar2
2007-05-10 14:31                                   ` Herbert Xu

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=20070508.233630.35664266.davem@davemloft.net \
    --to=davem@davemloft.net \
    --cc=krkumar2@in.ibm.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).