[Olsr-users] High CPU utilization

Adam Wozniak (spam-protected)
Tue Mar 9 17:41:11 CET 2010


I sent this out a while ago, but got no response.  [ Sorry for the 
"patch-as-attachment", all the mail readers I'm allowed to use will 
whitespace damage the patch ]

Adam Wozniak wrote:
> Markus --
>
> See attached noalignfix.patch.  It allows olsrd 0.5.6-r6 to run 
> successfully on my ARM based Overo.
>
> The basic idea here was to change defs.h:
> #define ARM_NOWARN_ALIGN void *
> to
> #define ARM_NOWARN_ALIGN(x) ((void *)(x))
> and then change all uses of that macro accordingly.
>
> i.e. things like
> msg = (struct s_olsrmsg *)(ARM_NOWARN_ALIGN)&pck[*size];
> get changed to
> msg = (struct s_olsrmsg *)ARM_NOWARN_ALIGN(&pck[*size]);
>
> The hypothesis being that the old construct left us susceptible to 
> subtle alignment, size, and precedence problems.  I also had to 
> introduce another macro for the const case:
>
> #define ARM_NOWARN_CALIGN(x) ((const void *)(x))
> and change things like
> sig = (const struct s_olsrmsg *)(const ARM_NOWARN_ALIGN)&pck[packetsize];
> to
> sig = (const struct s_olsrmsg *)ARM_NOWARN_CALIGN(&pck[packetsize]);
>
>
> I have not tried this approach with the latest, but I think it should 
> work.  At the very least, I think this certainly points us in the 
> right direction.
>
> -- Adam
>
> Markus Kittenberger wrote:
>> the interesting part is that without them u have no problems to 
>> compile olsrd for your arm-platform,.. *G
>> (which afair was the same for me as i compiled olsrd for my amr board 
>> first time in autumn)
>>
>> Markus
>>
>> On Fri, Jan 29, 2010 at 2:21 AM, Adam Wozniak <(spam-protected) 
>> <mailto:(spam-protected)>> wrote:
>>
>>     The use of "ARM_NOWARN_ALIGN" is VERY suspicious.  Contrary to the
>>     comment in defs.h, the default linux kernel
>>     action for a misaligned read is NOT a bus error;  it is a silent
>>     ignore of the problem.
>>
>>     --Adam
>>
>>     Markus Kittenberger wrote:
>>
>>         hmm strange, i think since around this time we have "support"
>>         for armbased-android phones *G
>>
>>         i will test (this we) on an arm9 board aswell
>>
>>         regards Markus
>>
>>         On Thu, Jan 28, 2010 at 11:09 PM, Adam Wozniak
>>         <(spam-protected) <mailto:(spam-protected)>
>>         <mailto:(spam-protected) <mailto:(spam-protected)>>> 
>> wrote:
>>
>>            ARM: 0.5.6-r2, x86: 0.5.5 => good
>>            ARM: 0.5.6-r3, x86: 0.5.5 => good
>>            ARM: 0.5.6-r4, x86: 0.5.5 => good
>>            ARM: 0.5.6-r5, x86: 0.5.5 => good
>>            ARM: 0.5.6-r6, x86: 0.5.5 => bad
>>
>>            So I'd say the problem appeared on ARM, between 0.5.6-r5
>>         and 0.5.6-r6
>>
>>            --Adam
>>
>>            Adam Wozniak wrote:
>>            > Adam Wozniak wrote:
>>            >> Some tests are quicker / easier for me than others.
>>            >> ARM: 0.5.6-r8, x86: 0.5.6-r8 => bad
>>            >> ARM: 0.5.5, x86: 0.5.5 => good
>>            >> ARM: 0.5.5, x86: 0.5.6-r8 => good
>>            >>
>>            >> I'll try ramping up the ARM version later today.  I'll
>>         also try the
>>            >> obvious missing case from above.
>>            >>
>>            > ARM: 0.5.6-r6, x86: 0.5.6-r8 => bad
>>            > ARM: 0.5.6-r6, x86: 0.5.5 => bad
>>            >
>>            > It's starting to feel like the version on the x86 doesn't
>>         matter.
>>            >
>>
>>
>>            --
>>            Olsr-users mailing list
>>            (spam-protected)
>>         <mailto:(spam-protected)>
>>         <mailto:(spam-protected)
>>         <mailto:(spam-protected)>>
>>
>>            http://lists.olsr.org/mailman/listinfo/olsr-users
>>
>>
>>
>>
>

-------------- next part --------------
A non-text attachment was scrubbed...
Name: noalignfix.patch
Type: text/x-patch
Size: 32281 bytes
Desc: not available
URL: <http://lists.olsr.org/pipermail/olsr-users/attachments/20100309/adf06298/attachment.bin>


More information about the Olsr-users mailing list