why /proc/cpu/alignment set to 4 from init.rc

1,182 views
Skip to first unread message

Shivdas

unread,
Jun 27, 2009, 5:08:46 AM6/27/09
to Android Linux Kernel Development
Hi Android kernel developers,

I have a OMAP3 Beagleboard [ARMv7], and android works pretty fine with
it. As Android's base chipset is MSM7200 which is ARMv6.
Now coming to the point, I came to know that kernels after 2.6.28-rc6
[Ref. 1], supports "Alignment trap" handling for chipsets after ARMv6.
So if I boot my Beagleboard without android[busybox RFS] it has /proc/
cpu/alignment set to as 2[fixup] as default. i.e. enables unaligned
memory handling.
But if I boot BeagleBoard with Android, Android sets /proc/cpu/
alignment as 4[signal] i.e. set by init.rc (write /proc/cpu/alignment
4)

So can I know why google overwrites it as 4. i.e. signal kill if
alignment trap occurs.
Forgive me, if I misunderstood anything. Your help may clear my doubt.

Does default 2 degrades android performance hence it is set to 4?

Regards,
Shivdas

[1]
http://git.kernel.org/?p=linux/kernel/git/torvalds/linux-2.6.git;a=blobdiff;f=arch/arm/mm/alignment.c;h=2d5884ce0435fb436a57bee6d314284b9101e87e;hp=133e65d166b315b0e54aba959846a162643bc927;hb=baa745a3378046ca1c5477495df6ccbec7690428;hpb=794baba637999b81aa40e60fae1fa91978e08808

Shivdas Gujare

unread,
Jul 2, 2009, 3:26:33 PM7/2/09
to Android Linux Kernel Development
Hi Does anyone has an Idea?

Thanks for your help.

regards,
Shivdas

San Mehat

unread,
Jul 2, 2009, 3:36:27 PM7/2/09
to android...@googlegroups.com
On Sat, Jun 27, 2009 at 2:08 AM, Shivdas <shivda...@gmail.com> wrote:

Hi Android kernel developers,

I have a OMAP3 Beagleboard [ARMv7], and android works pretty fine with
it. As Android's base chipset is MSM7200 which is ARMv6.
Now coming to the point, I came to know that kernels after 2.6.28-rc6
[Ref. 1], supports "Alignment trap" handling for chipsets after ARMv6.
So if I boot my Beagleboard without android[busybox RFS] it has /proc/
cpu/alignment set to as 2[fixup] as default. i.e. enables unaligned
memory handling.
But if I boot BeagleBoard with Android, Android sets /proc/cpu/
alignment as 4[signal] i.e. set by init.rc (write /proc/cpu/alignment
4)

So can I know why google overwrites it as 4. i.e. signal kill if
alignment trap occurs.
Forgive me, if I misunderstood anything. Your help may clear my doubt. 

Does default 2 degrades android performance hence it is set to 4?

Yes, handling alignment traps is expensive. If you have code that is doing misaligned 32 bit accesses, its broken and should be fixed.



--
----------
San Mehat
Staff Software Engineer
Google Inc.
o: 650-253-7422
c: 408-382-1249
s...@google.com
Reply all
Reply to author
Forward
0 new messages