Skip to contentSkip to conversation

page locking in PowerPC cores

DISCUSSION Parav Pandit 3 participants 4 messages Jul 18, 2006 – Jul 20, 2006

lore
Share & tools
lore
#0 lore raw

Hi,

We allocate memory for DMA operation on PCI device using pci_alloc_constistent().

I want to know how this function is boil down to the actual instruction which locks the page in the RAM so that it cannot be paged out and dma can do its work.

Can anybody tell me which instructions do we use to set this page entry in TLB and page table? What bit gets set in the PTE for this?

Regards,
Parav Pandit

---------------------------------
Do you Yahoo!?
Next-gen email? Have it all with the all-new Yahoo! Mail Beta.

#1 lore raw
Quoted 5 lines · Parav Pandit

Hi,

We allocate memory for DMA operation on PCI device using pci_alloc_constistent().

I want to know how this function is boil down to the actual instruction which locks the page in the RAM so that it cannot be paged out and dma can do its work.

This is trivial - you can start with looking at the implementation.

Quoted 3 lines

Can anybody tell me which instructions do we use to set this page entry in TLB and page table? What bit gets set in the PTE for this?

Why do you need this page in TLB?

In general you don't have to worry about _any_ memory you allocated in the kernel to be paged out.

Signature · 1 line
Eugene
#2 lore raw
Quoted 11 lines · --- Eugene Surovegin
Quoted 1 line

We allocate memory for DMA operation on PCI

device using pci_alloc_constistent().

Quoted 2 lines

I want to know how this function is boil down to

the actual instruction which locks the page in the RAM so that it cannot be paged out and dma can do its work.

This is trivial - you can start with looking at the implementation.

[Parav]
I did it, but after reaching __alloc_pages() its getting difficult to understand.
Here is the sequence:
pci_alloc_consistent()
-> __get_free_pages()
->alloc_pages(gfp_mask, order)

      ->alloc_pages_current()
         -> __alloc_pages()

It does something with zones. Looks like zone memory pages are locked in the beginning.
Still could not figure out the instuctions for page locking.

Quoted 6 lines
Quoted 2 lines

Can anybody tell me which instructions do we use

to set this page entry in TLB and page table?

Quoted 1 line

What bit gets set in the PTE for this?

Why do you need this page in TLB?

[Parav] No, I don't want. I just wanted to see the code for locking inside TLB or in page table.

Quoted 5 lines

In general you don't have to worry about _any_ memory you allocated in
the kernel to be paged out.

[Parav] As driver writer, I agree I don't need to, but to better understand the system I am eager to do that.

Regards,
Parav

__________________________________________________
Do You Yahoo!?
Tired of spam? Yahoo! Mail has the best spam protection around
http://mail.yahoo.com