Re: chasing the four level page table

From: Roland Dreier
Date: Fri Jan 14 2005 - 22:41:21 EST


ak> Perhaps we should add a get_user_phys() or somesuch for this.

hpa> There seems to be at least two classes of device drivers --
hpa> graphics and RDMA -- which have a genuine need to DMA user
hpa> pages, after appropriate locking, of course.

I'm working on InfiniBand drivers, which will be doing RDMA. I'm
probably missing something, but get_user_pages() seems to be all I
need -- I don't see how get_user_phys() would help me. Of course I
need to do dma_map_sg() or the like to get an address I can pass to
the InfiniBand device but I don't see anything wrong with that.

There are some issues around fork() and copy-on-write, but those
really require more access to vma handling than page tables. What
would be nice would be an equivalent to do_mlock() that also sets or
clears the VM_DONTCOPY flag. This is because an RDMA application
wants to do something like mlock() to keep any pages to be DMAed
present, but even after doing mlock(), if the application forks and
touches one of these locked pages, the COW will move the page to a new
physical address.

- Roland
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/