diff mbox

[net-next,3/4] net_sched: netem: remove qdisc_is_throttled() use

Message ID 1465602099-15808-4-git-send-email-edumazet@google.com
State Accepted, archived
Delegated to: David Miller
Headers show

Commit Message

Eric Dumazet June 10, 2016, 11:41 p.m. UTC
Looks like it is only there as some optimization attempt.

Since __QDISC_STATE_THROTTLED set/unset is way too expensive,
and netem is the last user, just remove this check.

Signed-off-by: Eric Dumazet <edumazet@google.com>
---
 net/sched/sch_netem.c | 3 ---
 1 file changed, 3 deletions(-)

Comments

Eric Dumazet Aug. 4, 2016, 12:35 p.m. UTC | #1
On Fri, 2016-06-10 at 16:41 -0700, Eric Dumazet wrote:
> Looks like it is only there as some optimization attempt.
> 
> Since __QDISC_STATE_THROTTLED set/unset is way too expensive,
> and netem is the last user, just remove this check.
> 
> Signed-off-by: Eric Dumazet <edumazet@google.com>
> ---
>  net/sched/sch_netem.c | 3 ---
>  1 file changed, 3 deletions(-)
> 
> diff --git a/net/sched/sch_netem.c b/net/sched/sch_netem.c
> index 9ca7947ab643..2dbe732ca135 100644
> --- a/net/sched/sch_netem.c
> +++ b/net/sched/sch_netem.c
> @@ -582,9 +582,6 @@ static struct sk_buff *netem_dequeue(struct Qdisc *sch)
>  	struct sk_buff *skb;
>  	struct rb_node *p;
>  
> -	if (qdisc_is_throttled(sch))
> -		return NULL;
> -
>  tfifo_dequeue:
>  	skb = __skb_dequeue(&sch->q);
>  	if (skb) {


Note that this commit (42117927cab5a13192ecc227bea19da5059ffc6c
"net_sched: netem: remove qdisc_is_throttled() use")
is a stable candidate, as it incidentally removes one long standing bug.

Namely, we were not calling qdisc_unthrottled() from netem enqueue(), so
we would be forced to wait a timer activation to be able to drain the
queue(s).

This matters with either a jitter, or a "tc qdisc change ... delay <new
delay>"
diff mbox

Patch

diff --git a/net/sched/sch_netem.c b/net/sched/sch_netem.c
index 9ca7947ab643..2dbe732ca135 100644
--- a/net/sched/sch_netem.c
+++ b/net/sched/sch_netem.c
@@ -582,9 +582,6 @@  static struct sk_buff *netem_dequeue(struct Qdisc *sch)
 	struct sk_buff *skb;
 	struct rb_node *p;
 
-	if (qdisc_is_throttled(sch))
-		return NULL;
-
 tfifo_dequeue:
 	skb = __skb_dequeue(&sch->q);
 	if (skb) {