Skip to contentSkip to conversation

Shared and/or locked anonymous pages

DISCUSSION girish 1 participant 1 message Sep 28, 2006 Memory management

lore
Share & tools
lore

girish

author
#0 lore raw

Hello.

I have a *very* basic question!

Is it legal to provide anonymous mapping on shared and/or locked pages in user space?

I am trying to implement a Special VM area in the user space, which will map the kernel I/O space. A straightforward & simple approach would be to go through /dev/mem or /dev/kmem device. But I am trying to implement one system call which will do the job of anonymous mapping.

Here is an algorithm I have in mind -

        struct vm_area_struct *vma = create_anon (current->mm, addr, size)
        struct page *pg = alloc_pages (nrpages, locked | shared)
        vma->vm_pgoff = page_to_pfn (pg)
        remap_pfn_range (vma... vma->vm_pgoff... Size... locked | shared)

Is it possible? If it is not - what is the reason?

Thanks.
Girish.

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