All of lore.kernel.org
 help / color / mirror / Atom feed
* Changing the page attributes
@ 2012-07-10 11:51 Arun KS
  2012-07-10 16:12 ` Mulyadi Santosa
  0 siblings, 1 reply; 6+ messages in thread
From: Arun KS @ 2012-07-10 11:51 UTC (permalink / raw)
  To: kernelnewbies

Hello Experts,

I have a requirement to change __log_buf memory(kernel printk buffer)
as non cacheable memory.
How can I change the page attributes for changing cache policy to non cacheable?

Any pointers will be helpful.

Thanks,
Arun

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Changing the page attributes
  2012-07-10 11:51 Changing the page attributes Arun KS
@ 2012-07-10 16:12 ` Mulyadi Santosa
  2012-07-10 16:39   ` rohan puri
  2012-07-11  6:34   ` Arun KS
  0 siblings, 2 replies; 6+ messages in thread
From: Mulyadi Santosa @ 2012-07-10 16:12 UTC (permalink / raw)
  To: kernelnewbies

Hi..

On Tue, Jul 10, 2012 at 6:51 PM, Arun KS <getarunks@gmail.com> wrote:
> Hello Experts,
>
> I have a requirement to change __log_buf memory(kernel printk buffer)
> as non cacheable memory.
> How can I change the page attributes for changing cache policy to non cacheable?

I just can give short clue. I think somehow you must find its PTE
entry...there, IIRC there is page attribute that can be changed to
make it uncacheable.

