On Mon, Dec 21, 2009 at 02:47:22AM -0600, hermit wrote:
> We are trying to run WEBkit on MIPS 24ke system.
> we found a lot of "do_ade" print. but system doesn't crash.
> because of do_ade print, the system performance seems poor.
> I wonder if there is any compile flag can remove do_ade warning?
> View this message in context:
> Sent from the linux-mips main mailing list archive at Nabble.com.
If you get messages from do_ade(), it means that your application is
accessing data that is not aligned on a boundary that is a multiple
of the size of the data. Accessing such unaligned data causes an exception
that one would typically expect to kill your process. Fortunately, or
unfortunately, depending on your view, the code that handles this exception
can be configured to do one of three things:
o Send a SIGBUS signal to your process, which generally kills it
o Print a message and then emulate the unaligned load or store
o Silently emulate the unaligned load or store
It sounds like your system is configured for the print and emulate option.
The emulation is quite a bit slower than a simple aligned load or store,
so I am not surprised you are seeing noticable performance impact. The warning
may be impacting your performance as it is printed sychronously, but even
if you silence the warning, your performance will suffer.
There are various ways that you can get unaligned accesses. One is to have
code that does bad pointer arithmetic. Another possiblity, one that I
encountered recently, is to have a bad gcc. IIRC gcc 4.1.0 had this problem.
Upgrading the version of gcc caused the problem to go away, but it wasn't
really clear what bug fix did the job. Anyway, I know that verson 4.3.2
works as you would expect.
I strongly recommend, if you have an older gcc, that you upgrade. An
instruction emulated through exception handling can easily be a hundred times
slower than that instruction operating on aligned data. If, however, you
really only want to quiet the warning, you must first mount the debugfs
filesystem: "mount -t debugfs debug /proc/sys/debug". Then write a zero to
echo 0 >/proc/sys/debug/mips/unaligned_action.