netdev
[Top] [All Lists]

Re: tx_timeout and timer serialisation

To: andrewm@xxxxxxxxxx (Andrew Morton)
Subject: Re: tx_timeout and timer serialisation
From: kuznet@xxxxxxxxxxxxx
Date: Mon, 1 May 2000 21:14:13 +0400 (MSK DST)
Cc: netdev@xxxxxxxxxxx
In-reply-to: <390DA08D.8979B5B7@xxxxxxxxxx> from "Andrew Morton" at May 1, 0 08:13:07 pm
Sender: owner-netdev@xxxxxxxxxxx
Hello!

> These three functions can potentially tread upon each others toes and
> hence need serialisation.

tx_timeout and hard_start_xmit are serialized by core and never overlap.

The way, how driver protects itself of its own internal events,
(media selection timer in this case) is its own internal problem.
No super-locks exist. If media selection does not affect
RX logic, you may use dev->xmit_lock (that one which serializes
tx_timeout and hard_start_xmit). If some dependencies between
RX and TX exist, than core can do nothing to help you
and you have to use an internal lock.

> In 2.2: same question.

In 2.2 super-lock exists, which serializes _all_ the networking,
timers etc. etc. etc. hard_start_xmit is called only under this
super-lock, so that there is nothing to be bothered about.
Well, except for exiting this dangerous part of code so fastly
as it is possible to allow OS to proceed. 8)


> Am I correct in believing that in 2.2, BH handlers were serialised wrt
> SMP, but that in 2.3 they are not?

Actually, "BHs" are serialized exactly as they were in 2.2.
Only networking does not use these BHs more, exactly because they
are serialized and we do not want this.

Timers are still globally serialized and do not overlap.
But you can honestly assume that they are serialized only locally
to cpu too, the life will be only simpler. It is from experience. 8)
At least, the rest of networking do not assume any global synchronization.

Alexey

<Prev in Thread] Current Thread [Next in Thread>