Changing the page attributes

Mulyadi Santosa mulyadi.santosa at gmail.com
Wed Jul 11 08:10:31 EDT 2012


Hi Arun... :)

On Wed, Jul 11, 2012 at 6:01 PM, Arun KS <getarunks at gmail.com> wrote:
> I went ahead and made my __log_buf size to 1MB.
> But the memory is not aligned to 1MB boundary. Here is what system.map shows.
>
> c08ac400 b __warned.32427
> c08ac404 b __log_buf
> c09ac404 B console_set_on_cmdline
> c09ac408 b idle_notifier
> c09ac40c B sys_tz
>
> so __log_buf resides in two 1M sections in parts and it needs two PTEs.
>
> Then I added __aligned__(1024*1024) attribute to __log_buf array.
> This time compiler error  "Error: alignment too large: 15 assumed"
>
> But  __aligned_(32*1024) is working fine as below
>
> c08b84c0 b __warned.32427
> c08c0000 b __log_buf
> c09c0000 B console_set_on_cmdline
> c09c8000 b idle_notifier
> c09c8004 B sys_tz
>
> Is it not possible to align more than 32KB?
> Any pointers?

when you said alignment, I quickly google and found this gcc page:
http://gcc.gnu.org/onlinedocs/gcc-3.2/gcc/Type-Attributes.html

to be honest, what went wrong here.... I guessed you need to check the
linker script...maybe something must be changed there.

-- 
regards,

Mulyadi Santosa
Freelance Linux trainer and consultant

blog: the-hydra.blogspot.com
training: mulyaditraining.blogspot.com



More information about the Kernelnewbies mailing list