Subject: Re: [PATCH]: Schedule correct qdisc in watchdog.

From: Jarek Poplawski <[email-masked]>
Date: Mon, 18 Aug 2008 09:10:12 +0000

On Mon, Aug 18, 2008 at 01:39:54AM -0700, David Miller wrote:
> 
> Jarek, I bet this is what was causing the crash you were trying to fix
> yesterday.
> 
> But that's just my newbie hunch :-)

Yes, this was one of the reasons, but not the only one, and my oldbie
version of this fix could be found here as "02-fix1.patch":

http://permalink.gmane.org/gmane.linux.network/103039

It's a bit different, because I think wd->qdisc can probably
point to the noop_qdisc (if it's the root qdisc).

Anyway this kind of change is necessary here, and everywhere where
netif_schedule() could be called (I've found sch_cbq.c only).

Jarek P.

> 
> pkt_sched: Never scheduler non-root qdiscs.
> 
> The qdisc watchdogs can be attached to any qdisc,
> not just the root, so make sure we schedule the
> correct one.
> 
> Signed-off-by: David S. Miller <[email-masked]>
> 
> diff --git a/net/sched/sch_api.c b/net/sched/sch_api.c
> index c8dc72e..98c0084 100644
> --- a/net/sched/sch_api.c
> +++ b/net/sched/sch_api.c
> @@ -426,7 +426,7 @@ static enum hrtimer_restart qdisc_watchdog(struct hrtimer *timer)
>  
>  	wd->qdisc->flags &= ~TCQ_F_THROTTLED;
>  	smp_wmb();
> -	__netif_schedule(wd->qdisc);
> +	__netif_schedule(qdisc_root(wd->qdisc));
>  
>  	return HRTIMER_NORESTART;
>  }