FIX: 0.99L and timeouts

Bogdan Costescu Bogdan.Costescu@IWR.Uni-Heidelberg.De
Tue Apr 18 14:29:56 2000


On Sun, 16 Apr 2000, Andrew Morton wrote:

> >From my reading, what must be happening is: ...
> Eventually, vortex_tx_timeout() will be invoked by the higher layers and
> will clear tx_full.  Is that what you're seeing?

As I wrote in my previous message, there are 2 cases (or races) depending
on which variable is updated/tested. In one case it's tx_full (which is
the one described by you), in the other case is cur_tx.

> So it's an IRQ race, not an SMP race.  Could conceivably happen on
> uniprocessor. Can only happen if max_interrupt_work is greater than
> TX_RING_SIZE.

I was only able to reproduce it with SMP because the 2 pieces of code
which deal with updating/testing the variables are executed simultaneously
on different CPUs. The way you described it... well, I think it's possible
even with UP.
I don't quite agree with the max_interrupt_work statement: the Tx ring is
emptied in a small 'while' loop on the DownComplete branch independent on
the big 'do' loop which is there for RxComplete and counts for
max_interrupt_work. You can go through the interrupt only once (so
max_interrupt_work must be at least 1) and empty even a full Tx ring.

> [ And I have a bad feeling that vortex_tx_timeout is racy wrt several
> other functions.  Sigh ].

I haven't looked into this, but if I don't get Tx timeouts anymore how can
test the races? 8-)

> Note that my patch uses conventional spinlocking and removes the cli()
> call from vortex_start_xmit().  cli() is a truly horrid thing on SMP. It
> sends an interprocessor interrupt to all other CPUs, waits for them
> _all_ to be lined up and listening and then issues commands to them. 
> This removal is a plus against the spinlocks' minus. If you can try out
> my patched driver I'd be interested in hearing about any performance
> impressions.

I thought of this too, but I have little experience with kernel
programming and not so much time... I'll come back with performance
impressions in few days.

Sincerely,

Bogdan Costescu

IWR - Interdisziplinaeres Zentrum fuer Wissenschaftliches Rechnen
Universitaet Heidelberg, INF 368, D-69120 Heidelberg, GERMANY
Telephone: +49 6221 54 8869, Telefax: +49 6221 54 8868
E-mail: Bogdan.Costescu@IWR.Uni-Heidelberg.De

-------------------------------------------------------------------
To unsubscribe send a message body containing "unsubscribe"
to linux-vortex-bug-request@beowulf.org