Hi Jamal,

J Hadi Salim <[EMAIL PROTECTED]> wrote on 05/09/2007 09:22:44 PM:

> > Since I am holding a lock in these two changed areas till I return
> > back to __qdisc_run (which clears the RUNNING bit) and then drop the
> > lock, there is no way packets can be on the queue while I falsely
> > return 0, or no packets on the queue while I falsely return -1.
>
> If you relinquish yourself from being a dequeuer by letting go of
> RUNNING then it is possible during that short window one of the other
> N-1 CPUs could have been enqueueing; that packet will never be dequeued
> unless a new packet shows up some X amount of time later.

But RUNNING is never relinquished till all the way back out to
__qdisc_run. Only the lock is dropped before calling xmit and
re-got after xmit is finished (all the while holding RUNNING).
After xmit both queue_lock and RUNNING are held. If some other
cpu enqueue'd during this release window (and they would have
returned after dropping the lock as they are pure enqueuer's),
qdisc_restart will find those skbs. Similarly if no skbs were
added, qdisc_restart will return 0.

Thanks,

- KK

> I hope what i described above helps. Off for about a day. CCing Herbert
> who last made changes to that area incase i missed something ..
>
> cheers,
> jamal
>
> PS:- Please dont use my temporary gmail account to respond; a reply-to
> will pick the right address (@cyberus.ca).
>

-
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to