FIX: 0.99L and timeouts
Bogdan Costescu
Bogdan.Costescu@IWR.Uni-Heidelberg.De
Fri Apr 14 11:54:59 2000
This message is in MIME format. The first part should be readable text,
while the remaining parts are likely unreadable without MIME-aware tools.
Send mail to mime@docserver.cac.washington.edu for more info.
---830399112-1207890389-955727642=:27258
Content-Type: TEXT/PLAIN; charset=US-ASCII
Sorry for the delay, I had some urgent things on my agenda...
On Tue, 11 Apr 2000, Andrew Morton wrote:
> Oh. I now understand your point. cur_tx == dirty_tx and tx_full == 1.
>
> I've looked and looked. I can't see a logic bug, SMP race or IRQ race
> which could cause this. I suggest you put some explicit code in various
> places to detect this condition and print something out, so we can
> identify it as near as poss to its cause. Odd.
I think I've got it and it's indeed a SMP race! First, I should mention
that I couldn't reproduce it running an UP kernel, but the conditions of
my test (CPU and network load) were perturbed by this, so it's not quite
100% safe.
OK, so the race is between the vortex_interrupt - DownComplete branch
(which is the only code updating vp->dirty_tx) and the end of
boomerang_start_xmit, after outw(DownStall) and retore_flags (which is the
only code setting vp->tx_full = 1).
There are in fact 2 cases (as shown by my log with TX_RING_SIZE=2, I only
thought of 1 of them !!!):
1. in vortex_interrupt, when tx_full == 1 and vp->cur_tx - dirty_tx >
TX_RING_SIZE - 1
(the first and third occurence in my log) vp->cur_tx = dirty_tx + 2 =>
vp->cur_tx - dirty_tx <= 1 is false, so vp->tx_full and dev->tbusy are not
cleared.
This happens when vp->cur_tx is incremented in boomerang_start_xmit about
the same time with vp->dirty_tx = dirty_tx in vortex_interrupt.
2. in boomerang_start_xmit, vp->cur_tx++ and the comparison is made and is
true (again vp->cur_tx = vp->dirty_tx + 2), but vp->tx_full is not yet
set, then in vortex_interrupt vp->dirty_tx is updated and vp->tx_full is 0
which means that vp->tx_full and dev->tbusy are not cleared, then back
into boomerang_start_xmit, vp->tx_full is set.
(the second occurence in my log)
The fix that I found is to move (in boomerang_start_xmit) the lines:
outw(DownUnstall, ioaddr + EL3_CMD);
restore_flags(flags);
after
vp->cur_tx++;
if (vp->cur_tx ....)
This way, the card will not be able to generate an interrupt before we
actually update vp->cur_tx and vp->tx_full.
I'm not using interrupt mitigation, so I don't know is this change has any
effect on cpu_to_le32(~TxIntrUploaded).
With this fix, I was not able to reproduce the timeouts any more.
By looking at the code, it seems like 0.99[M,N] have the same race, but I
was not able to get any of them to work upto now...
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
---830399112-1207890389-955727642=:27258
Content-Type: TEXT/PLAIN; charset=US-ASCII; name=log1
Content-Transfer-Encoding: BASE64
Content-ID: <Pine.LNX.4.10.10004141754020.27258@kenzo.iwr.uni-heidelberg.de>
Content-Description: log
Content-Disposition: attachment; filename=log1
QXByIDE0IDE1OjMzOjA0IG5vZGUwMDkga2VybmVsOiBldGgwOiBBZnRlciBE
b3duTGlzdFB0ciBmdWxsOiAwIGN1ciAxMTc5MyBkaXJ0eSAxMTc5Mi4gDQpB
cHIgMTQgMTU6MzM6MDQgbm9kZTAwOSBrZXJuZWw6IGV0aDA6IEFmdGVyIERv
d25VbnN0YWxsIGZ1bGw6IDAgY3VyIDExNzkzIGRpcnR5IDExNzkyLiANCkFw
ciAxNCAxNTozMzowNCBub2RlMDA5IGtlcm5lbDogZXRoMDogQWZ0ZXIgcmVz
dG9yZV9mbGFncyBmdWxsOiAwIGN1ciAxMTc5MyBkaXJ0eSAxMTc5Mi4gDQpB
cHIgMTQgMTU6MzM6MDQgbm9kZTAwOSBrZXJuZWw6IGV0aDA6IEFmdGVyIGN1
cl90eCsrIGZ1bGw6IDAgY3VyIDExNzk0IGRpcnR5IDExNzkzLiANCkFwciAx
NCAxNTozMzowNCBub2RlMDA5IGtlcm5lbDogZXRoMDogQWZ0ZXIgaWYgZnVs
bDogMCBjdXIgMTE3OTQgZGlydHkgMT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IyOS4gDQpBcHIgMTQgMTU6
MzM6MzMgbm9kZTAwOSBrZXJuZWw6IGV0aDA6IEFmdGVyIHJlc3RvcmVfZmxh
Z3MgZnVsbDogMCBjdXIgMjMyMjkgZGlydHkgMjMyMjkuIA0KQXByIDE0IDE1
OjMzOjMzIG5vZGUwMDkga2VybmVsOiBldGgwOiBBZnRlciBjdXJfdHgrKyBm
dWxsOiAwIGN1ciAyMzIzMCBkaXJ0eSAyMzIyOS4gDQpBcHIgMTQgMTU6MzM6
MzMgbm9kZTAwOSBrZXJuZWw6IGV0aDA6IEFmdGVyIGlmIGZ1bGw6IDAgY3Vy
IDIzMjMwIGRpcnR5IDIzMjI5LiANCg==
---830399112-1207890389-955727642=:27258--
-------------------------------------------------------------------
To unsubscribe send a message body containing "unsubscribe"
to linux-vortex-bug-request@beowulf.org