cross check the Intel processor manual for further clarification (if
it's indeed x86 arch)

-- 
regards,

Mulyadi Santosa
Freelance Linux trainer and consultant

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

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Changing the page attributes
  2012-07-10 16:12 ` Mulyadi Santosa
@ 2012-07-10 16:39   ` rohan puri
  2012-07-11  6:34   ` Arun KS
  1 sibling, 0 replies; 6+ messages in thread
From: rohan puri @ 2012-07-10 16:39 UTC (permalink / raw)
  To: kernelnewbies

On Tue, Jul 10, 2012 at 9:42 PM, Mulyadi Santosa
<mulyadi.santosa@gmail.com>wrote:

> Hi..
>
> On Tue, Jul 10, 2012 at 6:51 PM, Arun KS <getarunks@gmail.com> wrote:
> > Hello Experts,
> >
> > I have a requirement to change __log_buf memory(kernel printk buffer)
> > as non cacheable memory.
> > How can I change the page attributes for changing cache policy to non
> cacheable?
>
> I just can give short clue. I think somehow you must find its PTE
> entry...there, IIRC there is page attribute that can be changed to
> make it uncacheable.
>
> cross check the Intel processor manual for further clarification (if
> it's indeed x86 arch)
>
> --
> regards,
>
> Mulyadi Santosa
> Freelance Linux trainer and consultant
>
> blog: the-hydra.blogspot.com
> training: mulyaditraining.blogspot.com
>
> _______________________________________________
> Kernelnewbies mailing list
> Kernelnewbies at kernelnewbies.org
> http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies
>


The __log_buf is a static array. Will it be in cacheable page? And by
cacheable here, I guess we mean entry present in page cache, right?

- Rohan
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.kernelnewbies.org/pipermail/kernelnewbies/attachments/20120710/26cea6fb/attachment.html 

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Changing the page attributes
  2012-07-10 16:12 ` Mulyadi Santosa
  2012-07-10 16:39   ` rohan puri
@ 2012-07-11  6:34   ` Arun KS
  2012-07-11 11:01     ` Arun KS
  1 sibling, 1 reply; 6+ messages in thread
From: Arun KS @ 2012-07-11  6:34 UTC (permalink / raw)
  To: kernelnewbies

Hello Mulyadi,

On Tue, Jul 10, 2012 at 9:42 PM, Mulyadi Santosa
<mulyadi.santosa@gmail.com> wrote:
> Hi..
>
> On Tue, Jul 10, 2012 at 6:51 PM, Arun KS <getarunks@gmail.com> wrote:
>> Hello Experts,
>>
>> I have a requirement to change __log_buf memory(kernel printk buffer)
>> as non cacheable memory.
>> How can I change the page attributes for changing cache policy to non cacheable?
>
> I just can give short clue. I think somehow you must find its PTE
> entry...there, IIRC there is page attribute that can be changed to
> make it uncacheable.
>
> cross check the Intel processor manual for further clarification (if
> it's indeed x86 arch)

__log_buf size is 512KB and PTE is mapped to a 1MB section. So if I
change the attribute for this 1MB section, lot of other stuffs(in this
1MB bss section) will also become non-cachable. Looks like it is not
possible unless my __log_buf is 1MB in size.
Or I need to create another section like .init, .data, .bss and create
4KB pages(with two levels of Page Tables) instead of 1M section.

My  arch is arm-v7

Thanks,
Arun
>
> --
> regards,
>
> Mulyadi Santosa
> Freelance Linux trainer and consultant
>
> blog: the-hydra.blogspot.com
> training: mulyaditraining.blogspot.com

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Changing the page attributes
  2012-07-11  6:34   ` Arun KS
@ 2012-07-11 11:01     ` Arun KS
  2012-07-11 12:10       ` Mulyadi Santosa
  0 siblings, 1 reply; 6+ messages in thread
From: Arun KS @ 2012-07-11 11:01 UTC (permalink / raw)
  To: kernelnewbies

On Wed, Jul 11, 2012 at 12:04 PM, Arun KS <getarunks@gmail.com> wrote:
> Hello Mulyadi,
>
> On Tue, Jul 10, 2012 at 9:42 PM, Mulyadi Santosa
> <mulyadi.santosa@gmail.com> wrote:
>> Hi..
>>
>> On Tue, Jul 10, 2012 at 6:51 PM, Arun KS <getarunks@gmail.com> wrote:
>>> Hello Experts,
>>>
>>> I have a requirement to change __log_buf memory(kernel printk buffer)
>>> as non cacheable memory.
>>> How can I change the page attributes for changing cache policy to non cacheable?
>>
>> I just can give short clue. I think somehow you must find its PTE
>> entry...there, IIRC there is page attribute that can be changed to
>> make it uncacheable.
>>
>> cross check the Intel processor manual for further clarification (if
>> it's indeed x86 arch)
>
> __log_buf size is 512KB and PTE is mapped to a 1MB section. So if I
> change the attribute for this 1MB section, lot of other stuffs(in this
> 1MB bss section) will also become non-cachable. Looks like it is not
> possible unless my __log_buf is 1MB in size.
> Or I need to create another section like .init, .data, .bss and create
> 4KB pages(with two levels of Page Tables) instead of 1M section.
>
> My  arch is arm-v7

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?

Thanks,
Arun

>
> Thanks,
> Arun
>>
>> --
>> regards,
>>
>> Mulyadi Santosa
>> Freelance Linux trainer and consultant
>>
>> blog: the-hydra.blogspot.com
>> training: mulyaditraining.blogspot.com

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Changing the page attributes
  2012-07-11 11:01     ` Arun KS
@ 2012-07-11 12:10       ` Mulyadi Santosa
  0 siblings, 0 replies; 6+ messages in thread
From: Mulyadi Santosa @ 2012-07-11 12:10 UTC (permalink / raw)
  To: kernelnewbies

Hi Arun... :)

On Wed, Jul 11, 2012 at 6:01 PM, Arun KS <getarunks@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

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2012-07-11 12:10 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-07-10 11:51 Changing the page attributes Arun KS
2012-07-10 16:12 ` Mulyadi Santosa
2012-07-10 16:39   ` rohan puri
2012-07-11  6:34   ` Arun KS
2012-07-11 11:01     ` Arun KS
2012-07-11 12:10       ` Mulyadi Santosa

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.