All of lore.kernel.org
 help / color / mirror / Atom feed
* Re: Linux 2.6 : physical memory address and pid
       [not found]   ` <3HsTW-7Mx-11@gated-at.bofh.it>
@ 2005-03-13  7:43     ` Robert Hancock
  0 siblings, 0 replies; 4+ messages in thread
From: Robert Hancock @ 2005-03-13  7:43 UTC (permalink / raw)
  To: linux-kernel

Allison wrote:
> Thanks for the answer! 
> 
> Another related question :
> 
> I need to gather all application pages by reading the page tables. 
> The hard part is, I need to do this from a PCI device using DMA.  As I
> understand it,  when a DMA is being performed, the pages are pinned in
> memory . Since the PCI device has grabbed the bus, the processor is
> not able to access memory to perform page replacement right ?
> So, this is a form of mutual exclusion.

I don't think it works this way - if the system is modifying the pages 
which you're trying to do DMA reads on, you'll just read whatever data 
happens to be in memory at the time. The CPU is not "locked out" just 
because that memory is being read by a DMA transfer.

> 
> However, if I have to fetch the page struct, the process address space
> of the process owning the page (I am ignoring shared pages to make
> things simpler) and the page itself, will a scatter gather DMA make
> sure that  the processor cannot modify any of these data structures
> till the DMA is complete ? I am using Linux 2.6 and the i386
> architecture.

As above, I don't think anything ensures this. Doing DMA reads on pages 
that could potentially be being modified during the transfer isn't 
something that is typically done..

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

* Re: Linux 2.6 : physical memory address and pid
  2005-03-13  1:23 ` Matt Mackall
@ 2005-03-13  3:56   ` Allison
  0 siblings, 0 replies; 4+ messages in thread
From: Allison @ 2005-03-13  3:56 UTC (permalink / raw)
  To: linux-kernel

Thanks for the answer! 

Another related question :

I need to gather all application pages by reading the page tables. 
The hard part is, I need to do this from a PCI device using DMA.  As I
understand it,  when a DMA is being performed, the pages are pinned in
memory . Since the PCI device has grabbed the bus, the processor is
not able to access memory to perform page replacement right ?
So, this is a form of mutual exclusion.

However, if I have to fetch the page struct, the process address space
of the process owning the page (I am ignoring shared pages to make
things simpler) and the page itself, will a scatter gather DMA make
sure that  the processor cannot modify any of these data structures
till the DMA is complete ? I am using Linux 2.6 and the i386
architecture.

thanks,
Allison





On Sat, 12 Mar 2005 17:23:23 -0800, Matt Mackall <mpm@selenic.com> wrote:
> On Sat, Mar 12, 2005 at 08:05:11PM -0500, firefly blue wrote:
> > Hi,
> >
> > With the 2.6 Linux kernel, I want to find, from the physical page
> > frame, the virtual address of the page loaded in the frame and the
> > process id of the process owning it.
> 
> Follow struct page->mapping to struct address_space. A page can be
> mapped into any number of processes and multiple times per process so
> you'll need to walk the data structures there.
> 
> --
> Mathematics is the supreme nostalgia of our time.
>

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

* Re: Linux 2.6 : physical memory address and pid
  2005-03-13  1:05 firefly blue
@ 2005-03-13  1:23 ` Matt Mackall
  2005-03-13  3:56   ` Allison
  0 siblings, 1 reply; 4+ messages in thread
From: Matt Mackall @ 2005-03-13  1:23 UTC (permalink / raw)
  To: firefly blue; +Cc: linux-kernel

On Sat, Mar 12, 2005 at 08:05:11PM -0500, firefly blue wrote:
> Hi,
> 
> With the 2.6 Linux kernel, I want to find, from the physical page
> frame, the virtual address of the page loaded in the frame and the
> process id of the process owning it.

Follow struct page->mapping to struct address_space. A page can be
mapped into any number of processes and multiple times per process so
you'll need to walk the data structures there.

-- 
Mathematics is the supreme nostalgia of our time.

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

* Linux 2.6 : physical memory address and pid
@ 2005-03-13  1:05 firefly blue
  2005-03-13  1:23 ` Matt Mackall
  0 siblings, 1 reply; 4+ messages in thread
From: firefly blue @ 2005-03-13  1:05 UTC (permalink / raw)
  To: linux-kernel

Hi,

With the 2.6 Linux kernel, I want to find, from the physical page
frame, the virtual address of the page loaded in the frame and the
process id of the process owning it.

I know that 2.6 kernel implements rmap where the page points to a pte
chain. But how to I get to the pid and virtual address from pte entry?

I have tried to become a member of this list. But don't have a confirmation yet.
So, please cc the replies to me.

thanks,
Allison

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

end of thread, other threads:[~2005-03-13  7:44 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <3HpMi-5nQ-3@gated-at.bofh.it>
     [not found] ` <3Hq5K-5CP-13@gated-at.bofh.it>
     [not found]   ` <3HsTW-7Mx-11@gated-at.bofh.it>
2005-03-13  7:43     ` Linux 2.6 : physical memory address and pid Robert Hancock
2005-03-13  1:05 firefly blue
2005-03-13  1:23 ` Matt Mackall
2005-03-13  3:56   ` Allison

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.