RE: [PATCH take 2] pkt_sched: Fix qdisc_watchdog() vs. dev_deactivate() race
From: Duyck, Alexander H <hidden>
Date: 2008-09-15 23:44:22
Jarek Poplawski wrote:
On Mon, Sep 15, 2008 at 07:20:08AM +0000, Jarek Poplawski wrote: ...quoted
Of course preserving a flow consistency is must-be here, but I think there are rehashing algorithms used in similar cases (sch_sfq) which take care for this. As a matter of fact, I've thought of requeuing as a best place to detect possible problems, but now I see that Alexander's proposal let's to do this simply by observing this TCQ_F_STOPPED flag [...]Hmm... or maybe it doesn't? Since this is qdisc flag we don't know at the top which tx_queue is a problem at the bottom...
The problem is with the nature of a qdisc. For example let's say we have a prio qdisc with a packet in lowest priority that fails to be transmitted due to a stopped subqueue. If we add an skb for a non-stopped queue to a higher prio then the qdisc should be no longer stopped since we can dequeue from the ring and transmit. Thus, keeping a memory of which queue is stopped may not be useful in a situation such as this. The only thing I really prefer about my solution as opposed to the solution Dave implemented was that it would mean only one dequeue instead of a peek followed by a dequeue. I figure the important thing is to push the discovery of us being stopped to as soon as possible in the process. It will probably be a few days before I have a patch with my approach ready. I didn't realize how complex it would be to resolve this issue for CBQ, HTB, HFSC, etc. Also it is starting to look like I will probably need to implement another function to support this since it seems like the dequeue operations would need to be split into a multiqueue safe version, and a standard version to support some workarounds like those found in qdisc_peek_len() for HFSC. Thanks, Alex