Re: vmapping user pages - feasible?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Thu, 25 Feb 2010, Zenek wrote:

> my kernel driver gets a userspace pointer to a memory area (virtually
> contiguous), allocated by userspace. I would like to use that memory in a
> vmalloc-like manner, i.e. I want it to be:

Its already virtually mapped for the process. The kernel can access the
data.

> I will be writing to it using the CPU only, in kernel mode.

Thats possible already.

> I understand that:
> - no page pinning is required (as only the CPU will be writing to that
> area)

Page pinning is required if the access from the kernel is asynchrononous
to user space.

> There will be no multithreaded access to that memory.

The kernel and userspace are not concurrently accessing the memory?

> If the userspace free()s the memory, I still have the pages unless I
> vunmap() them, right?

If you increase the page count then you still have the pages. The virtual
mapping goes away with the process.

> How should I go about it? Get the user's vm_area_struct, go through all
> the pages, construct an array of struct *page and vmap it?

Do a get_user_pages() on the range?

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@xxxxxxxxxx  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@xxxxxxxxx";> email@xxxxxxxxx </a>

[Index of Archives]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Bugtraq]     [Linux]     [Linux OMAP]     [Linux MIPS]     [ECOS]     [Asterisk Internet PBX]     [Linux API]