Re: Problem with remap_page_range/mmap

Christoph Hellwig
2004-03-26T07:17:42Z

On Fri, Mar 26, 2004 at 12:48:04AM +0100, Christian Leber wrote:
> addr = __get_free_pages(GFP_KERNEL,0);
> int atoll_fops_mmap(struct file *filp, struct vm_area_struct *vma)
> {
> vma->vm_flags |= VM_SHM | VM_LOCKED | VM_IO;
>
> if(remap_page_range_A(vma,
> vma->vm_start, addr, 4096,
> vma->vm_page_prot)) {
> printk("remapping send space failed\n");
> return -ENXIO;
> }

You can't call remap_page_range on normal kernel pages. It works only
if you mark them PG_reserved, but even that use is usually not a good idea.