[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <OF0E0FA5FB.06A0B8D0-ON652572D6.001854BA-652572D6.001943CC@in.ibm.com>
Date: Wed, 9 May 2007 10:05:57 +0530
From: Krishna Kumar2 <krkumar2@...ibm.com>
To: David Miller <davem@...emloft.net>
Cc: netdev@...r.kernel.org
Subject: Re: [PATCH] sched: Optimize return value of qdisc_restart
Hi Dave,
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.
thanks,
- KK
David Miller <davem@...emloft.net> wrote on 05/09/2007 07:35:06 AM:
> From: Krishna Kumar <krkumar2@...ibm.com>
> Date: Tue, 08 May 2007 13:01:32 +0530
>
> > Optimize return value of qdisc_restart so that it is not called an
> > extra time if there are no more packets on the queue to be sent out.
> > It is also not required to check for gso_skb (though the lock is
> > dropped) since another cpu which added this would have done a
> > netif_schedule.
> >
> > Patch against net-2.6.22.git
> >
> > Signed-off-by: Krishna Kumar <krkumar2@...ibm.com>
>
> <0 return value here means that the queue is not empty, and the device
> is throttled. If you want to do this, just branch down to the end of
> the function which asserts that q->q.qlen is not negative, and returns
> it.
>
> That will achieve the right effect.
>
> But I'm not so sure about this idea, I have this strange feeling that
> we do things this way for a reason... Hmmm...
-
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Powered by blists - more mailing lists