* Do_ade @ 2009-12-21 8:47 hermit 2009-12-23 0:41 ` Do_ade David VomLehn 0 siblings, 1 reply; 5+ messages in thread From: hermit @ 2009-12-21 8:47 UTC (permalink / raw) To: linux-mips 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? Thanks! -- View this message in context: http://old.nabble.com/Do_ade-tp26871250p26871250.html Sent from the linux-mips main mailing list archive at Nabble.com. ^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: Do_ade 2009-12-21 8:47 Do_ade hermit @ 2009-12-23 0:41 ` David VomLehn 2009-12-23 10:42 ` Do_ade hermit 0 siblings, 1 reply; 5+ messages in thread From: David VomLehn @ 2009-12-23 0:41 UTC (permalink / raw) To: hermit; +Cc: linux-mips 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? > Thanks! > -- > View this message in context: http://old.nabble.com/Do_ade-tp26871250p26871250.html > 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 /proc/sys/debug/mips/unaligned_action, i.e. echo 0 >/proc/sys/debug/mips/unaligned_action. -- David VL ^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: Do_ade 2009-12-23 0:41 ` Do_ade David VomLehn @ 2009-12-23 10:42 ` hermit 2009-12-23 12:40 ` Do_ade Ralf Baechle 0 siblings, 1 reply; 5+ messages in thread From: hermit @ 2009-12-23 10:42 UTC (permalink / raw) To: linux-mips David Thanks! My GCC version is 4.2.3. it seems that it is not too old. I believe there is bad pointer arithmetic. Here is the do_ade print: do_ade, 542 address error exception occurs! MediaPlayerServ(pid:839) (a0 == 7edff5b6 a1 == 302daaca a2 == 00000002 a3 == 302daaca) (gp == 302e2730 sp == 7edff578 t9 == 2afb4640) (epc == 302c3250, ra == 302c3388) Suppose we can find which function cause "bad pointer arithmetic". I am new to MIPS, anybody can tell me how i can find the function? Thanks! BGs/Hermit David VomLehn (dvomlehn) wrote: > > 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? >> Thanks! >> -- >> View this message in context: >> http://old.nabble.com/Do_ade-tp26871250p26871250.html >> 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 > /proc/sys/debug/mips/unaligned_action, i.e. > echo 0 >/proc/sys/debug/mips/unaligned_action. > > -- > David VL > > > -- View this message in context: http://old.nabble.com/Do_ade-tp26871250p26897656.html Sent from the linux-mips main mailing list archive at Nabble.com. ^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: Do_ade 2009-12-23 10:42 ` Do_ade hermit @ 2009-12-23 12:40 ` Ralf Baechle 2009-12-23 18:15 ` Do_ade David VomLehn 0 siblings, 1 reply; 5+ messages in thread From: Ralf Baechle @ 2009-12-23 12:40 UTC (permalink / raw) To: hermit; +Cc: linux-mips On Wed, Dec 23, 2009 at 02:42:48AM -0800, hermit wrote: > My GCC version is 4.2.3. it seems that it is not too old. I believe > there is bad pointer arithmetic. > Here is the do_ade print: > do_ade, 542 address error exception occurs! MediaPlayerServ(pid:839) > (a0 == 7edff5b6 a1 == 302daaca a2 == 00000002 a3 == 302daaca) > (gp == 302e2730 sp == 7edff578 t9 == 2afb4640) > (epc == 302c3250, ra == 302c3388) > Suppose we can find which function cause "bad pointer arithmetic". > I am new to MIPS, anybody can tell me how i can find the function? > Thanks! This is not the normal kernel printout. It would seem that somebody who didn't know about the existence of the logging code added this code. The number 542 presumably is a line number and do_ade is in arch/mips/kernel/unaligned.c. So look around line 542 in that file. Ralf ^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: Do_ade 2009-12-23 12:40 ` Do_ade Ralf Baechle @ 2009-12-23 18:15 ` David VomLehn 0 siblings, 0 replies; 5+ messages in thread From: David VomLehn @ 2009-12-23 18:15 UTC (permalink / raw) To: Ralf Baechle; +Cc: hermit, linux-mips On Wed, Dec 23, 2009 at 06:40:29AM -0600, Ralf Baechle wrote: > On Wed, Dec 23, 2009 at 02:42:48AM -0800, hermit wrote: > > > My GCC version is 4.2.3. it seems that it is not too old. I believe > > there is bad pointer arithmetic. > > Here is the do_ade print: > > do_ade, 542 address error exception occurs! MediaPlayerServ(pid:839) > > (a0 == 7edff5b6 a1 == 302daaca a2 == 00000002 a3 == 302daaca) > > (gp == 302e2730 sp == 7edff578 t9 == 2afb4640) > > (epc == 302c3250, ra == 302c3388) > > Suppose we can find which function cause "bad pointer arithmetic". > > I am new to MIPS, anybody can tell me how i can find the function? > > Thanks! > > This is not the normal kernel printout. It would seem that somebody who > didn't know about the existence of the logging code added this code. The > number 542 presumably is a line number and do_ade is in > arch/mips/kernel/unaligned.c. So look around line 542 in that file. If I understand hermit's problem, knowing the line in unaligned.c won't help much since the problem appears to be in the application MediaPayerServ. My suggestion is to use addr2line on the location where the exception occurred, which is the EPC value 302c3250. The addr2line utility can be used on the unstripped version of the userspace executable to determine the function, file, and line number where the unaligned access was made. > Ralf -- David VL ^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2009-12-23 18:16 UTC | newest] Thread overview: 5+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- 2009-12-21 8:47 Do_ade hermit 2009-12-23 0:41 ` Do_ade David VomLehn 2009-12-23 10:42 ` Do_ade hermit 2009-12-23 12:40 ` Do_ade Ralf Baechle 2009-12-23 18:15 ` Do_ade David VomLehn
This is an external index of several public inboxes, see mirroring instructions on how to clone and mirror all data and code used by this external index.