* Random floating point exceptions and interrupt handler re-entry
@ 1998-05-15 19:29 Christian Worley
1998-05-16 10:30 ` Andreas Johansson
0 siblings, 1 reply; 3+ messages in thread
From: Christian Worley @ 1998-05-15 19:29 UTC (permalink / raw)
To: axp-list@redhat.com; +Cc: Donald Becker, maddog
I'm trying to port the Packet Engines "Gigabit Ethernet" card to
AXP/Linux, using Donald Becker's "yellowfin" driver for this card.
The problems I'm having don't seem to be related to the driver, I've
been up and down it's code which looks good (but I don't know the
assumptions of the board itself):
1) Programs with lots of floating point code die randomly with
floating point exceptions when the network is at peak load (running
netperfs and such).
2) The interrupt handlers, in general, seem to be getting re-entered,
even though interrupts are disabled.
3) The yellowfin drivers stops responding, and needs to be
rmmod/insmod to get it going again.
So, starting off with an explanation of "1)", above:
I can transmit UDP packets (using netperf as a test) all night long
from an Alpha to an Intel (both with yellowfin boards), without any
problems.
If I run TCP tests, or receive UDP packets (via netperf) on an Alpha,
then this will run all night long too... as long as I don't start up
other programs. With other programs running, they die randomly (at
many places within their code) with floating point exceptions.
Without a yellowfin card, these programs run without error.
I saw something similar once, running VxWorks on an Axp, where you had
to set a mask of the register sets to be swapped with a thread you
were invoking. If the thread had FP calculations, and you didn't set
the flag that indicated "swap the FP registers", then under high load,
the task would swap out in the middle of an FP operation, the FP regs
wouldn't be swapped out, when the task was swapped back in, the FP
unit had to deal with whatever junk was in the FP registers in the
middle of an operation, and the thread would often throw a FP
exception from a random (different every time) program location.
Then again, we are dealing with a bus-mastering device, which could
write to any memory location without getting trapped, and it could
just be randomly bombing memory.
Any ideas on what is causing this? Anybody know how the kernel swaps
FP regs with a task?
On to "2)", above:
I see this with or without the yellowfin card. I've instrumented the
kernel in linux/arch/alpha/kernel/irq.c, the routine
"cabriolet_and_eb66p_device_interrupt" such that it has the basic
structure:
struct pt_regs
* regs)
{
unsigned long flags;
static int reentry=0;
save_flags(flags);
cli();
if (reentry) {
printk("Reentry detected\n");
}
reentry = 1;
/* the body of the code */
reentry = 0;
restore_flags(flags);
}
The "reentry" flag should never be found to be set. But it is. I've
found drivers erroneously using "sti()" (which raises the IPL to user
level) in the middle of an interrupt routine. Replacing their "sti"
with the flag save and restore has removed problems with these
drivers.
But, when I look thru the kernel source, there's probably about 50
files still using "sti" (mostly disk and net drivers). In the network
core code, I modified about 20 files to "do it right". Of these,
"route.c" and "af_inet.c" had some pretty strange "sti's" in them, and
I had to leave them the way they were for the machine to boot properly
(there was one "sti" with no corresponding "cli").
Anyway, these changes didn't make any difference. I still see
"Reentry detected" occasionally, mostly when X is starting and when I
reload the yellowfin driver.
When is it appropriate to call "sti" on an Alpha? When is it
appropriate to re-enter the above routine?
On to point "3)", above:
When I'm running Netperf's "netserver", receiving UDP packets from an
Intel host across a yellowfin driver, when I increase the system load
(i.e. start running many continuously calculating FFT's, that
occasionally have random FP exceptions), the netperf transfers stop
and don't restart. The sender eventually times out saying it lost
contact with the receiver.
At this point, I can't ping into or out of the AXP system.
If I remove the yellowfin module, then reinstall it, the
communications start back up (without restarting Netperf's "netserver"
or the sender on the Intel side). The Yellowfin driver is supposed to
timeout and restart itself if it goes too long without receiving a
packet. This timeout code is not getting called.
Either the yellowfin thinks it's OK, or the timeout mechanism isn't
working.
Any ideas on how to debug this?
I'm running RedHat 5.0 (Kernel rev 2.0.30), using the egcs 1.0
compiler, on a Digital PC164, 500MHZ, 128MB RAM.
Thanks,
Chris
--
When I die, please cast my ashes upon Bill Gates
--for once, let him clean up after me!
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: Random floating point exceptions and interrupt handler re-entry
1998-05-15 19:29 Random floating point exceptions and interrupt handler re-entry Christian Worley
@ 1998-05-16 10:30 ` Andreas Johansson
1998-05-16 20:06 ` Chris Worley
0 siblings, 1 reply; 3+ messages in thread
From: Andreas Johansson @ 1998-05-16 10:30 UTC (permalink / raw)
To: Red Hat Alpha mailing list
On Fri, 15 May 1998, Christian Worley wrote:
> 1) Programs with lots of floating point code die randomly with
> floating point exceptions when the network is at peak load (running
> netperfs and such).
I instantly recognize this problem from my own driver hacking. Have you
compiled your driver with the -mno-fp-regs flag? Otherwise gcc will
sometimes use fp registers for move purposes to save integer registers.
The kernel does NOT save the floting point registers when enterred (e.g.
for an interrupt), so it it is reqired that all objects/modules in the
kernel are NOT using fp-regs at all.
> 2) The interrupt handlers, in general, seem to be getting re-entered,
> even though interrupts are disabled.
>
> 3) The yellowfin drivers stops responding, and needs to be
> rmmod/insmod to get it going again.
Sorry, I can't help you with the other problems.
/Andreas
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: Random floating point exceptions and interrupt handler re-entry
1998-05-16 10:30 ` Andreas Johansson
@ 1998-05-16 20:06 ` Chris Worley
0 siblings, 0 replies; 3+ messages in thread
From: Chris Worley @ 1998-05-16 20:06 UTC (permalink / raw)
To: Andreas Johansson, axp-list
Andreas Johansson wrote:
>
> On Fri, 15 May 1998, Christian Worley wrote:
>
> > 1) Programs with lots of floating point code die randomly with
> > floating point exceptions when the network is at peak load (running
> > netperfs and such).
>
> I instantly recognize this problem from my own driver hacking. Have you
> compiled your driver with the -mno-fp-regs flag? Otherwise gcc will
> sometimes use fp registers for move purposes to save integer registers.
> The kernel does NOT save the floting point registers when enterred (e.g.
> for an interrupt), so it it is reqired that all objects/modules in the
> kernel are NOT using fp-regs at all.
>
Great. That was it. Thanks!
Chris
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~1998-05-16 20:01 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
1998-05-15 19:29 Random floating point exceptions and interrupt handler re-entry Christian Worley
1998-05-16 10:30 ` Andreas Johansson
1998-05-16 20:06 ` Chris Worley
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox