Skip to contentSkip to conversation

code 28 trap

parisc-linux John Marvin 2 participants 2 messages Feb 26, 2000

lore
Share & tools
lore
#0 lore raw
Quoted 6 lines
Quoted 3 lines

http://boudicca.tux.org/hypermail/linux-kernel/2000week06/0092.html

There was a bug in 2.3.41, looks like it didn't get fixed in .42, that

Apparently it did get fixed in .42, so it might be worth finding out what exactly causes Grant's unaligned trap.

I'm running on a J5000, which is 99.9% the same as a C3000 if I disable one of the processors. The only networking problem I've run into is the one I already posted about, for which I have a workaround. I have not run into any unaligned traps.

I also do not believe we should do an unaligned trap handler at this point. Yes, we may have to do one for the non-standard protocols, but the problem is that once we enable the trap handler, you might hide a bunch of other performance degrading bugs.

In fact, I would propose that when we do the unaligned handler we should have a way of enabling it on a per thread basis for user processes. When I say "enable" I don't mean that we would install/deinstall the handler, but simply have the handler do a check, and if the fault came from user space, check the task structure to determine whether we should fix the fault or terminate the process with a signal.

I believe that the default should be off. If a user doesn't want to fix the problem (either due to indifference or lack of source), they should explicitly enable the handler (perhaps by a flag bit in the elf executable?) so that they know that they will be suffering a performance penalty.

Of course, I'd like to do something similar for kernel unaligned faults, i.e. only handle faults for areas where we expect them, but that is probably not worth the effort. Handling kernel unaligned faults should be configurable, possibly with the default on. We of course should leave it off during development, unless we are testing areas of the kernel that are known to produce unaligned faults, i.e. ones we have decided not to fix, e.g. some of the networking protocols. One possible thing we could do would be to enable the unaligned handler by default, but have it log a message for the first kernel fault it handles, e.g. "Unaligned fault at 0xxxx, enabling unaligned fault handler", so at least people can be made aware that there may be a performance issue.

My overall objective in all of this is to insure that we know of all the cases where the kernel produces unaligned faults, and make a conscious decision on whether or not we fix the code, rather than hide unaligned references. My personal bias is to fix every piece of code that produces unaligned references, but, based on the linux-kernel thread that willy mentioned, we might not be able to convince the maintainer of the code to accept those changes.

John Marvin
[email protected]

#1 lore raw
Quoted 4 lines

I'm running on a J5000, which is 99.9% the same as a C3000 if I disable one of the processors. The only networking problem I've run into is the one I already posted about, for which I have a workaround. I have not run into any unaligned traps.

This is another hint that Grant's unaligned trap probably is not network- related (it might be the network device driver's fault).

Quoted 4 lines

I also do not believe we should do an unaligned trap handler at this point. Yes, we may have to do one for the non-standard protocols, but the problem is that once we enable the trap handler, you might hide a bunch of other performance degrading bugs.

I agree.

Quoted 6 lines

In fact, I would propose that when we do the unaligned handler we should have a way of enabling it on a per thread basis for user processes. When I say "enable" I don't mean that we would install/deinstall the handler, but simply have the handler do a check, and if the fault came from user space, check the task structure to determine whether we should fix the fault or terminate the process with a signal.

Emulating user space unaligned accesses sounds like a bad idea to me, unless existing applications assume they can do unaligned accesses and let the OS handle it. (and preload a SIGBUS handler for those userspace applications that want it)

Quoted 5 lines

I believe that the default should be off. If a user doesn't want to fix the problem (either due to indifference or lack of source), they should explicitly enable the handler (perhaps by a flag bit in the elf executable?) so that they know that they will be suffering a performance penalty.

LD_PRELOAD is a nicer way to handle that, isn't it ?

Quoted 1 line

Of course, I'd like to do something similar for kernel unaligned faults,

First, let's try whether we run into unaligned faults in cases other than the one we know (weird, badly-designed protocols).

Quoted 2 lines

Handling kernel unaligned faults should be configurable, possibly with the default on.

I disagree. Either we accept we will have unaligned accesses, so disabling them would just generate bogus bug reports; or we don't, then we want to see all bug reports caused by them.

Quoted 7 lines

My overall objective in all of this is to insure that we know of all the cases where the kernel produces unaligned faults, and make a conscious decision on whether or not we fix the code, rather than hide unaligned references. My personal bias is to fix every piece of code that produces unaligned references, but, based on the linux-kernel thread that willy mentioned, we might not be able to convince the maintainer of the code to accept those changes.

Just wait until they see the light ... we can fix networking in our tree should it bother us.

Philipp Rumpf